Download OpenAPI specification:
Order REST API Documentation
Place an order
the order data
| customerId required | integer |
required | Array of objects (PurchaseOrderItem) |
{- "customerId": 213,
- "items": [
- {
- "isbn": "0764574833",
- "quantity": 1
}
]
}{- "id": 9016,
- "date": "2020-06-01T08:20:00",
- "amount": 57.5,
- "status": "SHIPPED",
- "customer": {
- "id": 213,
- "firstName": "Alice",
- "lastName": "Smith",
- "email": "smith@example.org"
}, - "address": {
- "street": "123 Maple Street",
- "city": "Mill Valley",
- "stateProvince": "CA",
- "postalCode": "90952",
- "country": "US"
}, - "items": [
- {
- "book": {
- "isbn": "0764574833",
- "title": "Professional Java Development with the Spring Framework",
- "authors": "Rod Johnson, Juergen Hoeller, et al.",
- "publisher": "Wrox",
- "price": 57.5
}, - "quantity": 1
}
]
}Search for orders
| customerId required | integer Example: customerId=213 the customer identifier |
| year required | integer >= 2000 Example: year=2020 the year of the orders |
[- [
- {
- "id": 9016,
- "date": "2020-06-01T08:20:00",
- "amount": 57.5,
- "status": "SHIPPED"
}
]
]Find an order
| id required | integer Example: 9016 the order identifier |
{- "id": 9016,
- "date": "2020-06-01T08:20:00",
- "amount": 57.5,
- "status": "SHIPPED",
- "customer": {
- "id": 213,
- "firstName": "Alice",
- "lastName": "Smith",
- "email": "smith@example.org"
}, - "address": {
- "street": "123 Maple Street",
- "city": "Mill Valley",
- "stateProvince": "CA",
- "postalCode": "90952",
- "country": "US"
}, - "items": [
- {
- "book": {
- "isbn": "0764574833",
- "title": "Professional Java Development with the Spring Framework",
- "authors": "Rod Johnson, Juergen Hoeller, et al.",
- "publisher": "Wrox",
- "price": 57.5
}, - "quantity": 1
}
]
}Cancel an order
| id required | integer Example: 9016 the order identifier |
the order status
| status | string Value: "CANCELED" |
{- "status": "CANCELED"
}{- "status": 404,
- "title": "Not Found",
- "detail": "Order 9016 not found",
- "instance": "/orders/9016"
}