ZapAPI Docs
Get StartedConceptsAI GatewayGuidesPayment GatewaySDKAPI ReferenceResources
ApiInvoices

Create a new Lightning invoice

POST
/api/v1/invoices

Creates a BOLT11 invoice settling to the project's settlement wallet (linked on the dashboard — default wallet when none is linked). projectId is optional for project-scoped API keys. Authenticate with a zap_live_/zap_test_ API key (invoices:write scope) or a dashboard JWT. Test keys create testMode invoices (webhook livemode: false). Supports fiat denominations via the currency field.

Authorization

bearer

Header Parameters

X-API-Version?string

API version for header-based versioning

Default"1"
Value in"1""2"

Request Body

application/json
  1. body
amount*number

Amount — in satoshis when currency is "sat" (default), or in the fiat currency when currency is e.g. "USD"

Range1 <= value
currency?string

Denomination: "sat" (default) or a fiat currency code (USD, EUR, GBP, INR, BRL, JPY, CAD, AUD). Fiat amounts are converted to sats at the current rate, snapshotted at creation.

description*string

Invoice description

projectId?string

Project ID. Optional when the API key is project-scoped (project keys fill this in automatically). The invoice settles to the project's configured settlement wallet.

providerId?stringDeprecated

DEPRECATED — settlement is resolved from the project's settlement wallet (dashboard → project → Settlement Wallet). Kept for backward compatibility with legacy LNbits-provider integrations; ignored for new integrations.

expirySeconds?number

Expiry time in seconds (default: 3600 = 1 hour)

Range60 <= value <= 86400
metadata?

Additional metadata (JSON)

couponCode?string

Coupon code — the project discount is applied and snapshotted on the invoice (amountDueSats = amount - discountSats). The payer pays amountDueSats.

successUrl?string

Merchant success URL — hosted checkout redirects here on payment (paymentHash + preimage appended). Stripe-style success redirect.

cancelUrl?string

Merchant cancel/back URL shown on the hosted checkout

Response Body

Invoice created successfully

Example Request
curl -X POST 'http://localhost:3001/api/v1/invoices' \  -H 'Content-Type: application/json' \  -d '{  "amount": 5000,  "description": "Order #1234"}'
Example Response
Empty