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

> Set payment

### Path parameters

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

### Request body

`SetCartPaymentRequest`

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

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

<ParamField body="payment_token" 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}/payment' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "billing_address": null,
    "payment_method": "string",
    "payment_token": 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>
