Create a lightning invoice

post/api/v2/wallet/{walletId}/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 Parameters

  • walletIdstringRequired
    Example: 59cd72485007a239fb00282ed480da1f
    Pattern: ^[0-9a-f]{32}$

Request Body

valueMsat string <number>required
The value of the invoice in millisatoshis
Example: 50000000
memo string
Optional memo or description for the invoice
Example: Payment for services
expiry number
Optional expiry time in seconds
Example: 3600

200 Response

memo string
A memo or description for the invoice
Example: Payment for the coffee
amtPaidMsat string <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.
invoice string required
The BOLT \#11 encoded invoice
Example: lnbc500n1p3zv5vkpp5x0thcaz8wep54clc2xt5895azjdzmthyskzzh9yslggy74qtvl6sdpdg3hkuct5d9hkugrxdaezqjn0dphk2fmnypkk2mtsdahkccqzpgxqyz5vqsp5v80q4vq4pwakq2l0hcqgtelgajsymv4ud4jdcrqtnzhvet55qlus9qyyssquqh2wl2m866qs5n72c5vg6wmqx9vzwhs5ypualq4mcu76h2tdkcq3jtjwtggfff7xwtdqxlnwqk8cxpzryjghrmmq3syraswp9vjr7cqry9l96
paymentHash string required
The payment hash of the invoice
Example: 63d9ce82e09d16761a85116ed8b65407db4fb22f85d03573de09c480f2c6d175
valueMsat string <number>required
The value of the invoice in satoshis
Example: 50000
expiresAt string <date-time>required
ISO-8601 string representing when the invoice will expire
Example: 2022-04-01T18:46:24.677Z
status string required
The status of the invoice
Allowed values: open settled canceled
walletId string required
The wallet to which this invoice belongs
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
createdAt string <date-time>required
ISO-8601 string representing when the invoice was created
Example: 2022-04-01T18:46:24.677Z
updatedAt string <date-time>required
ISO-8601 string representing when the invoice was updated
Example: 2022-04-01T18:46:24.677Z

400 Response

One of
name string
Error code
context object required
Properties that apply to a specific error name
error string required
Human-readable error message
requestId string required
Client request id

404 Response

name string required
Allowed value: InvalidWalletId
context object required
id string required
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
error string required
Human-readable error message
requestId string required
Client request id

500 Response

name string
Error code
context object required
Properties that apply to a specific error name
error string required
Human-readable error message
requestId string required
Client request id