Skip to main content

Send BTC over Lightning

The GraphQL endpoint to connect to:
A valid authentication token is required in the header as a bearer token:

Get the wallet IDs and check the balances

Can run this query at any stage to confirm the change in the balances.
The "BTC" wallet balance is denominated in satoshis.
The "USD" wallet balance is in cents.

The body of the GraphQL request

query Me {
me {
defaultAccount {
wallets {
id
walletCurrency
balance
}
}
}
}
curl command to get the BTC wallet ID

Estimate the payment fee (probe)

Estimate the cost of paying a lightning invoice.
Payments to an other Blink user and to nodes with a direct channel are free.

The body of the GraphQL request

mutation lnInvoiceFeeProbe($input: LnInvoiceFeeProbeInput!) {
lnInvoiceFeeProbe(input: $input) {
errors {
message
}
amount
}
}
Set the variables

curl command to probe invoice fee


Pay a lightning invoice

Pay a BOLT11 invoice from your BTC balance.

The body of the GraphQL request

mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) {
lnInvoicePaymentSend(input: $input) {
status
errors {
message
path
code
}
}
}
Set the variables
curl command to pay an invoice

Send to a Lightning Address

Send to a Lightning Address from your BTC balance.

The body of the GraphQL request

mutation LnAddressPaymentSend($input: LnAddressPaymentSendInput!) {
lnAddressPaymentSend(input: $input) {
status
errors {
code
message
path
}
}
}
Set the variables
curl command to send to an LN address

Send to an LNURL

Send to a static LNURL payRequest from your BTC balance.

The body of the GraphQL request

mutation LnurlPaymentSend($input: LnurlPaymentSendInput!) {
lnurlPaymentSend(input: $input) {
status
errors {
code
message
path
}
}
}
Set the variables
curl command to send to an LNURL
tip

To test the GraphQL requests further use the GraphQL playground at api.blink.sv/graphql for mainnet or api.staging.blink.sv/graphql for staging.
Check out the Galoy API Postman collection to find examples in multiple programming languages.