Add subscriber
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/
).
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Object ID (UUID)
Body
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.
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.
pending
, inactive
, active
, subscription_paused
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).
Sends invoice when subscription charge fails if this is true
Sends invoice when POST /billing_templates/{id}/add_subscriber/
is called if this is true
Sends receipt when subscription charge succeeds if this is true
Response
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
.
Nullable in POST /billing_templates/{id}/add_subscriber/
response.