Subscriptions

Retrieve a subscription's upcoming invoice

GET/api/v1/subscriptions/{id}/upcoming-invoice

Returns the next renewal invoice of the subscription as it would be issued now: its lines, the period it buys, the total, the customer's credit it would use and the amount due. It is a preview: nothing is stored, no credit is reserved and no event is sent, so the amounts can change until the invoice opens. A trialing subscription shows the first invoice after the trial. When a renewal invoice is already open, for example while the subscription is past_due, it shows the invoice after that one: retrieve the open one with listInvoices. A change queued for the renewal is on it. For send_invoice, dueAt is set. Metered usage is not on it: usage is invoiced when its usage period closes. A subscription with a cancel scheduled, and one that is incomplete, canceled or expired, has no upcoming invoice.

Authorization

bearerAuth
AuthorizationBearer <token>

An access token from POST /api/v1/oauth/token, sent as Authorization: Bearer <token>.

In: header

Path Parameters

id*string

The subscription's ID.

Formatuuid

Header Parameters

FlexMalipo-Version?"2026-11-06"

The API version to use for this request, a date such as 2026-11-06. Without it the request uses your default version for the mode of your key. An unknown version answers 400 api_version_invalid.

Value in

  • "2026-11-06"

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://api-malipo.flex.co.tz/api/v1/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08/upcoming-invoice" \  -H "Authorization: Bearer <token>" \  -H "FlexMalipo-Version: 2026-11-06"
{  "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",  "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",  "livemode": true,  "kind": "RENEWAL",  "collectionMethod": "checkout",  "currency": "TZS",  "periodStart": "2019-08-24T14:15:22Z",  "periodEnd": "2019-08-24T14:15:22Z",  "dueAt": "2019-08-24T14:15:22Z",  "lines": [    {      "kind": "period",      "price": "296c3962-8fad-4bbf-a476-e2a5d4fe62a6",      "quantity": 3,      "unitAmount": 10000,      "amount": 30000,      "periodStart": "2019-08-24T14:15:22Z",      "periodEnd": "2019-08-24T14:15:22Z",      "description": "Prorated difference of an upgrade",      "meter": "08cfef1f-f291-40f5-b1b8-05ac0989f419",      "usageQuantity": 1250    }  ],  "total": 30000,  "creditApplied": 4000,  "amountDue": 26000}