Billing
Invoicing
To send one-off invoices, use POST /billing/
request. It’s similar to POST /purchases/
except that customers are an array, allowing you to bulk-issue invoices to several customers at once.
To send invoices using a template, use a separate POST /billing_templates/
request (without clients
!). Then, for each of your clients, use POST /billing_templates/{billing_template_id}/send_invoice/
.
If the customer agrees to store his card for future purchases, then the next time the option to pay with a single click will appear if the payment channel supports tokenization.
Subscriptions
Subscriptions allow you to automate recurring purchases. You can create a subscription using the same request POST /billing_templates/
as for invoices. To create a subscription billing template, specify is_subscription: true
and subscription_*
fields in POST /billing_templates/
request body. Then, add subscribers using the POST /billing_templates/<billing_template_id>/add_subscriber/
request.
If the payment channel supports tokenization and the customer agreed to store his datafor future purchases, payments will be processed automatically, while the customer will get a receipt for each purchase. Note that whenever a subscription payment fails, your customer will automatically receive an invoice he can pay (and store a new card for upcoming payments in the process). Your system will also receive the purchase.subscription_charge_failure
webhook event, if configured.
By default, the system generates invoices and processes subscription payments at the beginning of the billing cycle.
If you want to send an invoice or charge a customer at the end of the billing cycle, just set subscription_charge_period_end
to true
in POST /billing_templates/
request.
The API also provides you with an option to give a trial to your customers before enabling paid subscription period. To do that just set subscription_trial_periods
in POST /billing_templates/
request.