What an order creates
The record that each order line creates for a subscription, a license, an addon, a topup, or an external product, with its billing, its lifecycle, and its webhooks
An order is a list of line items. When the order completes, each line item creates a record. The type of the product offering decides which record. This page shows each record, how the customer pays for it, how it ends, and which webhooks tell you about it.
The records
| Product type and category | Record that the line creates | Billing | Lifecycle | Webhooks |
|---|---|---|---|---|
SUBSCRIPTION | A subscription | A recurring price. The customer pays each billing cycle. | It starts, becomes active, and can pause, suspend, or restore. Then it ends. | subscription.created, subscription.activated, subscription.paused, subscription.suspended, subscription.restored, subscription.cancelled, subscription.ended |
LICENSE | A license | A recurring price. The customer pays each billing cycle. | It is pending, active, paused, canceled, or blocked. | license.created, license.activated, license.updated, license.renewed, license.cancelled, license.ended |
SUBSCRIPTION_ADDON with the category EXTRA_DATA, ABROAD_EXTRA_DATA or TRAVEL_ESIM_PACKAGE | An addon on a subscription, and an allotment that records the purchase | A one-time price. The customer pays once, when the order completes. | An allotment is pending, active, or ended. The end has a reason. | allotment.created, allotment.activated, allotment.ended |
SUBSCRIPTION_ADDON with another category, for example ABROAD, NETWORK_EXTENSIONS or VANITY_NUMBER | A license that is assigned to the subscription | A recurring price. The customer pays each billing cycle. | The lifecycle of a license. | The webhooks of a license |
EXTERNAL_PRODUCT | A license of the customer | The price of the offering, on the license. | The lifecycle of a license. | The webhooks of a license |
The product.type and product.category fields of an offering give the type and the category.
See
Offering types and categories.
Allotments
An allotment is an amount that a customer buys once. A data topup and a travel eSIM package are allotments. The allotment has the same identifier as the addon that it records.
An allotment has one status at a time:
PENDING: The customer bought the allotment. It is not active yet.ACTIVE: The customer can use the allotment.ENDED: The customer cannot use the allotment. TheendReasonfield gives the cause.
The endReason field has four values: CONSUMED, EXPIRED, CANCELED, and FAILED. A FAILED
allotment never became active.
The settlement field tells how the customer pays: INVOICED, PAID, FREE, or
MANUAL_CHARGE. The paidBy field names the payment intent or the order that holds the payment.
The price field gives the amount in minor units.
Read allotments
Use GET /allotments to list the allotments. Newest first is the order of the list. You can
filter the list with these parameters:
customerIdsubscriptionIdstatusproductOfferingId
Use GET /allotments/{allotmentId} to read one allotment. A caller reads only the allotments of
the customers that the caller can read. The End-User API gives a subscriber only the allotments
of the subscriptions of that subscriber.
Receive allotment webhooks
The platform sends three webhooks for an allotment:
| Webhook | When it is sent |
|---|---|
allotment.created | A customer buys an allotment. |
allotment.activated | The allotment becomes ACTIVE. |
allotment.ended | The allotment becomes ENDED. Read endReason. |
The data field of each webhook holds the allotment in the same shape as GET /allotments. See
Webhooks for the envelope and the signature.