> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creptapay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Subscription

Subscribe a customer to a plan.

The plan's price, cadence and grace period are copied onto the subscription at
this moment. Editing the plan afterwards never changes what this subscriber
pays — see [Subscriptions](/guides/subscriptions).

## Request authentication

This endpoint requires a **Secret Key** (`sk_...`) passed in either the
`x-api-key` header or as a Bearer token in the `Authorization` header.

## Request parameters

<ResponseField name="plan" type="string" required>
  The id of the plan to subscribe them to.
</ResponseField>

<ResponseField name="customer" type="object">
  A new customer. Use this or `customer_id`.

  <Expandable title="properties">
    <ResponseField name="first_name" type="string" required>
      The first name of the customer.
    </ResponseField>

    <ResponseField name="last_name" type="string" required>
      The last name of the customer.
    </ResponseField>

    <ResponseField name="email" type="string" required>
      Where renewal notices are sent.
    </ResponseField>

    <ResponseField name="phone" type="string">
      The phone number of the customer.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="customer_id" type="string">
  An existing customer on your business. Use this or `customer`.
</ResponseField>

<ResponseField name="collection_mode" type="string">
  `invoice` or `auto_debit`. Defaults to whatever the plan allows.
</ResponseField>

<ResponseField name="trial_days" type="integer">
  Overrides the plan's trial for this subscriber only.
</ResponseField>

<ResponseField name="metadata" type="object">
  Any key-value data you want stored alongside the subscription.
</ResponseField>
