Lightning
The Lightning API allows you to create invoices, send payments, decode payment requests, and verify settlements over the Bitcoin Lightning Network. All amounts are in satoshis (1 BTC = 100,000,000 satoshis). Ideal for fast, low-fee Bitcoin transactions that settle in seconds.
Key Terms
The smallest unit of Bitcoin. 1 BTC = 100,000,000 satoshis. All Lightning amounts in this API are denominated in satoshis.
The standard encoding format for Lightning invoices. A BOLT11 string contains the destination, amount, description, and expiry — everything a wallet needs to make a payment.
A 64-character hex string that uniquely identifies a Lightning payment. It is derived from the payment preimage and is used to verify that a payment was completed.
A 64-character hex secret that proves a payment was successfully received. When a payment settles, the receiver reveals the preimage to the sender as proof of payment.
A payment request generated by the receiver. It encodes the amount, description, expiry, and destination so the sender knows exactly what to pay.
Whether the invoice is 'incoming' (you created it to receive payment) or 'outgoing' (you paid someone else's invoice).
A unique string you provide to ensure the same request is not processed twice. If you retry a request with the same reference, the API returns the original result instead of creating a duplicate.
Create Invoice
Use Case
Generate a Lightning invoice to receive a payment. The invoice encodes the amount, description, and expiry into a BOLT11 string that any Lightning wallet can pay.
Request Body
An identifier for the customer this invoice belongs to. Useful for associating payments with specific users in your system.
The invoice amount in satoshis. Must be between 1 and 20,000,000 sats (0.2 BTC). This is the exact amount the payer will be asked to send.
A human-readable description of what the payment is for (e.g., 'Payment for order #123'). This is displayed in the payer's wallet.
How long the invoice remains valid, in seconds. Default: 86400 (24 hours). After expiry, the invoice can no longer be paid.
A unique idempotency key for this request. If you send the same reference twice, the API returns the original invoice instead of creating a duplicate.
Response Body (201)
A unique UUID assigned to this invoice. Use this to retrieve or reference the invoice later.
A 64-character hex string that uniquely identifies this payment on the Lightning Network. Used to verify payment completion.
The BOLT11 invoice string. Share this with the payer — they paste it into their Lightning wallet to pay.
The invoice amount in satoshis, confirming what was requested.
The description attached to the invoice.
Current state of the invoice: 'pending' (awaiting payment), 'paid' (settled), or 'expired' (no longer valid).
ISO 8601 timestamp when the invoice will expire and become unpayable.
ISO 8601 timestamp when the invoice was created.
Decode Payment Request
Use Case
Decode a BOLT11 invoice string to inspect its contents before paying. This reveals the amount, destination, description, and whether the invoice has expired — without sending any funds.
Request Body
A BOLT11-encoded Lightning invoice string. This is the payment request you want to inspect.
Response Body (200)
The unique hash identifying this payment. Used to track and verify the payment across the Lightning Network.
The public key of the Lightning node that will receive the payment. This is a 66-character hex string unique to each node.
The invoice amount in satoshis.
The invoice amount in millisatoshis (1 sat = 1000 msat). Used for more precise routing calculations.
The human-readable memo attached to the invoice by the creator.
Unix timestamp (seconds) when the invoice expires.
Whether the invoice has already expired. If true, the invoice can no longer be paid.
Initiate Payment
Use Case
Initiate a Lightning payment by submitting a BOLT11 invoice. This previews the payment details including the destination, amount, routing fee, and whether a valid route exists — before the payment is finalized.
Request Body
The BOLT11 invoice string to pay. Must be a valid Lightning invoice.
Response Body (200)
The hash that identifies this payment on the Lightning Network.
The public key of the destination node that will receive the payment.
The amount to be sent in satoshis.
The estimated routing fee in satoshis.
The total cost of the payment (amount + fee) in satoshis.
The description embedded in the Lightning invoice.
Unix timestamp when the invoice expires.
Whether the invoice has already expired.
Whether a valid route to the destination was found. If false, the payment cannot be completed.
Send Payment
Use Case
Execute a Lightning payment. This sends satoshis to the destination encoded in the BOLT11 invoice. The payment is final once settled — there are no chargebacks on Lightning.
Request Body
An identifier for the customer initiating this payment. Helps you track which user triggered the transaction.
The BOLT11 invoice string to pay. Must be a valid, unexpired Lightning invoice.
A unique idempotency key. Prevents duplicate payments if the same request is retried.
Maximum routing fee you're willing to pay, in satoshis. Set to 0 for no limit. If the routing fee exceeds this, the payment will not be sent.
Response Body (201)
A unique UUID for this payment record.
The hash that identifies this payment on the Lightning Network.
The payment preimage (proof of payment). This 64-character hex string proves the recipient received the funds. Store this for dispute resolution.
The amount sent in satoshis.
The actual routing fee charged, in satoshis.
Payment status: 'paid' (successfully settled), 'pending' (in-flight), or 'failed' (could not route or settle).
ISO 8601 timestamp when the payment was created.
The idempotency key you provided in the request.
An internal transaction ID linking this payment to your ledger.
Get Invoice
Use Case
Retrieve a single Lightning invoice by its ID. Use this to check the current status of an invoice (pending, paid, or expired) and access its full details.
Response Body (200)
The unique UUID of the invoice.
The hash uniquely identifying this payment on the Lightning Network.
The BOLT11 invoice string.
The payment preimage. Empty string if not yet paid; populated with proof of payment once settled.
Invoice amount in satoshis.
Invoice amount in millisatoshis.
Routing fee in satoshis (0 for incoming invoices you created).
Routing fee in millisatoshis.
The description attached to the invoice.
Current state: 'pending', 'paid', 'expired', or 'failed'.
'incoming' if you created this invoice to receive a payment, 'outgoing' if you paid someone else's invoice.
The ID of the company that owns this invoice.
The customer identifier associated with the invoice, if provided during creation.
The idempotency key provided when the invoice was created.
Unix timestamp when the invoice expires.
ISO 8601 timestamp when the invoice was created.
ISO 8601 timestamp of the last update (e.g., when status changed to paid).
List Invoices
Use Case
Retrieve a paginated list of Lightning invoices. Filter by status or direction to find specific invoices.
Query Parameters
Page number to retrieve. Default: 1.
Number of results per page. Default: 20, maximum: 100.
Filter by invoice status. Accepted values: 'pending', 'paid', 'expired', 'failed'.
Filter by direction. 'incoming' for invoices you created to receive payment, 'outgoing' for invoices you paid.
Response Body (200)
Each invoice object in the invoices array has the same fields as the Get Invoice response. The response also includes pagination metadata.
An array of invoice objects. Each object contains all fields described in the Get Invoice section.
The total number of invoices matching your filters.
The current page number.
The number of results per page.
Verify Invoice Payment
Use Case
Confirm whether a specific Lightning invoice has been paid and settled. Use this to verify payment status server-side, especially when webhooks may have been missed or delayed.
Request Body
The 64-character hex payment hash of the invoice you want to verify. This was returned when the invoice was created.
Response Body (200)
The UUID of the invoice.
The payment hash you queried.
The payment preimage — cryptographic proof that the payment was received. Empty if not yet paid.
The invoice amount in satoshis.
Current status: 'paid' if settled, 'pending' if still waiting, 'expired' if the invoice timed out.
A convenience boolean: true if the invoice has been paid and settled.
Whether the payment amount has been credited to your wallet balance. Should be true once settlement is complete.
ISO 8601 timestamp when the payment was settled. Null if not yet paid.