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

> Create a subscription

### Request body

`CreateSubscriptionRequest`

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

<ParamField body="customer_id" type="string (uuid)" required />

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

<ParamField body="plan_id" type="string (uuid)" required />

<ParamField body="skip_trial" type="boolean,null" />

### Responses

<ResponseField name="201" type="SubscriptionResponse" />

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

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/subscriptions' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "coupon_code": null,
    "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "payment_method_id": null,
    "plan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "skip_trial": null
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "billing_interval": "string",
    "created_at": "string",
    "currency": "string",
    "customer_id": "string",
    "id": "string",
    "price": "string",
    "status": "string",
    "updated_at": "string"
  }
  ```
</ResponseExample>
