Skip to main content
postOrders
Source

Documentation OpenAPI

POST /v1/orders

Create an order

Create one wallet-funded order with idempotent retry protection.

Last updated on 5/26/2026

Endpoint

post
/v1/orders

Creates a wallet-funded order. Idempotency-Key is required; identical retries reuse the encrypted order result for 24 hours, changed payloads return IDEMPOTENCY_CONFLICT, and concurrent requests return IDEMPOTENCY_IN_PROGRESS. After the replay window, reconcile by externalOrderId; an uncertain request is never blindly re-executed.

Authentication

Include your customer API key in the Authorization header:

shell
Authorization: Bearer $AUTOMATIC_PALLET_API_KEY

Request

Parameters

NameInTypeRequiredDescription
idempotency-keyheaderstringRequiredRequired for order creation. Reuse the same key to safely retry.

Request Body (application/json)

JSON Schema / Example
{
  "$ref": "#/components/schemas/CreateOrderRequest"
}

Responses

201The request has succeeded and a new resource has been created as a result.
201 Response Schema
{
  "$ref": "#/components/schemas/Order"
}
400The server could not understand the request due to invalid syntax.
400 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
401Access is unauthorized.
401 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
402Client error
402 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
403Access is forbidden.
403 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
404The server cannot find the requested resource.
404 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
409The request conflicts with the current state of the server.
409 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
422Client error
422 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
429Client error
429 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
500Server error
500 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}
503Service unavailable.
503 Response Schema
{
  "$ref": "#/components/schemas/CustomerApiErrorResponse"
}

Example cURL Request

cURL
curl "https://automaticpallet.com/v1/orders" \
  -X POST \
  -H "Authorization: Bearer $AUTOMATIC_PALLET_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: client-order-1001" \
  --data '{
    "serviceId": "prod_123",
    "target": "@customer_handle",
    "quantity": 100,
    "metadata": {
      "externalOrderId": "client-order-1001"
    }
  }'