POST
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.
Path Params
-
walletIdstring required
Body Params
object
-
valueMsatstring numberThe value of the invoice in millisatoshis. Provide exactly one ofvalueMsatorvalueSat. This field is not supported for Go wallets. -
valueSatnumberThe value of the invoice in satoshis. Provide exactly one ofvalueMsatorvalueSat. -
memostringOptional memo or description for the invoice -
expirynumberOptional 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.
Responses
200
OK
Response Body
object
-
memostringA memo or description for the invoice -
amtPaidMsatstring numberThe 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 requiredThe BOLT #11 encoded invoice -
paymentHashstring requiredThe payment hash of the invoice -
valueMsatstring number requiredThe value of the invoice in millisatoshis -
expiresAtstring date-time requiredISO-8601 string representing when the invoice will expire -
statusstring enum requiredThe status of the invoiceopensettledcanceled -
walletIdstring requiredThe wallet to which this invoice belongs -
createdAtstring date-time requiredISO-8601 string representing when the invoice was created -
updatedAtstring date-time requiredISO-8601 string representing when the invoice was updated
400
Bad Request
Response Body
ONE OF
-
namestringError code -
contextmap of objects requiredProperties that apply to a specific error namecontext object
-
<key>object
-
-
errorstring requiredHuman-readable error message -
requestIdstring requiredClient request id
-
namestring enum requiredInvalidWalletId -
contextobject requiredcontext object
-
idstring required
-
-
errorstring requiredHuman-readable error message -
requestIdstring requiredClient request id
404
Not Found
Response Body
object
-
namestring enum requiredInvalidWalletId -
contextobject requiredcontext object
-
idstring required
-
-
errorstring requiredHuman-readable error message -
requestIdstring requiredClient request id
500
Internal Server Error
Response Body
object
-
namestringError code -
contextmap of objects requiredProperties that apply to a specific error namecontext object
-
<key>object
-
-
errorstring requiredHuman-readable error message -
requestIdstring requiredClient request id