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

# Create a checkout session

> Create a checkout session

### Request body

JSON body of type `ApiCreateCheckoutSessionRequest`.

### Responses

<ResponseField name="200" type="ApiCheckoutSession">
  Checkout session already existed
</ResponseField>

<ResponseField name="201" type="ApiCheckoutSession">
  Checkout session created
</ResponseField>

<ResponseField name="400" type="ACPErrorResponse">
  Invalid request payload
</ResponseField>

<ResponseField name="401" type="ACPErrorResponse">
  Authentication or signature failure
</ResponseField>

<ResponseField name="409" type="ACPErrorResponse">
  Unable to honor the request because of a conflict
</ResponseField>

<ResponseField name="422" type="ACPErrorResponse">
  Request failed validation
</ResponseField>

<ResponseField name="500" type="ACPErrorResponse">
  Unexpected error
</ResponseField>

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "created_at": "string",
    "customer": null,
    "fulfillment": null,
    "id": "string",
    "items": [
      {
        "id": "string",
        "image_url": null,
        "quantity": 1,
        "sku": null,
        "title": "string",
        "unit_price": {
          "amount": null,
          "currency": null
        },
        "variant_id": null
      }
    ],
    "links": null,
    "messages": null,
    "status": "string",
    "totals": {
      "discount": null,
      "grand_total": {
        "amount": 1,
        "currency": "string"
      },
      "shipping": null,
      "subtotal": {
        "amount": 1,
        "currency": "string"
      },
      "tax": null
    },
    "updated_at": "string"
  }
  ```
</ResponseExample>
