Skip to main content
Version: 1.0

Orders

Create, list, retrieve, update, and cancel orders.

  • Base path: /api/integrations/v1/orders/
  • Required scope: integrations.orders.{read|write|delete} or wildcards above.
  • Idempotency: POSTs are keyed by order_number. Re-sending the same payload returns a validation error on the duplicate — see Idempotency.

Create order

POST /api/integrations/v1/orders/

Body

FieldTypeRequiredDescription
order_numberstringYesUnique order number
external_order_idstringNoYour system's ID; used for addressing the record
customer_namestringNoCustomer name
customer_infoobjectNoAddress, phone, any structured data
notesstringNoFree-form notes
order_datedatetimeNoISO 8601
due_datedatetimeNoISO 8601
metadataobjectNoArbitrary metadata
itemsarrayYesAt least one line item
items[].sku_codestringYesMust reference an existing product SKU
items[].quantityintegerYesMinimum 1
items[].notesstringNoLine notes
curl -X POST https://<your-tenant>.datamingle.ai/api/integrations/v1/orders/ \
-H "X-API-Key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"order_number": "ORD-2026-001",
"external_order_id": "ERP-5001",
"customer_name": "Acme Corporation",
"customer_info": {"address": "123 Main St", "phone": "+1-555-0100"},
"due_date": "2026-05-01T00:00:00Z",
"items": [
{"sku_code": "RUG-5X7-BLU", "quantity": 10},
{"sku_code": "RUG-8X10-RED", "quantity": 5, "notes": "Fragile"}
]
}'

Response 201 Created

{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"order_number": "ORD-2026-001",
"external_order_id": "ERP-5001",
"customer_name": "Acme Corporation",
"status": "pending",
"items": [
{
"id": "...",
"sku": {"sku": "RUG-5X7-BLU"},
"quantity": 10,
"verified_quantity": 0,
"verification_status": "pending"
}
],
"created_at": "2026-04-16T10:00:00Z"
}
}

Errors

StatusCodeWhen
400VALIDATION_ERRORMissing or invalid fields
400SERVICE_ERRORe.g. sku_code doesn't exist
422MAPPING_ERRORField mapping engine failed on your payload
401Invalid / expired key
403Missing key or insufficient scope

List orders

GET /api/integrations/v1/orders/

Returns up to 100 most recent orders. No filtering or pagination — intended for spot-checks, not syncs. See Pagination.

curl https://<your-tenant>.datamingle.ai/api/integrations/v1/orders/ \
-H "X-API-Key: sk_live_..."

Response 200 OK

{
"success": true,
"data": [
{
"id": "...",
"order_number": "ORD-001",
"status": "pending",
"customer_name": "Acme Corp",
"created_at": "2026-04-16T10:00:00Z"
}
]
}

Get order

GET /api/integrations/v1/orders/{identifier}/

{identifier} resolves according to your identifier configuration. Returns the full order shape (same as Create).

curl https://<your-tenant>.datamingle.ai/api/integrations/v1/orders/ERP-5001/ \
-H "X-API-Key: sk_live_..."

Errors

StatusCodeWhen
404NOT_FOUNDNo order matches the identifier
401/403Auth failure — see Authentication

Update order

PUT /api/integrations/v1/orders/{identifier}/

Only header fields can be updated. Line items are immutable through this endpoint.

FieldType
customer_namestring
customer_infoobject
notesstring
due_datedatetime
metadataobject
statusstring
curl -X PUT https://<your-tenant>.datamingle.ai/api/integrations/v1/orders/ERP-5001/ \
-H "X-API-Key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{"customer_name": "Acme Corp (Updated)", "notes": "Rush"}'

Returns 200 OK with the full updated order.


Cancel order

DELETE /api/integrations/v1/orders/{identifier}/

Cancellation is soft — the order is kept, its status moves to cancelled.

Body (optional)

FieldTypeDescription
reasonstringCancellation reason
curl -X DELETE https://<your-tenant>.datamingle.ai/api/integrations/v1/orders/ERP-5001/ \
-H "X-API-Key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{"reason": "Customer requested cancellation"}'

Errors

StatusCodeWhen
400SERVICE_ERRORe.g. the order is already shipped
404NOT_FOUNDNo order matches the identifier

Order statuses

StatusMeaning
draftCreated, not yet active
pendingActive, awaiting verification
in_progressAt least one line item scanned
partially_verifiedSome lines verified
verifiedAll lines verified
shippedShipped — cannot be cancelled
cancelledCancelled