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

# Add order item

> Add a new item to an existing order

Add a new item to an existing order

### Path parameters

<ParamField path="id" type="string" required>
  Order ID
</ParamField>

### Request body

JSON body of type `CreateOrderItem`.

### Responses

<ResponseField name="201" type="ApiResponse_OrderItem">
  Item added successfully
</ResponseField>

<ResponseField name="401" type="ErrorResponse">
  Unauthorized
</ResponseField>

<ResponseField name="403" type="ErrorResponse">
  Forbidden
</ResponseField>

<ResponseField name="404" type="ErrorResponse">
  Order not found
</ResponseField>

<ResponseField name="422" type="ErrorResponse">
  Validation error
</ResponseField>

<ResponseField name="429" type="ErrorResponse">
  Rate limit exceeded
</ResponseField>

<ResponseField name="500" type="ErrorResponse">
  Internal server error
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/orders/{id}/items' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{}'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "discount": "5.00",
      "id": "item-550e8400-e29b-41d4",
      "product_id": "prod-abc123",
      "product_name": "Wireless Bluetooth Headphones",
      "quantity": 2,
      "sku": "WBH-BLK-001",
      "tax_amount": "7.60",
      "tax_rate": "0.08",
      "total_price": "99.98",
      "unit_price": "49.99"
    },
    "errors": null,
    "message": null,
    "meta": null,
    "success": true
  }
  ```
</ResponseExample>
