PlatformXeDocs
Get API Key

Invoices

Monthly invoicing with VAT, lifecycle states, and dunning.

PlatformXe generates monthly invoices for paid plans. All amounts are in Nigerian Naira (NGN) with 7.5% VAT applied; the API returns them in kobo (see Viewing invoices).

Invoice lifecycle

StateDescription
DRAFTInvoice generated, not yet finalized
PENDINGFinalized and awaiting payment
PAIDPayment received and confirmed
OVERDUEPast due date, dunning active
CANCELLEDManually cancelled
DRAFT → PENDING → PAID
                → OVERDUE → PAID (after retry)
                          → CANCELLED

Viewing invoices

Invoices are accessible from the Tenant Portal billing page and through the API. The API returns your own organisation's invoices only, DRAFT ones included.

Scopebilling:read (GET only). It is not one of the scopes a self-registered or portal sign-up key starts with: a key holds it when its scope list names it or holds *, or when it has no scope list (an older key with no scopes)
KeyAn organisation key. A platform key with no organisation is refused (403 FORBIDDEN)
Rate limitThe default tier (1,000 requests/hr per API key)

Money is in kobo. subtotal, tax and total (and a line item's unitPrice and total) are integer strings in kobo, the minor unit of the naira: "10642500" is ₦106,425.00. tax is the 7.5% VAT. pdfUrl is always null today: invoice PDFs are not produced yet.

List invoices

GET /api/v1/billing/invoices

QueryDefaultDescription
page1Page number
limit20Invoices per page, 1 to 100
statusallOne of DRAFT, PENDING, PAID, OVERDUE, CANCELLED; anything else is 400 VALIDATION_ERROR

Invoices are listed newest first.

curl "https://api.platformxe.com/api/v1/billing/invoices?status=PAID&limit=10" \
  -H "x-api-key: pxk_live_your_api_key_here"
const { invoices, pagination } = await px.billing.listInvoices({ status: 'PAID', limit: 10 });
{
  "success": true,
  "data": {
    "invoices": [
      {
        "id": "inv_ck9q2w3e4r5t6y7u8i9o0p1a",
        "status": "PAID",
        "currency": "NGN",
        "periodStart": "2026-10-01T00:00:00.000Z",
        "periodEnd": "2026-10-31T23:59:59.999Z",
        "subtotal": "9900000",
        "tax": "742500",
        "total": "10642500",
        "paidAt": "2026-11-02T08:15:00.000Z",
        "paidVia": "FLUTTERWAVE",
        "pdfUrl": null,
        "createdAt": "2026-11-01T00:05:00.000Z",
        "updatedAt": "2026-11-02T08:15:00.000Z"
      }
    ],
    "pagination": { "page": 1, "limit": 10, "total": 1, "totalPages": 1 }
  }
}
FieldTypeDescription
idstringInvoice id
statusstringDRAFT, PENDING, PAID, OVERDUE or CANCELLED
currencystringNGN
periodStart / periodEndstringThe billed period (ISO 8601)
subtotal / tax / totalstringKobo; tax is the 7.5% VAT
paidAtstring | nullWhen it was paid
paidViastring | nullHow it was paid
pdfUrlstring | nullAlways null today
createdAt / updatedAtstringISO 8601

Get one invoice

GET /api/v1/billing/invoices/{id}

Returns the invoice and its line items. An unknown id and another organisation's invoice are both 404 NOT_FOUND, so the answer never tells you whether an id exists elsewhere.

curl https://api.platformxe.com/api/v1/billing/invoices/inv_ck9q2w3e4r5t6y7u8i9o0p1a \
  -H "x-api-key: pxk_live_your_api_key_here"
const { invoice, lineItems } = await px.billing.getInvoice('inv_ck9q2w3e4r5t6y7u8i9o0p1a');
{
  "success": true,
  "data": {
    "invoice": { "id": "inv_ck9q2w3e4r5t6y7u8i9o0p1a", "status": "PAID", "subtotal": "250000", "tax": "18750", "total": "268750", "...": "the other fields as in the list" },
    "lineItems": [
      { "id": "li_ck9a8s7d6f5g4h3j2k1l0z9x", "service": "storage", "description": "Storage above the included allowance", "quantity": 1, "unitPrice": "250000", "total": "250000" }
    ]
  }
}

Line items

Each invoice carries one line per billed item, such as metered usage above your plan's allowance or an add-on:

FieldTypeDescription
idstringLine item id
servicestringThe billed service (for example storage or addon)
descriptionstringWhat the line is for
quantitynumberUnits billed
unitPricestringKobo per unit
totalstringKobo for the line

Error responses

StatusCodeDescription
400VALIDATION_ERRORUnknown status (list)
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENThe key lacks billing:read; its organisation is inactive; or it is a platform key with no organisation
404NOT_FOUNDGet: unknown id, or another organisation's invoice
429RATE_LIMITEDOver the key's budget; wait for Retry-After
500INTERNAL_ERRORAnything else (a fixed message)

See also the SDK reference: Billing.

Dunning

When an invoice becomes overdue, PlatformXe automatically retries payment:

  1. Day 1: Invoice marked overdue, first retry attempted
  2. Day 3: Second retry
  3. Day 7: Third retry, warning notification sent
  4. Day 14: Final retry, service degradation warning

After 14 days of failed payment, API access may be restricted to read-only. Resolve outstanding invoices from the Tenant Portal billing page to restore full access.

Events

Subscribe to billing events for payment tracking:

  • billing.invoice.created — new invoice generated
  • billing.invoice.paid — payment confirmed
  • billing.invoice.overdue — payment past due