Lightning
The Lightning API allows you to generate and manage Bitcoin Lightning invoices. It supports creating payment requests, checking invoice statuses, and retrieving invoice details such as amount, description, and timestamps. Ideal for fast and low-fee Bitcoin transactions.
Create a lightning invoice
Use Case
Generate a Lightning invoice for a specific amount in satoshis. This is used to request payments via the Lightning Network in apps or services.
Lightning invoice Request Body
A unique identifier for the customer or transaction. Useful for tracking, reconciliation, or displaying in dashboards and invoices.
A human-readable message describing what the invoice is for. This could be a product, service, or purpose of payment.
The amount to be paid, expressed in satoshis or fiat-equivalent depending on the context. It defines how much the user is expected to pay.
The timestamp after which the invoice becomes invalid. This helps ensure time-bound payments and can be used for retry logic.
Lightning Invoice Response Body
UUID of the invoice. This is a unique identifier generated when the Lightning invoice is created and is used to track or retrieve invoice details.
The lightning request. This is the actual Lightning invoice string that can be copied and paid using a Lightning wallet.
The invoice satoshis. This is the total amount to be paid, represented in satoshis (the smallest unit of Bitcoin).
Description provided by the user. This text usually contains the reason for the payment or any identifying information useful to the recipient.
ISO timestamp when invoice was created. This indicates when the invoice was generated and can be used to determine its validity or expiration.
ISO timestamp when invoice was last updated. This reflects the latest update to the invoice record, such as a status change or metadata modification.
Get Lighting Invoices
Use Case
Get a paginated response of lightning invoices.
Query Parameters
Specifies the page of results to retrieve. Default: 1. Useful for paginating large datasets by selecting which page to start from.
Sets the number of results to return per page. Default: 20. Increase or decrease to control how many entries are fetched in one request.
Filter by email. Returns only records matching the specified email address. Ideal for narrowing search to a specific user.
Filter by blacklist. Set to true to return only blacklisted users, or false to exclude them from the results.
Filter by country code. Use 2-letter ISO codes like 'GH' or 'NG' to target users from specific countries.
Response Body
The response is identical to that of Lightning invoice Response Body. Refer to the Lightning invoice Response Body section for field explanations.
Get lightning invoice by ID
Use Case
Get a lightning transaction by id or lightning request.
Response Body
The response is identical to that of Lightning invoice Response Body. Refer to the Lightning invoice Response Body section for field explanations.
Decode lightning invoice
Use Case
Used to decode a lightning invoice.
Request Body
Payment request string; must be non-empty.
Response Body
A unique identifier automatically assigned to the invoice. It is used to look up, manage, and reference the invoice in APIs, dashboards, or databases.
A standard on-chain Bitcoin address that serves as a fallback option in case the Lightning payment fails or is unsupported by the sender's wallet. Useful for improving payment reliability.
The CLTV (Check Lock Time Verify) delta is a value that determines how long funds should remain locked during a Lightning payment. It influences the expiry of HTLCs and helps prevent payment failures due to timing issues.
A user-facing memo or description attached to the invoice. It provides context about the purpose of the payment, such as a product, service, or order reference.
The public key (node ID) of the Lightning node that is supposed to receive the payment. This is a cryptographic identifier unique to each Lightning node.
An array of advertised feature bits that indicate which optional or required protocol capabilities are supported by the invoice issuer (payee). These features guide payer compatibility.
The numeric bit index representing a specific protocol feature as defined in BOLT standards. Each bit corresponds to a capability such as 'payment secret' or 'TLV onion'.
Indicates whether the parsing Lightning node recognizes the meaning of this feature bit. Unknown features may be ignored or cause failure depending on the 'required' status.
Specifies if the feature is required in order for the invoice to be paid. If true, wallets that do not support this feature will be unable to complete the payment.
A readable name of the feature this bit represents, such as 'payment_secret', 'basic_mpp', or other protocol extensions.
A flag indicating whether the invoice has already passed its expiry time. Once expired, it can no longer be paid and is considered invalid.
The hash of the payment preimage, which serves as a unique reference to this payment attempt. It's used to verify payment completion and match it against invoice records.
Optional routing hints provided by the invoice issuer to assist in constructing a viable Lightning route. It may include fallback node hops to increase payment success.
The invoice amount in satoshis, the smallest unit of Bitcoin. This represents the actual value to be paid over Lightning.
The invoice amount converted to millisatoshis (sats * 1000). Used for more precise routing and payment processing in the Lightning protocol.
The date and time when the invoice was initially created. This timestamp helps in calculating expiry and sorting invoice history.
The date and time when the invoice will expire and become invalid. It’s typically a few minutes to hours after creation depending on configuration.
Initialize a lightning payment
Use Case
This is used to initialize a lightning payment. It takes a valid Lightning payment request string and processes the payment accordingly.
Request Body
Payment request string; must be non-empty. This is typically a BOLT11-encoded string generated by the Lightning Network and contains all the necessary information to process a payment, including the destination, amount, and expiry.
Request Body
A BOLT11-encoded Lightning invoice string that users can scan or copy to make a payment. This string includes details like the destination node, amount, expiration time, and description. It’s the primary data required for users to process payments through their Lightning-compatible wallet.
The duration (in seconds) or timestamp indicating when the invoice will expire. After this time, the invoice becomes invalid and can no longer be paid. This helps ensure payments are made within a specific time window, reducing risk of stale or delayed transactions.
The amount requested in satoshis (sats), the smallest denomination of Bitcoin. One Bitcoin equals 100,000,000 sats. This value determines how much the payer is expected to send when settling the invoice on the Lightning Network.
The same amount as 'satAmount', but converted to Bitcoin units. For example, 1000 sats would be 0.00001000 BTC. Useful for displaying amounts in a more user-friendly or globally recognized format.
Boolean value that indicates whether the invoice has expired. If true, the invoice can no longer be paid. This flag is computed based on the current time compared to the invoice’s expiry timestamp.
A text memo or note attached to the invoice that provides context to the payer. This can include a product name, order number, or purpose of the payment, enhancing the user’s trust and understanding of what they’re paying for.
The routing or network fee (in BTC) incurred when the invoice is paid. This fee is typically a small amount required to forward the payment across multiple Lightning nodes. Understanding this value is essential for tracking the actual cost of a transaction.
The routing or network fee expressed in millisatoshis. This is calculated by multiplying the BTC fee by 1000 (i.e., fee × 1000), offering greater precision especially in micropayment scenarios.
The total amount to be paid, expressed in BTC. While similar to btcAmount, this field may include adjustments or be derived from additional logic depending on how the invoice was created.
The total amount to be paid, expressed in millisatoshis. This is computed by multiplying the BTC amount by 1000 (i.e., amount × 1000), enabling precise tracking and reconciliation in Lightning payments.
Finalize lightning payment
Use Case
This is used to finalize an initiated lightning payment.
Request Body
Payment request string. A BOLT11-encoded Lightning invoice string that users can scan or copy to make a payment. This includes destination node, amount, expiry, and description.
Internal or external reference ID for the transaction. Useful for reconciliation or tracking.
Your customer’s identifier or reference. Helps associate the payment with a specific user or customer in your system.
Optional payment description to provide additional context to the payer (e.g., product name or order details).
Response Body
A unique identifier assigned to the transaction within the system. Typically used for internal tracking, referencing, and reconciliation.
Timestamp indicating when the transaction was first created. Useful for sorting, auditing, or applying time-based logic.
Timestamp showing the most recent update to the transaction. Reflects any status changes, edits, or reconciliations.
An external or internal reference string associated with the transaction. Often used to link the transaction to another system or request.
The blockchain or Lightning Network transaction hash. Serves as a globally unique identifier for the transaction on the relevant network.
An optional free-text field that can include notes, memos, or additional context about the transaction’s purpose or content.
Currency code of the transaction, following ISO 4217 or internal conventions. Examples include 'USD', 'BTC', or 'NGNC'.
The main-unit amount (e.g., 1.23 USD). This is the gross value of the transaction, excluding fees.
The main-unit fees deducted for processing the transaction (e.g., 0.25 USD). Helps in calculating the net amount.
The transaction amount represented in minor units (e.g., cents or satoshis). Used for precise arithmetic operations.
Fees represented in minor units (e.g., cents). This ensures consistency and avoids floating-point errors in calculations.
The destination address or identifier for the transaction. For blockchain, this is the recipient wallet address; for internal rails, this might be a user or account ID.
Describes the high-level intent of the transaction, such as 'send', 'receive', 'withdraw', or 'fund'.
A domain-specific classification of the transaction. Examples: 'payout', 'airtime', 'onramp', 'offramp'. Used for filtering and business logic.
The current lifecycle status of the transaction. Common values include 'pending', 'success', 'failed', 'reversed'.
The origin or interface through which the transaction was initiated. Examples include 'api', 'dashboard', 'webhook'.
Identifies the blockchain network associated with the transaction (e.g., 'Bitcoin', 'Ethereum'). Useful for crypto transactions.
The ID of the company that owns or initiated the transaction. Used for multi-tenant or white-labeled platforms.