Idempotency-Key is required (422 if missing). Same key + same body → the stored response is replayed byte for byte. Same key + different body, or the first request still in flight → 409. A non-2xx response releases the key.external_order_id is unique per user (422 if repeated).billing: optional, take account billing details by default.curl --location '/api/v1/orders' \
--header 'Idempotency-Key: 7b1f3b9e-5d0e-4d6e-9a0c-2d7a9a9d0001' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"external_order_id": "ORD-2026-0001",
"customer": {
"email": "ana.perez@example.com",
"first_name": "Ana",
"last_name": "Pérez",
"locale": "es"
},
"line_items": [
{
"sku": "ESIM-ES-1GB-7D",
"quantity": 1
}
]
}'{
"data": {
"code": "20261027-000123",
"external_order_id": "string",
"type": "purchase",
"status": "open",
"financial_status": "pending",
"fulfillment_status": "unfulfilled",
"customer": {
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"phone": "string",
"external_id": "string",
"locale": "es"
},
"currency": "string",
"subtotal": "string",
"discount_total": "string",
"tax_total": "string",
"total": "string",
"billing": {
"address": "string",
"city": "string",
"zip_code": "string",
"country_iso": "ESP",
"name": "string",
"email": "user@example.com",
"phone": "string",
"id_document": "string"
},
"note": "string",
"cancel_reason": "string",
"line_items": [
{
"id": 0,
"package_id": 0,
"product_id": 0,
"sku": "string",
"name": "string",
"product_name": "string",
"esimaccess_package_code": "string",
"is_unlimited": true,
"quantity": 0,
"unit_price": "string",
"subtotal": "string",
"currency": "string",
"fulfillment_status": "unfulfilled",
"esims": [
{
"code": "string",
"status": "assigned",
"order_code": "string",
"line_item_id": 0,
"sku": "string",
"package_name": "string",
"iccid": "string",
"imsi": "string",
"activation_code": "string",
"smdp_address": "string",
"matching_id": "string",
"qr_code_url": "string",
"branded_qr_code_url": "string",
"short_url": "string",
"apn": "string",
"provider_order_no": "string",
"failure_reason": "string",
"assigned_at": "2019-08-24T14:15:22.123Z"
}
],
"topups": [
{
"code": "string",
"status": "pending",
"iccid": "string",
"esim_code": "string",
"esimaccess_package_code": "string",
"provider_order_no": "string",
"failure_reason": "string",
"applied_at": "2019-08-24T14:15:22.123Z"
}
]
}
],
"paid_at": "2019-08-24T14:15:22.123Z",
"cancelled_at": "2019-08-24T14:15:22.123Z",
"created_at": "2019-08-24T14:15:22.123Z",
"updated_at": "2019-08-24T14:15:22.123Z"
}
}