> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Process an ACP order - creates in StateSet and routes to fulfillment/ERP

> ACP order accepted and routed

### Path parameters

<ParamField path="tenant_id" type="string" required>
  Tenant identifier
</ParamField>

### Request body

`object`

<ParamField body="orderId" type="string" required>
  Unique order identifier from the source system
</ParamField>

<ParamField body="orderNumber" type="string" required>
  Order number for display
</ParamField>

<ParamField body="source" type="string">
  Source system identifier (e.g., 'shopify', 'manual', 'agent'). Default `agent`
</ParamField>

<ParamField body="customer" type="object" required />

<ParamField body="shippingAddress" type="object" required />

<ParamField body="billingAddress" type="object" />

<ParamField body="lineItems" type="object[]" required>
  Order line items
</ParamField>

<ParamField body="createdAt" type="string (date-time)">
  Order creation timestamp (defaults to now)
</ParamField>

<ParamField body="tags" type="string[]">
  Order tags for categorization
</ParamField>

<ParamField body="shippingMethod" type="string">
  Shipping method
</ParamField>

<ParamField body="notes" type="string">
  Special instructions or notes
</ParamField>

<ParamField body="routing" type="object">
  Routing configuration - which systems to send the order to
</ParamField>

<ParamField body="metadata" type="object">
  Additional metadata
</ParamField>

### Response

`object`

<ResponseField name="accepted" type="boolean" required>
  Whether the order was accepted
</ResponseField>

<ResponseField name="statesetOrderId" type="string (uuid)">
  StateSet order ID (if created)
</ResponseField>

<ResponseField name="fulfillment" type="object">
  Result of fulfillment submission

  <Expandable title="fulfillment">
    <ResponseField name="provider" type="string" required>
      Provider used (dcl, cart)
    </ResponseField>

    <ResponseField name="success" type="boolean" required>
      Whether submission succeeded
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message if failed
    </ResponseField>

    <ResponseField name="externalId" type="string">
      External reference ID from fulfillment system
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="erp" type="object">
  Result of ERP submission

  <Expandable title="erp">
    <ResponseField name="provider" type="string" required>
      Provider used (netsuite)
    </ResponseField>

    <ResponseField name="success" type="boolean" required>
      Whether submission succeeded
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message if failed
    </ResponseField>

    <ResponseField name="netsuiteId" type="string">
      NetSuite internal ID
    </ResponseField>

    <ResponseField name="tranId" type="string">
      NetSuite transaction number
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="warnings" type="string[]">
  Any warnings or non-fatal issues (omitted when empty)
</ResponseField>

<ResponseField name="requestId" type="string (uuid)" required>
  Request ID for tracing
</ResponseField>

### Status codes

| Code  | Meaning                             |
| ----- | ----------------------------------- |
| `201` | ACP order accepted and routed       |
| `401` | Unauthorized                        |
| `422` | Validation error                    |
| `424` | Required integration not configured |
| `502` | Downstream service error            |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.sync.stateset.com/v1/tenants/{tenant_id}/acp/orders' \
    --header 'x-stateset-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "orderId": "string",
    "orderNumber": "ORD-10042",
    "source": "string",
    "customer": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "email": "ada.lovelace@example.com",
      "firstName": "Ada",
      "lastName": "Lovelace",
      "phone": "+1 415 555 0142",
      "netsuiteId": "string"
    },
    "shippingAddress": {
      "name": "Two-Person Tent",
      "company": "Acme Outdoors",
      "address1": "548 Market St",
      "address2": "Suite 400",
      "city": "San Francisco",
      "state": "CA",
      "postalCode": "94107",
      "countryCode": "US",
      "phone": "+1 415 555 0142"
    },
    "billingAddress": {
      "name": "Two-Person Tent",
      "company": "Acme Outdoors",
      "address1": "548 Market St",
      "address2": "Suite 400",
      "city": "San Francisco",
      "state": "CA",
      "postalCode": "94107",
      "countryCode": "US",
      "phone": "+1 415 555 0142"
    },
    "lineItems": [
      {
        "sku": "SKU-TENT-2P-GRN",
        "title": "Replacement tent pole set",
        "quantity": 2,
        "price": 49,
        "variantId": "string",
        "netsuiteItemId": "string",
        "weight": 1.2
      }
    ],
    "createdAt": "2026-08-31T14:22:05Z",
    "tags": [
      "priority"
    ],
    "shippingMethod": "ground",
    "notes": "Two-person tent, green — replacement for damaged pole set.",
    "routing": {
      "sendToFulfillment": true,
      "sendToErp": true,
      "createInStateset": true,
      "fulfillmentProvider": "string",
      "dclLocation": "string"
    },
    "metadata": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "accepted": true,
    "statesetOrderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "fulfillment": {
      "provider": "string",
      "success": true,
      "error": "string",
      "externalId": "string"
    },
    "erp": {
      "provider": "string",
      "success": true,
      "error": "string",
      "netsuiteId": "string",
      "tranId": "string"
    },
    "warnings": [
      "string"
    ],
    "requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
  ```
</ResponseExample>
