Create subscription

Creates a subscription: the billing schedule a payment link follows. You set how often it bills (frequency and frequency_interval) and when it stops (end_date and/or payment_quantity; if you send both, billing stops at whichever limit is reached first).

To start on a set day, send weekly_start_day for weekly plans or monthly_start_date for monthly and annual plans. The response's start_date is then the next matching date. The response's frequency uses the singular unit (week, month, year), not the value you sent.

test is a sandbox-only frequency for trying out recurring charges. Production rejects it. See Sandbox testing.

🚧

Attach it to a payment link

A subscription does nothing on its own. Pass the returned identifier as subscription_id on Create payment link or Update payment link. Until it is attached, the other subscription endpoints return 404 for it.

Recipes
🔁
Bill a customer every month
Open Recipe
Body Params
string
enum
required

Defines the interval that this subscription will be run on. test is only available in the sandbox environment for testing purposes and is rejected in production. daily is not supported in any environment and is always rejected.

Allowed:
integer
required

Defines how often this subscription will run, in units of frequency (for example 2 with monthly bills every two months). Use 1 or more; the API doesn't currently reject 0.

string
\d{4}\/\d{2}\/\d{2}

The last date this subscription could run on.

integer

Number of successful charges after which billing stops. If end_date is also set, billing stops at whichever comes first.

string
enum

The day of the week this subscription starts on. Only applicable when frequency is weekly.

Allowed:
integer
1 to 31

The day of the month this subscription starts on. Only applicable when frequency is monthly or annually.

Headers
string

A unique key, such as a UUID, that makes it safe to retry this request. Reuse the same key when you retry. See Idempotency.

Responses

429

Too many requests. You sent more than 100 requests in 30 seconds from one IP address. This response has no JSON body. See Rate limits.

500

Unexpected error

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json