Create a subscription

Creates a new subscription for a customer. The response includes a hosted payment session URL where the customer completes their initial payment method setup.

POST

Headers

string

The Bearer token for authentication.

string

The user agent of the request. Must contain at least two identifiers separated by a space.

string

The content type of the request.

Request Body

application/json
string

ID or email address of the customer being billed.

boolean

Flag indicating if the subscription should auto renew at each billing cycle.

array

List of line items for the subscription.

string

The ID of the plan option to subscribe to.

number

Number of units.

Response Body

application/json
boolean

Indicates that the request was successful.

object

Subscription session data.

string

The ID of the newly created subscription.

string

The status of the newly created subscription.

object

The session details for collecting payment

string

The checkout url

date-time

Session expiration time.