Command Palette

Search for a command to run...

Search Documentation

Search documentation topics, API endpoints, and guides

postOrders
Source

OpenAPI Documentation

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 one wallet-funded order for an orderable store product. The Idempotency-Key header is required so clients can safely retry network failures without double-charging the wallet. Reusing a key with a different payload returns IDEMPOTENCY_CONFLICT, and a still-running request returns IDEMPOTENCY_IN_PROGRESS. The response amount is charged in integer minor units.

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

201Order created.
201 Response Schema
{
  "$ref": "#/components/schemas/Order"
}
400Invalid request body or headers.
400 Response Schema
{
  "$ref": "#/components/schemas/ErrorResponse"
}
401Missing or invalid API key.
401 Response Schema
{
  "$ref": "#/components/schemas/ErrorResponse"
}
402Payment Required
403API key lacks orders:write.
403 Response Schema
{
  "$ref": "#/components/schemas/ErrorResponse"
}
404Service or customer mapping not found.
404 Response Schema
{
  "$ref": "#/components/schemas/ErrorResponse"
}
409Idempotency conflict or in-progress request.
409 Response Schema
{
  "$ref": "#/components/schemas/ErrorResponse"
}
422Order cannot be accepted.
422 Response Schema
{
  "$ref": "#/components/schemas/ErrorResponse"
}

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"
    }
  }'