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.

Lightning API Endpoints

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.

Transaction Endpoints

Lightning invoice Request Body
1
customerReferencestringRequired

A unique identifier for the customer or transaction. Useful for tracking, reconciliation, or displaying in dashboards and invoices.

2
descriptionstringRequired

A human-readable message describing what the invoice is for. This could be a product, service, or purpose of payment.

3
amountnumberRequired

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.

4
expiresAtDateRequired

The timestamp after which the invoice becomes invalid. This helps ensure time-bound payments and can be used for retry logic.

Create Lightning Invoice - Example Request

Lightning Invoice Response Body
1
idstringRequired

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.

2
requeststringRequired

The lightning request. This is the actual Lightning invoice string that can be copied and paid using a Lightning wallet.

3
amountnumberRequired

The invoice satoshis. This is the total amount to be paid, represented in satoshis (the smallest unit of Bitcoin).

4
descriptionstringRequired

Description provided by the user. This text usually contains the reason for the payment or any identifying information useful to the recipient.

5
createdAtDateRequired

ISO timestamp when invoice was created. This indicates when the invoice was generated and can be used to determine its validity or expiration.

6
updatedAtDateRequired

ISO timestamp when invoice was last updated. This reflects the latest update to the invoice record, such as a status change or metadata modification.

Lightning Response - Fields

Get Lighting Invoices

Use Case

Get a paginated response of lightning invoices.

lightning

Query Parameters
1
pagenumberOptional

Specifies the page of results to retrieve. Default: 1. Useful for paginating large datasets by selecting which page to start from.

2
limitnumberOptional

Sets the number of results to return per page. Default: 20. Increase or decrease to control how many entries are fetched in one request.

3
emailstringOptional

Filter by email. Returns only records matching the specified email address. Ideal for narrowing search to a specific user.

4
blacklistbooleanOptional

Filter by blacklist. Set to true to return only blacklisted users, or false to exclude them from the results.

5
countryCodestringOptional

Filter by country code. Use 2-letter ISO codes like 'GH' or 'NG' to target users from specific countries.

Query Parameters - Example Request

Response Body
Note

The response is identical to that of Lightning invoice Response Body. Refer to the Lightning invoice Response Body section for field explanations.

Lightning Response - Fields

Get lightning invoice by ID

Use Case

Get a lightning transaction by id or lightning request.

Get lightning invoice by ID

Response Body
Note

The response is identical to that of Lightning invoice Response Body. Refer to the Lightning invoice Response Body section for field explanations.

Lightning Response - Fields

Decode lightning invoice

Use Case

Used to decode a lightning invoice.

Decode lightning invoice

Request Body
1
requeststringRequired

Payment request string; must be non-empty.

Lightning Invoice Request - Fields

Response Body
1
idstring

A unique identifier automatically assigned to the invoice. It is used to look up, manage, and reference the invoice in APIs, dashboards, or databases.

2
chainAddressstring

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.

3
cltvDeltanumber

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.

4
descriptionstring

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.

5
destinationstring

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.

6
featuresArray<Feature>

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.

7
bitnumber

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'.

8
isKnownboolean

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.

9
isRequiredboolean

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.

10
typestring

A readable name of the feature this bit represents, such as 'payment_secret', 'basic_mpp', or other protocol extensions.

11
isExpiredboolean

A flag indicating whether the invoice has already passed its expiry time. Once expired, it can no longer be paid and is considered invalid.

12
paymentstring

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.

13
routesany (array/object, as provided)

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.

14
amountnumber

The invoice amount in satoshis, the smallest unit of Bitcoin. This represents the actual value to be paid over Lightning.

15
amountInMinorUnitsnumber

The invoice amount converted to millisatoshis (sats * 1000). Used for more precise routing and payment processing in the Lightning protocol.

16
createdAtstring | Date

The date and time when the invoice was initially created. This timestamp helps in calculating expiry and sorting invoice history.

17
expiresAtstring | Date

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.

Decode lightning Invoice Response- Full Response

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.

Initialize a lightning payment

Request Body
1
requeststringRequired

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.

Initialize a lightning payment - Fields

Request Body
1
requeststring

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.

2
expirynumber | string

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.

3
satAmountnumber

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.

4
btcAmountnumber

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.

5
isExpiredboolean

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.

6
descriptionstring

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.

7
feenumber

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.

8
feeInMinorUnitsnumber

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.

9
amountnumber

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.

10
amountInMinorUnitsnumber

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.

Lightning Payment - Fields & Example

Finalize lightning payment

Use Case

This is used to finalize an initiated lightning payment.

Initialize a lightning payment

Request Body
1
requeststringRequired

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.

2
referencestringRequired

Internal or external reference ID for the transaction. Useful for reconciliation or tracking.

3
customerReferencestringRequired

Your customer’s identifier or reference. Helps associate the payment with a specific user or customer in your system.

4
descriptionstringNot Required

Optional payment description to provide additional context to the payer (e.g., product name or order details).

Initialize a lightning payment - Fields

Response Body
1
idstringRequired

A unique identifier assigned to the transaction within the system. Typically used for internal tracking, referencing, and reconciliation.

2
createdAtDateRequired

Timestamp indicating when the transaction was first created. Useful for sorting, auditing, or applying time-based logic.

3
updatedAtDateRequired

Timestamp showing the most recent update to the transaction. Reflects any status changes, edits, or reconciliations.

4
referencestringRequired

An external or internal reference string associated with the transaction. Often used to link the transaction to another system or request.

5
hashstringRequired

The blockchain or Lightning Network transaction hash. Serves as a globally unique identifier for the transaction on the relevant network.

6
descriptionstringNot Required

An optional free-text field that can include notes, memos, or additional context about the transaction’s purpose or content.

7
currencystringRequired

Currency code of the transaction, following ISO 4217 or internal conventions. Examples include 'USD', 'BTC', or 'NGNC'.

8
amountnumberRequired

The main-unit amount (e.g., 1.23 USD). This is the gross value of the transaction, excluding fees.

9
feesnumberRequired

The main-unit fees deducted for processing the transaction (e.g., 0.25 USD). Helps in calculating the net amount.

10
amountInMinorUnitnumberRequired

The transaction amount represented in minor units (e.g., cents or satoshis). Used for precise arithmetic operations.

11
feesInMinorUnitnumberRequired

Fees represented in minor units (e.g., cents). This ensures consistency and avoids floating-point errors in calculations.

12
addressstringNot Required

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.

13
actionstringRequired

Describes the high-level intent of the transaction, such as 'send', 'receive', 'withdraw', or 'fund'.

14
typestringRequired

A domain-specific classification of the transaction. Examples: 'payout', 'airtime', 'onramp', 'offramp'. Used for filtering and business logic.

15
statusstringRequired

The current lifecycle status of the transaction. Common values include 'pending', 'success', 'failed', 'reversed'.

16
channelstringRequired

The origin or interface through which the transaction was initiated. Examples include 'api', 'dashboard', 'webhook'.

17
chainstringNot Required

Identifies the blockchain network associated with the transaction (e.g., 'Bitcoin', 'Ethereum'). Useful for crypto transactions.

18
companyIdstringRequired

The ID of the company that owns or initiated the transaction. Used for multi-tenant or white-labeled platforms.

Response Body - Fields
Did you find this page useful?