Create a Lightning invoice
Mints a BOLT11 invoice to top the wallet up by any amount. Paying it credits the wallet in USD, and the credit then pays for whatever is waiting on it, exactly as a stablecoin deposit does.
The invoice is denominated in USD by a USD-settling receiver: the payer sends
satoshis, and the wallet is credited amount whatever the rate does in between.
amount_sats is indicative only.
Unlike a funding destination, an invoice is for one amount and expires, so this
mints a new one each time and takes an Idempotency-Key. To pay for a single
purchase without topping up first, use payment_source: lightning on a quote
instead.
Authorization
ApiKey An account API key, sent as Authorization: Bearer tz_live_…. The prefix
selects the mode: tz_test_ for sandbox, tz_live_ for real money.
In: header
Header Parameters
A client-generated key, unique per intended operation, that makes this request
safe to retry. The same key returns the original response; the same key with a
different request is rejected. Missing: 400 idempotency_key_required.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/wallet/lightning_invoices" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "amount": 2000 }'{ "id": "string", "object": "lightning_invoice", "bolt11": "lnbc200u1p...", "payment_hash": "string", "amount": { "amount": 1450, "currency": "USD" }, "amount_sats": 0, "status": "pending", "quote_id": "string", "expires_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "paid_at": "2019-08-24T14:15:22Z"}