Create a Subscription

This API creates a subscription.

Body Params
string
required

An ID against which a new subscription will be created.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatNotes
AlphanumericProvide customer_id that was created using the Create a Customer API.

string
required

An plan ID against which a new subscription is created.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatNotes
Alphanumeric and Special CharactersProvide plan_id that was created using the Create a Plan API.

int32

Days after which the subscription will start.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatMin LengthMax Length
Numeric1365

int32

Number of days until the subscription is under the trial period.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatMin LengthMax LengthExamples
Numeric0365Created at: 2021-05-05
Trial Days: 3
What it means? Your billing for the subscription will start from 2021-05-08 till the end of the subscription period.

int32

Number of cycles after which a subscription will end.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatMin LengthMax Length
Numeric1999

string

An ID that refers to a coupon when applying to a subscription.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatNotes
Alphanumeric and Special CharactersProvide discount_id that was created using the Create a Coupon API.

int32

The type of billing applied to a subscription.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatDefaultMin LengthMax LengthNotes
Boolean1011 represents billing type is 'Automatic' where you will be charged with the default card on file. 0 represents customer billing type is 'Manual' where you will receive a payment link over an email.

int32

Number of days the payment is due after the invoice is sent.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatMin LengthMax LengthExamplesNotes
Numeric1 digit2 digits3, 23This field is required if billing_type is 0.

string

An arbitrary string that describes a subscription.
td { padding: 2px 4px; border: 1px solid #ddd; font-size: 0.65em; line-height: 1.2; }

FormatMin LengthMax LengthExamples
Alphanumeric and Special Characters5 characters200 charactersA1 Company 888-888-8888

Headers
string
required
Defaults to application/json

Indicates which content types, expressed as MIME types, the client is able to understand.

string
required
Defaults to application/json

Indicates the media type of the resource sent in the HTTP message body.

Possible Values:
application/json
application/x-www-form-urlencoded

Responses

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