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

# Create subscriptions

<div className="m-badge-page-wrapper">
  <Badge stroke color="orange" size="sm">Limited Release</Badge>
</div>

A subscription is a customer's enrollment in a pricing plan with specific billing configuration.

Subscriptions connect the following:

* <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers" target="_blank" rel="noopener noreferrer">Customers</a> who receive service and are billed for usage.
* <a href="/limited-release/usage-based-billing/set-up-billing-process/create-pricing-plans" target="_blank" rel="noopener noreferrer">Pricing plans</a> that define metrics, pricing models, and features.
* Billing configuration that determines when billing starts and which payment method to use.

## Prerequisites

* Create and set up all
  <a href="/limited-release/usage-based-billing/set-up-billing-process/create-pricing-plans" target="_blank" rel="noopener noreferrer">pricing plans</a>
  that you offer to customers.
* <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers" target="_blank" rel="noopener noreferrer">Register customers</a>
  who use Usage-based Billing plans.

## 1. Understand subscription configuration

Before you create a subscription, collect these configuration details from your customer and system. Then, you can make a POST call to the <a href="/reference/api/rest/subscriptions/create-a-new-subscription" target="_blank" rel="noopener noreferrer">Create subscription</a> endpoint to send the information to PayPal.

**Customer information**

**External customer ID**: Set this to the unique identifier (`external_id`) returned when you created the customer. This value links the subscription to a specific customer.

**Plan details**

* **Plan code**: Set this to the code for the pricing plan your customer selected.
* **Plan overrides**: You can negotiate special contracts with customers. These contracts can include custom discounts and price adjustments that differ from your standard plan. When you create the subscription, you can override the base plan with these negotiated terms.

  You can override these plan elements:

  * Subscription invoice display name
  * Subscription fee
  * Plan trial period
  * Plan taxes
  * Charge properties (except the charge model)
  * Charge minimum spending
  * Charge taxes
  * Charge invoice display name
  * Minimum commitment amount and display name

<Warning>
  If you later update the original plan, you can choose to cascade those updates to subscriptions with overridden plan values. You can use the `cascading_updates` parameter in your <a href="/limited-release/usage-based-billing/manage-entities/manage-pricing-plans#update-plan-details" target="_blank" rel="noopener noreferrer">plan update request</a> to do this.
</Warning>

**Billing setup**

* **Billing time**: Choose when billing cycles start. You can start them on a calendar date (like the 1st of each month) or on the same date the subscription begins each month.
* **Start date**: Send the date when your customer's subscription starts.
* **End date**: Optionally specify when the subscription should end if it has a defined term.

**Additional required information**

**External ID**: Create and set a unique identifier for your subscription.

## 2. Create subscription

Use a <a href="/developer/how-to/api/get-started#2-get-an-access-token" target="_blank" rel="noopener noreferrer">valid access token</a> and make a POST call to the `/v1/commerce/billing/subscriptions` endpoint. Include the following parameters:

