Skip to main content

PayInvoiceByMpesa initiates an STK push for the invoice's amount due.

GET 

/api/v1/billing/invoices/preview/:period

Authorization​

Requires billing:read permission.

Errors​

  • NOT_FOUND: Invoice does not exist or belongs to another organization
  • FAILED_PRECONDITION: Invoice is not open or has nothing due PreviewInvoice projects what an organization would be billed for a calendar month, computing the invoice exactly as the generator would and writing nothing.

The projection runs through the same costing path as a real run, so what this returns is what would actually be billed. A second implementation for preview would drift from the first, and a preview that disagrees with the invoice is worse than no preview.

Authorization​

Context token only, reason admin_portal. The ORGANIZATION IS TAKEN FROM THE TOKEN, never from the request — see PreviewInvoiceRequest.

Request​

Responses​

A successful response.