TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Create a order

POSThttps://api.testingapis.com/api/OrdersSign in to see this endpoint's URL

Request body

Optional. application/json, text/json, application/*+json, application/xml, text/xml, application/*+xml. Model: Order. The new order. Any client-supplied ID is replaced.

Example body
{
  "userId": 104,
  "items": [{"productId": 2, "title": "Smartwatch Series 6", "quantity": 1, "price": 199.99}],
  "shippingAddress": {"street": "1 Main St", "city": "Pune", "state": "MH", "zip": "411001", "country": "IN"}
}

Responses

200
OK
201
Created; returns { message, data } with the generated ID.
400
items is missing or empty.
500
Unexpected server error.

Example

Request
curl -X POST "https://api.testingapis.com/api/Orders" \
  -H "Content-Type: application/json" \
  -d '{"userId": 104, "items": [{"productId": 2, "title": "Smartwatch Series 6", "quantity": 1, "price": 199.99}], "shippingAddress": {"street": "1 Main St", "city": "Pune", "state": "MH", "zip": "411001", "country": "IN"}}' \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response201 Created
{
  "message": "Order created successfully",
  "data": {
    "id": 16,
    "userId": 104,
    "items": [{"productId": 2, "title": "Smartwatch Series 6", "quantity": 1, "price": 199.99}],
    "total": 199.99,
    "status": "pending",
    "shippingAddress": {"street": "1 Main St", "city": "Pune", "state": "MH", "zip": "411001", "country": "IN"},
    "orderedAt": "2026-09-30T18:26:45Z",
    "deliveredAt": null
  }
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.