| <span style={{textAlign: 'left', display: 'block'}}>Parameter</span>                                                                                                                                               | <span style={{textAlign: 'left', display: 'block'}}>Action</span>                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                                                                                                    | Provide a human-readable name for the subscription.                                                                                                                                                                                              |
| `external_customer_id`<br /><span style={{color: 'red', fontSize: 'smaller'}}>Required</span>, <span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                 | Set to the `external_id` returned when you <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers" target="_blank" rel="noopener noreferrer">registered the customer</a>.                                       |
| `external_id`<br /><span style={{color: 'red', fontSize: 'smaller'}}>Required</span>, <span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                          | Set a unique identifier for this subscription. Use only alphanumeric characters, underscores, and hyphens.                                                                                                                                       |
| `plan_code`<br /><span style={{color: 'red', fontSize: 'smaller'}}>Required</span>, <span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                            | Set to the `code` returned when you <a href="/limited-release/usage-based-billing/set-up-billing-process/create-pricing-plans" target="_blank" rel="noopener noreferrer">created the pricing plan</a>.                                           |
| `billing_time`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                                                                                            | Set to `CALENDAR` to align billing cycles to calendar periods (for example, bill on the 1st of each month) or `ANNIVERSARY` to start billing cycles from the subscription date.                                                                  |
| `start_date`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                                                                                              | Set the date when the subscription begins in ISO 8601 format with timezone. Usage tracking starts from this date.                                                                                                                                |
| `end_date`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span>                                                                                                                                | Set the date when the subscription ends in ISO 8601 format with timezone. Optional for subscriptions with a specific end date.                                                                                                                   |
| `plan_overrides`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>object</span>                                                                                                                          | Add plan customizations based on negotiated contracts.<br /><br /><b>Possible values:</b> `amount`, `name`, `trial_period`, `tax_codes`, `charges`, `minimum_commitment`.                                                                        |
| `plan_overrides.tax_codes`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>array</span>                                                                                                                 | Provide an array of tax codes to apply at the plan level (for example, `["standard_vat"]`).                                                                                                                                                      |
| `plan_overrides.charges[].id`<br /><span style={{color: 'red', fontSize: 'smaller'}}>Required when plan\_overrides.charges\[] provided</span>, <span style={{color: '#95a5a6', fontSize: 'smaller'}}>string</span> | Set to the `usage_based_charges[].id` returned when you <a href="/limited-release/usage-based-billing/set-up-billing-process/create-pricing-plans#3-create-pricing-plan" target="_blank" rel="noopener noreferrer">created the pricing plan</a>. |
| `plan_overrides.charges[].tax_codes`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>array</span>                                                                                                       | Provide an array of tax codes to apply to this charge (for example, `["standard_vat"]`).                                                                                                                                                         |
| `plan_overrides.minimum_commitment.tax_codes`<br /><span style={{color: '#95a5a6', fontSize: 'smaller'}}>array</span>                                                                                              | Provide an array of tax codes to apply to the minimum commitment (for example, `["standard_vat"]`).                                                                                                                                              |

For information on all parameters, see <a href="/reference/api/rest/subscriptions/create-a-new-subscription" target="_blank" rel="noopener noreferrer">API reference</a>.

<CodeGroup>
  ```shell lines expandable title="Sample request" theme={null}
  curl -X POST -L 'https://api-m.sandbox.paypal.com/v1/commerce/billing/subscriptions' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <ACCESS-TOKEN>' \
    -d '{
        "name": "Premium Monthly Subscription",
        "external_customer_id": "5eb02857-a71e-4ea2-bcf9-1753840218",
        "external_id": "Subscription_External_1",
        "plan_code": "Plan-Code-_1753840215",
        "billing_time": "ANNIVERSARY",
        "start_date": "2025-07-30T01:54:40Z",
        "end_date": "2025-09-09T04:26:24Z",
        "plan_overrides": {
            "amount": {
                "value": 20.05,
                "currency_code": "USD"
            },
            "name": "Plan-Name-_1753840215",
            "trial_period": 14,
            "tax_codes": [
                "standard_vat"
            ],
            "charges": [
                {
                    "id": "2e097d19-1350-4baf-8add-5d19ecef8113",
                    "properties": {
                        "amount": "100.15"
                    },
                    "min_amount": {
                        "value": 200.00
                    },
                    "tax_codes": [
                        "standard_vat"
                    ]
                }
            ],
            "minimum_commitment": {
                "invoice_display_name": "Negotiated Minimum Commitment",
                "amount": {
                    "value": 500.00
                },
                "tax_codes": [
                    "standard_vat"
                ]
            }
        }
    }'
  ```

  ```json lines expandable title="Sample response" theme={null}
  {
      "id": "b71befc2-4799-402c-9d13-ca1f72759c64",
      "name": "Premium Monthly Subscription",
      "external_customer_id": "5eb02857-a71e-4ea2-bcf9-1753840218",
      "external_id": "Subscription_External_1",
      "plan_code": "Plan-Code-_1753840215",
      "billing_time": "ANNIVERSARY",
      "status": "ACTIVE",
      "plan_overrides": {
          "amount": {
              "value": 20.05,
              "currency_code": "USD"
          },
          "taxes": [
              {
                  "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                  "name": "TVA",
                  "code": "standard_vat",
                  "description": "French standard VAT",
                  "rate": "20.00",
                  "created_at": "2023-07-06T14:35:58Z"
              }
          ],
          "name": "Plan-Name-_1753840215",
          "trial_period": 14,
          "charges": [
              {
                  "id": "99fa7a6b-d005-43a5-8bab-0df7a2a721fb",
                  "metric_id": "d0682999-67a0-418e-b29b-3757426db01f",
                  "charge_model": "STANDARD",
                  "properties": {
                      "amount": "100.15"
                  },
                  "min_amount": {
                      "value": 200.00,
                      "currency_code": "USD"
                  },
                  "taxes": [
                      {
                          "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                          "name": "TVA",
                          "code": "standard_vat",
                          "description": "French standard VAT",
                          "rate": "20.00",
                          "created_at": "2023-07-06T14:35:58Z"
                      }
                  ]
              }
          ],
          "minimum_commitment": {
              "amount": {
                  "value": 500.00,
                  "currency_code": "USD"
              },
              "taxes": [
                  {
                      "id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                      "name": "TVA",
                      "code": "standard_vat",
                      "description": "French standard VAT",
                      "rate": "20.00",
                      "created_at": "2023-07-06T14:35:58Z"
                  }
              ],
              "invoice_display_name": "Negotiated Minimum Commitment",
              "plan_code": "Plan-Code-_1753840215",
              "created_at": "2025-07-31T13:00:04Z",
              "updated_at": "2025-07-31T13:00:04Z"
          }
      },
      "start_date": "2025-07-30T01:54:40Z",
      "end_date": "2025-09-09T04:26:24Z",
      "created_at": "2022-07-30T00:00:00Z",
      "current_period_start": "2025-07-30T01:54:40Z",
      "current_period_end": "2025-08-05T23:59:59Z"
  }
  ```
