Preview a subscription

Integrators can use this API Endpoint to generate a preview to ensure the subscription created is correct before calling the "Create Subscription API".

Body Params
string
required

Auto-generated identifier of the customer.

string
required

Auto-generated identifier of the plan.

boolean
Defaults to false

Default value is false. If set to true, creates a subscription with a Pending status. A pending subscription will ignore the subscription's startDate and no schedules will be created. The status can be changed to Active using the Activate a subscription API.

string

The preferred start date of the subscription. The subscription start date cannot be back-dated. The default value follows the plan's start date. Supported format is YYYY-MM-DD.

string

The name of the plan to subscribe the customer to. Max of 50 characters.

string

Specify an accounting code to categorise revenue collected from the subscription's payment. Max of 50 characters.

amount
object

The gross amount charged to the customer, inclusive of tax. Supports decimal values for cents. For example, $24.50 would be 24.50.

tax
object

If provided, each invoice generated for this subscription will include a tax rate.

setupPayments
object

One-time setup payment applied to the subscription.

string

Number to be specified as interval to manipulate billing frequency. For example interval=2 and intervalUnit=week would means billing every 2 weeks. If no value is provided, the default value is 1.

string
Defaults to week

Specifies frequency of billing. Valid values are day, week or month. If no value is provided, the default value is week.

string

Specifies the default day the billing schedule starts for customers subscribed to the plan. Supported values are: immediate - Default value. Subscriptions will start on the same day. day_of_week - Subscriptions will start on a specific day as defined in billingStartValue. Only supported if interval = week day_of_month - Subscriptions will start on specific day in the month as defined in billingStartValue. Only supported if interval = month

string
Defaults to ongoing

Specifies the rules to automate when a subscription ends. Supported values are: ongoing - Default value. Subscriptions created from this plan will have no end date and continue billing on an ongoing basis (until instructions are given to stop billing). amount_collected - Subscriptions will end when a specified amount is collected as defined in billingEndValue. billing_cycles - Subscriptions will end after a specified number of billing cycles as defined in billingEndValue. end_date - Subscriptions will end on date defined in billingEndValue.

string

Specifies the rules to auto-calculate the billing charges for the first scheduled billing. The default value follows the plan's firstBilling. Supported values are: full_amount - The first billing will charge the full amount on the subscription as defined in the plan's amount. prorate - Prorate will be auto-calculated for the first billing in the subscription for the pro-rated period, with full recurring billing amount starting from the next billing cycle.

firstBillingAmount
object

The amount to pay for the subscription's first scheduled billing.

boolean
Defaults to true

Specify if auto payment processing occurs for invoices generated from the subscription. Supported value are: true - Default value. Invoices generated will automatically proceed to payment processing. false - Invoices are generated but will not automatically proceed to payment processing.

boolean

Specify if an email notification is sent to the customer informing them that the subscription was created or activated. Supported values are: true - An email notification will be sent to the customer to inform them that this subscription was created or activated no matter what was specified under the merchant notification settings. false - No email notification is sent to the customer to inform them that this subscription was created or activated no matter what was specified under the merchant notification settings. If not specified, follows what was defined in the merchant notification settings.

Headers
string
required

Merchant ID

Responses

Language
Response
Choose an example:
application/json