Skip to content

Orders_post

Luigi Minardi edited this page Mar 3, 2022 · 1 revision

Return to Orders

Create new order

Create a new order on the database.

Endpoint: /

Request:

This endpoint need login.

If you're using postman or insomnia to check the API remember to put the token of the logged user on the header, as Authorization: Bearer <token>.

Request Body:
{
    "price": 5,
    "movieId": 2,
    "userId": 1,
    "date": "2022-02-24 15:42:45" 
}
Response Body:
Response code: 201
{
    "id": 1,
    "price": 5,
    "movieId": 2,
    "userId": 1,
    "date": "2022-02-24T15:42:45.000Z",
    "updatedAt": "2022-02-24T15:42:47.000Z",
    "createdAt": "2022-02-24T15:42:47.000Z"
}