Order API (1.0)

Download OpenAPI specification:

Order REST API Documentation

Place an order

Place an order

Request Body schema: application/json
required

the order data

customerId
required
integer
required
Array of objects (PurchaseOrderItem)

Responses

Request samples

Content type
application/json
{
  • "customerId": 213,
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 9016,
  • "date": "2020-06-01T08:20:00",
  • "amount": 57.5,
  • "status": "SHIPPED",
  • "customer": {
    },
  • "address": {
    },
  • "items": [
    ]
}

Search for orders

Search for orders

query Parameters
customerId
required
integer
Example: customerId=213

the customer identifier

year
required
integer >= 2000
Example: year=2020

the year of the orders

Responses

Response samples

Content type
application/json
[
  • [
    ]
]

Find an order

Find an order

path Parameters
id
required
integer
Example: 9016

the order identifier

Responses

Response samples

Content type
application/json
{
  • "id": 9016,
  • "date": "2020-06-01T08:20:00",
  • "amount": 57.5,
  • "status": "SHIPPED",
  • "customer": {
    },
  • "address": {
    },
  • "items": [
    ]
}

Cancel an order

Cancel an order

path Parameters
id
required
integer
Example: 9016

the order identifier

Request Body schema: application/json
required

the order status

status
string
Value: "CANCELED"

Responses

Request samples

Content type
application/json
{
  • "status": "CANCELED"
}

Response samples

Content type
application/json
{
  • "status": 404,
  • "title": "Not Found",
  • "detail": "Order 9016 not found",
  • "instance": "/orders/9016"
}