</CodeGroup>

A successful call returns a `201 Created` response. The response includes the following parameter:

| <span style={{textAlign: 'left', display: 'block'}}>Parameter</span>                   | <span style={{textAlign: 'left', display: 'block'}}>Description</span> | <span style={{textAlign: 'left', display: 'block'}}>Further action</span>                                                                                                                        |
| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `external_id`<br /><span style={{color: '#95A5A6', fontSize: 'smaller'}}>string</span> | Unique identifier for the subscription.                                | Use this `external_id` when <a href="/limited-release/usage-based-billing/monitor-usage/poll-customer-usage" target="_blank" rel="noopener noreferrer">querying current and past usage data</a>. |

For information on all parameters, see <a href="/reference/api/rest/subscriptions/create-a-new-subscription" target="_blank" rel="noopener noreferrer">API reference</a>.

## 3. Understand subscription lifecycle and manage subscriptions

Subscriptions progress through distinct states throughout their lifecycle. These states determine billing behavior and available management actions.

To monitor a subscription's current state, make a GET call to the <a href="/reference/api/rest/subscriptions/get-a-subscription-by-id" target="_blank" rel="noopener noreferrer">/v1/commerce/billing/subscriptions/{id}</a> endpoint and review the `status` parameter. The subscription's lifecycle state determines the management actions you can perform to ensure proper subscription handling.

| State          | Description                                             | Customer billing                                  | Possible management actions                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------- | ------------------------------------------------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ACTIVE**     | Subscription is running and tracking usage              | Customer is billed according to plan              | <a href="/limited-release/usage-based-billing/manage-entities/manage-subscriptions#update-subscription-details" target="_blank" rel="noopener noreferrer">Update subscription details</a> – customer ID, plan configuration, billing setting, and customer metadata.<br /><br />  <a href="/limited-release/usage-based-billing/manage-entities/manage-subscriptions#cancel-subscription" target="_blank" rel="noopener noreferrer">Cancel subscription</a> |
| **PENDING**    | Subscription is created but not yet started             | No billing occurs                                 | <a href="/limited-release/usage-based-billing/manage-entities/manage-subscriptions#update-subscription-details" target="_blank" rel="noopener noreferrer">Update subscription details</a> - limited to plan configuration<br /><br />                                                                                                                                                                                                                       |
| **CANCELED**   | Pending subscription is canceled before becoming active | No billing occurs                                 | Subscription cannot be modified                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **TERMINATED** | Previously active subscription is ended                 | No billing occurs, final invoice may be generated | Subscription cannot be modified                                                                                                                                                                                                                                                                                                                                                                                                                             |
