Skip to content
Michael Bumann edited this page Aug 27, 2021 · 3 revisions

Create Invoice

POST /v1/invoices

Request Parameters:

  • value: (number) the value of the invoice in the smallest full denomination of currency (currently only Satoshi is supported)
  • memo: (string) the optional memo text that is attached to the invoice
  • currency: (string) currently only BTC is supported. If no currency is provided BTC is assumed

Example JSON request body:

{
  "memo": "lightning rocks",
  "value": 42,
  "currency": "btc"
}

Response:

{
  "payment_hash": "e4ba6db3e0559....",
  "payment_request": "lnbcrt100n1psj3gxxpp5u...",
  "settled": false
}

See Invoice struct in ln/lnd.go

Get Invoice

GET /v1/invoice/{payment_hash}

e.g. /v1/invoice/e4ba6db3e0559...

Response:

{
  "payment_hash": "e4ba6db3e0559e2535fdf4f9e36...",
  "payment_request": "lnbcrt100n1psj3gxxpp5ujaxmvlq2k...",
  "settled": true
}

See Invoice struct in ln/lnd.go

New Onchain Address

POST /v1/newaddress

Response:

bcrt1qrtp46czpudrnpcardxly35l83evgs3gc36lz3x

The address as a response body.