Add a billing template client and activate recurring billing (is_subscription: true).

Use this request with a BillingTemplate having is_subscription == true. Two scenarios are possible:

• If subscription_charge_period_end == true and/or subscription_trial_periods > 0 (first billing should happen after 1 or more billing periods, not today), the request will create a BillingTemplateClient and start trial/schedule billing for it (as required by subscription settings). Successful response will be of form {billing_template_client: <BillingTemplateClient object created>, purchase: null}: no Purchase is created, BillingTemplateClient.status is active immediately.

• If subscription_charge_period_end == false and subscription_trial_periods == 0 (first billing should occur today), the request will create a BillingTemplateClient with status == pending and create a Purchase. When such a Purchase is paid, the respective BillingTemplateClient will have its' subscription activated (starting from the day of payment), with its status changing to active. Successful response will be of form {billing_template_client: <BillingTemplateClient object created>, purchase: <Purchase object created>}: you should redirect your client to purchase.checkout_url for him to pay immediately (as you do with POST /purchases/).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Object ID (UUID)

Body Params

Connects a Client object to a BillingTemplate having is_subscription = true to store information about a single subscriber.

You will be able to pause an individual subscription client's cycle by PATCH-ing its' status field to the value of subscription_paused.

uuid
required

ID of the Client object to add to the BillingTemplate. Read-only after the BillingTemplateClient has been created. Note that the same Client can be added to a BillingTemplate several times.

boolean
Defaults to true

Sends receipt when subscription charge succeeds if this is true

string

An ad-hoc first collection.

Usually used to account for a subscription in the middle of a billing cycle or a custom first subscription amount. Must be a date earlier than subscription_deduction_date.

subscription_first_deduction_amount is required if this is set.

Minimum date is Today + 4 days.

integer
≥ 1

The amount collected on subscription_first_deduction_date.

Amount is NOT affected by any modifiers of the billing_template (eg tax_percent). This is the amount that is collected.

subscription_first_deduction_date is required if this is set.

string
required

The start date of a billing cycle.

Minimum date is Today + 4 days.

string
required

The date on which this mandate should be expired by the bank.

boolean
Defaults to true

Sends invoice when subscription charge fails if this is true

string
enum
Defaults to inactive

For subscriptions, you can edit (PATCH /billing_templates/{id}/clients/{id}/) this status between active and subscription_paused values to pause the client's subscription. Paused subscriptions run as normal, except for purchases not being created and invoices sent for them. It means that if you pause a BillingTemplateClient's monthly subscription cycle a day before the billing date, the next day the invoice will not be issued; but, if you unpause the client a day after the planned billing would have taken place, the planned billing in a month (minus one day) will happen as usual.

Read-only if the BillingTemplateClient is in inactive (internal status not managed through public API) or pending (see documentation for POST /billing_templates/{id}/add_subscriber/) statuses.

Allowed:
payment_method_whitelist
array of strings
length ≥ 1

An optional whitelist of payment methods availble for purchases generated for this BillingTemplateClient. Copied 1:1 to Purchase.payment_method_whitelist field on created Purchases (see its description).

payment_method_whitelist

Payment method name as returned by GET /payment_methods/.

string
enum
Defaults to TWODAY

Service Type is the collection instrument used at the bank, which differs in days taken to execute

A purchase due needs to be valid equal to or longer than the timeframe of the token service type that will be used to collect it. e.g. a purchase due tomorrow (Today + 1) cannot be created/charged with a TWODAY serviceType/token

You create recurring_tokens with purchases and its service type is determined by the purchase that created it. A recurring token can only pay/charge a purchase that is of the same service type as itself. e.g. You can only charge a ONEDAY puchase with a ONEDAY recurring token.

When creating a purchase, force_recurring must be true to use the default_service_type.

Allowed:
Responses

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