Invoices
Generate invoices and read incoming transactions.
Create an invoice
Scope needed: invoices:create
Creates a new invoice to receive lightning payments.
POST
https://api.getalby.com/invoices
Creates a new invoice
Request Body
Name | Type | Description |
---|---|---|
description_hash | String | Pass a hash of the description instead of the description (for private or long descriptions) |
amount* | int64 | amount, must be a whole number in sats (millisats are not supported). |
description | String | Arbitrary text (included in the BOLT11 invoice) |
currency | String | currency of the invoice. Default is "btc" |
memo | String | same as "description" field. |
comment | String | Arbitrary text to save alongside the invoice (not included in the BOLT11 invoice) |
metadata | Object | Arbitrary data to save alongside the invoice (not included in the BOLT11 invoice) |
payer_name | String | Name of payer (not included in the BOLT11 invoice) |
payer_email | String | Email of payer (not included in the BOLT11 invoice) |
payer_pubkey | String | Nostr or node pubkey of payer to store with the invoice (not included in the BOLT11 invoice) |
Looking to create invoices for a lightning address without requiring scope? Try our Lightning Address details API which uses the LNURL protocol.
Get incoming invoice history
Scope needed: invoices:read
Lists all settled incoming invoices, including boostagram and LNURL metadata.
GET
https://api.getalby.com/invoices/incoming
Lists all incoming invoices
Query Parameters
Name | Type | Description |
---|---|---|
q[created_at_gt] | Int | Filter invoices created after this Unix Timestamp in UTC (e.g. 1681992321) |
q[created_at_lt] | Int | Filter invoices created before this Unix Timestamp in UTC (e.g. 1681992321) |
q[since] | String | Filter invoices created after the given invoice identifier |
page | Int | Page number (1 is the first page) |
items | Int | Items per page (Default 25) |
q[before] | String | Filter invoices created before the given invoice identifier |
Get outgoing invoice history
Scope needed: transactions:read
Lists all settled outgoing invoices, including boostagrams information.
GET
https://api.getalby.com/invoices/outgoing
Lists all outgoing invoices
Query Parameters
Name | Type | Description |
---|---|---|
q[since] | String | Filter invoices created after the given invoice identifier |
q[created_at_lt] | Int | Filter invoices created before this Unix Timestamp in UTC (e.g. 1681992321) |
q[created_at_gt] | Int | Filter invoices created after this Unix Timestamp in UTC (e.g. 1681992321) |
page | Int | Page number (1 is the first page) |
items | Int | Items per page (Default 25) |
q[before] | String | Filter invoices created before the given invoice identifier |
Get all invoice history
Scope needed: invoices:read
Combination of incoming and outgoing invoice histories. Possible query parameters are the same as above.
GET
https://api.getalby.com/invoices
Query Parameters
Name | Type | Description |
---|---|---|
q[since] | String | Filter invoices created after the given invoice identifier |
q[created_at_lt] | Int | Filter invoices created before this Unix Timestamp in UTC (e.g. 1681992321) |
q[created_at_gt] | Int | Filter invoices created after this Unix Timestamp in UTC (e.g. 1681992321) |
page | Int | Page number (1 is the first page) |
items | Int | Items per page (Default 25) |
q[before] | String | Filter invoices created before the given invoice identifier |
Get a specific invoice
Scope needed: invoices:read
Get details about specific invoice. Can be both incoming or outgoing.
Unsettled invoices can only be retrieved if they were created through the Alby API or Nostr Wallet Connect (using https://nwc.getalby.com/). Unsettled Invoices created directly using the Lndhub API will return a 404.
GET
https://api.getalby.com/invoices/{payment_hash}
Get details about specific invoice. Can be both incoming or outgoing
Path Parameters
Name | Type | Description |
---|---|---|
payment_hash* | String | The payment hash of the payment |
Decode an invoice
Decode an invoice. Will also add the alias of the receiving node & route hints (LSP's).
Decode an invoice
GET
https://api.getalby.com/decode/bolt11/{bolt11_invoice}
Will also add the alias of the receiving node & route hints (LSP's).
Path Parameters
Name | Type | Description |
---|---|---|
bolt11_invoice* | String | Needs to be a valid bolt11 |
Last updated