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

# Set shipping

> Set shipping

### Path parameters

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

### Request body

`SetCartShippingRequest`

<ParamField body="shipping_address" type="CartAddressRequest" required />

<ParamField body="shipping_amount" type="string,null">
  Decimal shipping amount as a string.
</ParamField>

<ParamField body="shipping_carrier" type="string,null" />

<ParamField body="shipping_method" type="string,null" />

### Responses

<ResponseField name="200" type="CartResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/carts/{id}/shipping' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "shipping_address": {
      "city": "string",
      "company": null,
      "country": "string",
      "email": null,
      "first_name": null,
      "last_name": null,
      "line1": "string",
      "line2": null,
      "phone": null,
      "postal_code": "string",
      "state": null
    },
    "shipping_amount": null,
    "shipping_carrier": null,
    "shipping_method": null
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "cart_number": "string",
    "created_at": "string",
    "currency": "string",
    "customer_email": null,
    "customer_id": null,
    "discount_amount": "string",
    "grand_total": "string",
    "id": "string",
    "items": [
      {
        "discount_amount": "string",
        "id": "string",
        "name": "string",
        "product_id": null,
        "quantity": 1,
        "sku": "string",
        "total": "string",
        "unit_price": "string"
      }
    ],
    "order_id": null,
    "order_number": null,
    "payment_method": null,
    "shipping_amount": "string",
    "shipping_method": null,
    "status": "string",
    "subtotal": "string",
    "tax_amount": "string"
  }
  ```
</ResponseExample>
