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": 215,
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 5028,
  • "date": "2025-06-01T08:20:00",
  • "amount": 57.5,
  • "status": "ACCEPTED",
  • "customer": {
    },
  • "address": {
    },
  • "payment": {
    },
  • "items": [
    ]
}

Search for orders

Search for orders

query Parameters
customerId
required
integer
Example: customerId=215

the customer identifier

year
required
integer >= 2000
Example: year=2025

the year of the orders

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Find an order

Find an order

path Parameters
id
required
integer
Example: 5028

the order identifier

Responses

Response samples

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

Cancel an order

Cancel an order

path Parameters
id
required
integer
Example: 5028

the order identifier

Responses

Response samples

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