Skip to main content

ACP Async Processing

Use async processing for high volume or time-sensitive workflows. ACP returns a job ID you can poll for completion.

Submit an Async Order

curl -X POST https://your-server.com/v1/tenants/{tenant_id}/acp/orders/async \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... order data ... }'

Response

{
  "data": {
    "jobId": "550e8400-e29b-41d4-a716-446655440000",
    "status": "queued",
    "message": "Order ORD-1001 accepted for processing"
  }
}

Check Status

curl https://your-server.com/v1/tenants/{tenant_id}/jobs/{jobId} \
  -H "Authorization: Bearer YOUR_API_KEY"

Job Status Response

{
  "data": {
    "jobId": "550e8400-e29b-41d4-a716-446655440000",
    "jobType": "acp_order_process",
    "state": "succeeded",
    "createdAt": "2024-01-15T10:30:00Z",
    "startedAt": "2024-01-15T10:30:01Z",
    "finishedAt": "2024-01-15T10:30:03Z",
    "result": {
      "orderId": "agent-order-001",
      "orderNumber": "ORD-1001",
      "statesetOrderId": "550e8400-e29b-41d4-a716-446655440000",
      "fulfillment": { "provider": "dcl", "success": true },
      "erp": { "provider": "netsuite", "success": true, "netsuiteId": "12345" }
    }
  }
}