API Reference

Create subscription

Subscribes the customer you specify to your services with the pointed options

Error codes:

CustomerNotFoundThere is no customer with ID specified in the request
ProductFamilyNotFoundThere is no product family with ID specified in the request
PlanItemPriceNotFoundThere is no plan with any of ids specified in “items” array
ItemPricesNotFoundsome of ids in “items” array belong to product family item prices that cannot be found, or “discounts” array contains product family item prices that are not listed in “items” array
ItemPricesHasDifferentPricingModelpricing model of some of the product family item prices is different from the pricing model specified in the request
ItemPricesHasOtherCurrencycurrency of some of the product family item prices is different from the currency of the plan price specified in the request
Path Params
string
required
Defaults to your-site-name-1

Name of your project

Query Params
boolean
Defaults to false

Controls whether the API returns the complete response data, including created subscription and issued invoice (200 OK) , or a simplified version with only subscription id (201 Created). Default - false

Body Params
string

The id of the future subscription

string
required

The id of the customer to subscribe

date-time

The date when the subscription must start

string
required

The channel this subscription will be paid by. Can be “Web”, “AppStore” or “PlayStore”

string

Billing cycles override. If not provided value configured for plan item price will be used.

int32

Total number of subscription billing period. Applicable only for subscription with "Fixed" billing cycles. If not provided, value configured for plan item price will be used. Field is required when plan is configured as "Forever" but billingCycles was overriden to "Fixed"

string

Optional, on/off, default=off

string

A customer-facing note added to all invoices associated with this subscription. This note is one among all the notes displayed on the invoice PDF

boolean
required

Activate immediately or activate after payment

boolean
required

Whether subscription items prices include VAT already

metadata
object

Key-value pairs of some additional information about the subscription

int32

Length of trial period, in trialBillingPeriodUnits

string

Can be Day or Month

int32

How many days before billing period end should be left to generate invoice

daysNotifyAboutUnpaidInvoice
array of int32s

How many days before invoice due date should be left to send a reminder about the invoice to the customer. There can be a few reminders sent

daysNotifyAboutUnpaidInvoice
discounts
array of objects

Discounts for subscription items

discounts
items
array of objects

Array of item prices which are applied to the subscription

items
Responses

Language
Credentials
:
Choose an example:
application/json