Invoices

Generate a checkout URL

Initiate a payment session with the configured payment provider (Stripe, Paystack, Flutterwave, or M-Pesa). Returns a checkout URL that redirects the customer to the provider's hosted payment page.

post/api/invoices/{id}/checkout

Path parameters

idstring required

Invoice ID

Request body

callbackUrlstring

URL to redirect customer after payment

Example request

{
  "callbackUrl": "https://myapp.com/payment/complete"
}

Response

Checkout session created

checkoutUrlstring required
paymentIdstring required
providerstring required
expiresAtstring required

Example response

{
  "checkoutUrl": "https://paystack.com/pay/abc123",
  "paymentId": "clxpay123",
  "provider": "paystack"
}

Changes

Changed in 1 of the 2 revisions of this API.4

    • the response property checkoutUrl became required for the status 200

      response-property-became-required

    • the response property expiresAt became required for the status 200

      response-property-became-required

    • the response property paymentId became required for the status 200

      response-property-became-required

    • the response property provider became required for the status 200

      response-property-became-required