api

post/api/subscriptions/cancel/

Query parameters

customer_idstring required

Filter to a specific customer.

plan_idstring uuid

Filter to a specific plan. If not specified, all plans will be included in the cancellation request.

valuestring required
property_namestring required

The string name of the property to filter on. Example: 'product_id'

Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'.

Request body

flat_fee_behavior'refund' | 'prorate' | 'charge_full'

Can either charge the full amount of the flat fee, regardless of how long the customer has been on the plan, prorate the fflat fee, or charge nothing for the flat fee. If the flat fee has already been invoiced (e.g. in advance payment on last subscription), and the reuslting charge is less than the amount already invoiced, the difference will be refunded as a credit. Defaults to charge full amount.

usage_behavior'bill_full' | 'bill_none'

If bill_full, current usage will be billed on the invoice. If bill_none, current unbilled usage will be dropped from the invoice. Defaults to bill_full.

invoicing_behavior'add_to_next_invoice' | 'invoice_now'

Whether to invoice now or invoice at the end of the billing period. Defaults to invoice now.

Response

start_datestring date-time required

The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.

end_datestring date-time required

The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time.

auto_renewboolean required

Whether the subscription automatically renews. Defaults to true.

is_newboolean required

Whether this subscription came from a renewal or from a first-time. Defaults to true on creation.

fully_billedboolean required

Whether the subscription has been fully billed and finalized.

Changes