---
title: "Generate a checkout URL"
method: POST
path: "/api/invoices/{id}/checkout"
tags: ["Invoices"]
---

# Generate a checkout URL

`POST /api/invoices/{id}/checkout`

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.

## Path parameters

- `id` string, required

## Request body

- object
  - `callbackUrl` string — URL to redirect customer after payment

## Response `200`

Checkout session created

- CheckoutResponse
  - `checkoutUrl` string, required
  - `paymentId` string, required
  - `provider` string, required
  - `expiresAt` string, required

## Other responses

- `400` — Invoice already paid, voided, or no provider configured
- `404` — Invoice not found

---

[API](https://skmtc.net/novabilling/apis/novabilling-api.md) · [All operations](https://skmtc.net/novabilling/apis/novabilling-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/novabilling/novabilling-api/revisions/0e449a4e0dc8/schema)
