--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "payLightningInvoice",
"network": "MAINNET",
"params": {
"invoice": "lnbc1230n1p...",
"max_fee_sats": 5,
"prefer_spark": true,
"amount_sats_to_send": 5000
}
}'
{
"method": "payLightningInvoice",
"data": {
"id": "2fb0b49e-0aef-4726-a348-2dd0a9432c12",
"created_at": "2025-07-24T16:43:12.509Z",
"updated_at": "2025-07-24T16:43:12.509Z",
"network": "MAINNET",
"encoded_invoice": "lnbc1230n1p...",
"fee": {
"original_value": 3,
"original_unit": "SATOSHI"
},
"status": "SUCCESS",
"typename": "LightningSendRequest"
}
}
Spark BTC
payLightningInvoice
Pay a Lightning Network invoice from a Spark wallet.
POST
/
v1
/
wallets
/
{wallet_id}
/
rpc
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "payLightningInvoice",
"network": "MAINNET",
"params": {
"invoice": "lnbc1230n1p...",
"max_fee_sats": 5,
"prefer_spark": true,
"amount_sats_to_send": 5000
}
}'
{
"method": "payLightningInvoice",
"data": {
"id": "2fb0b49e-0aef-4726-a348-2dd0a9432c12",
"created_at": "2025-07-24T16:43:12.509Z",
"updated_at": "2025-07-24T16:43:12.509Z",
"network": "MAINNET",
"encoded_invoice": "lnbc1230n1p...",
"fee": {
"original_value": 3,
"original_unit": "SATOSHI"
},
"status": "SUCCESS",
"typename": "LightningSendRequest"
}
}
Idempotency on errors: On 4xx or 5xx, Privy caches the response and replays it for the same
key. Generate a new key to retry after a server error. Policy violations are an exception and
allow same-key retries.
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "payLightningInvoice",
"network": "MAINNET",
"params": {
"invoice": "lnbc1230n1p...",
"max_fee_sats": 5,
"prefer_spark": true,
"amount_sats_to_send": 5000
}
}'
{
"method": "payLightningInvoice",
"data": {
"id": "2fb0b49e-0aef-4726-a348-2dd0a9432c12",
"created_at": "2025-07-24T16:43:12.509Z",
"updated_at": "2025-07-24T16:43:12.509Z",
"network": "MAINNET",
"encoded_invoice": "lnbc1230n1p...",
"fee": {
"original_value": 3,
"original_unit": "SATOSHI"
},
"status": "SUCCESS",
"typename": "LightningSendRequest"
}
}
Headers
Request authorization signature. If multiple signatures are required, they should be comma
separated.
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the
request must be processed.
Path Parameters
These wallet methods are modeled after the Spark Wallet
SDK. For more
information about this wallet method, check out the Spark Wallet
documentation.
Body
Hide child attributes
Hide child attributes
Returns
If
If
prefer_spark is false, a LightningSendRequest object with the following fields:Hide child attributes
Hide child attributes
prefer_spark is true, the response will be a Transfer object with the following fields:Hide child attributes
Hide child attributes
Each item contains transfer metadata and encrypted leaf information.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Was this page helpful?

