latestOpenAPI 3.0.32026-08-224982,0272.8 MB

e445c15e5bee

Lightning

Create a lightning invoice

This API call is used to create a new lightning invoice which can be used for requesting and receiving payments over the lightning network.

post/api/v2/wallet/{walletId}/lightning/invoice

Path parameters

walletIdstring required
Example:59cd72485007a239fb00282ed480da1f

Request body

valueMsatstring number

The value of the invoice in millisatoshis. Provide exactly one of valueMsat or valueSat. This field is not supported for Go wallets.

valueSatnumber

The value of the invoice in satoshis. Provide exactly one of valueMsat or valueSat.

memostring

Optional memo or description for the invoice

expirynumber

Optional expiry time in seconds. By default, the invoice will expire in 72 hours. This field is not supported for Go wallets - it is automatically set to the default.

Example request

{
  "valueMsat": "50000000",
  "valueSat": 50000,
  "memo": "Payment for services",
  "expiry": 3600
}

Response

OK

memostring

A memo or description for the invoice

amtPaidMsatstring number

The number of millisats actually paid to this invoice, this may be greater than the amount requested by the invoice, since lightning allows overpaying (but not underpaying) invoices.

invoicestring required

The BOLT #11 encoded invoice

paymentHashstring required

The payment hash of the invoice

valueMsatstring number required

The value of the invoice in millisatoshis

expiresAtstring date-time required

ISO-8601 string representing when the invoice will expire

status'open' | 'settled' | 'canceled' required

The status of the invoice

walletIdstring required
createdAtstring date-time required

ISO-8601 string representing when the invoice was created

updatedAtstring date-time required

ISO-8601 string representing when the invoice was updated

Example response

{
  "memo": "Payment for the coffee",
  "invoice": "lnbc500n1p3zv5vkpp5x0thcaz8wep54clc2xt5895azjdzmthyskzzh9yslggy74qtvl6sdpdg3hkuct5d9hkugrxdaezqjn0dphk2fmnypkk2mtsdahkccqzpgxqyz5vqsp5v80q4vq4pwakq2l0hcqgtelgajsymv4ud4jdcrqtnzhvet55qlus9qyyssquqh2wl2m866qs5n72c5vg6wmqx9vzwhs5ypualq4mcu76h2tdkcq3jtjwtggfff7xwtdqxlnwqk8cxpzryjghrmmq3syraswp9vjr7cqry9l96",
  "paymentHash": "63d9ce82e09d16761a85116ed8b65407db4fb22f85d03573de09c480f2c6d175",
  "valueMsat": "50000",
  "expiresAt": "2022-04-01T18:46:24.677Z",
  "walletId": "59cd72485007a239fb00282ed480da1f",
  "createdAt": "2022-04-01T18:46:24.677Z",
  "updatedAt": "2022-04-01T18:46:24.677Z"
}