> ## 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.

# Start order fulfillment

> Order-fulfillment workflow started; id is order-fulfillment-{brand_uuid}-{order_id} so a duplicate checkout webhook collides with the in-flight run.

### Request body

`object`

<ParamField body="brand_id" type="string" required />

<ParamField body="order_id" type="string" required />

<ParamField body="order_total_cents" type="integer" required />

<ParamField body="currency" type="string" required />

<ParamField body="line_items" type="object[]" required />

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

<ParamField body="fulfillment_tool" type="string" required />

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

<ParamField body="review_cap_cents" type="integer" />

### Response

`StartWorkflowResponse`

<ResponseField name="workflow_id" type="string" required />

<ResponseField name="run_id" type="string" />

### Status codes

| Code  | Meaning                                                                                                                                                                    |
| ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200` | Order-fulfillment workflow started; id is `order-fulfillment-&#123;brand_uuid&#125;-&#123;order_id&#125;` so a duplicate checkout webhook collides with the in-flight run. |
| `400` | Validation error                                                                                                                                                           |
| `401` | Unauthorized                                                                                                                                                               |
| `404` | Not found                                                                                                                                                                  |
| `429` | Rate limited                                                                                                                                                               |
| `500` | Internal error                                                                                                                                                             |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.workstream.stateset.com/v1/workflows/order-fulfillment/start' \
    --header "x-api-key: $STATESET_TEMPORAL_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
    "brand_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "order_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "order_total_cents": 4900,
    "currency": "USD",
    "line_items": [
      {
        "sku": "SKU-TENT-2P-GRN",
        "quantity": 2
      }
    ],
    "reservation_params": {},
    "fulfillment_tool": "string",
    "fulfillment_params": {},
    "review_cap_cents": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "workflow_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
  ```
</ResponseExample>
