REST APIWallet & TransactLightning

POST

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

  • walletId string required

    matches ^[0-9a-f]{32}$

Body Params

object

  • valueMsat string number
    The value of the invoice in millisatoshis. Provide exactly one of valueMsat or valueSat. This field is not supported for Go wallets.
  • valueSat number
    The value of the invoice in satoshis. Provide exactly one of valueMsat or valueSat.
  • memo string
    Optional memo or description for the invoice
  • expiry number
    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.

Responses

200
OK

Response Body

object

  • memo string
    A memo or description for the invoice
  • 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
  • paymentHash string required
    The payment hash of the invoice
  • valueMsat string number required
    The value of the invoice in millisatoshis
  • expiresAt string date-time required
    ISO-8601 string representing when the invoice will expire
  • status string enum required
    The status of the invoice
    opensettledcanceled
  • walletId string required
    The wallet to which this invoice belongs
  • createdAt string date-time required
    ISO-8601 string representing when the invoice was created
  • updatedAt string date-time required
    ISO-8601 string representing when the invoice was updated
400
Bad Request

Response Body

ONE OF

  • name string
    Error code
  • context map of objects required
    Properties that apply to a specific error name
    context object
    • <key> object
  • error string required
    Human-readable error message
  • requestId string required
    Client request id
404
Not Found

Response Body

object

  • name string enum required
    InvalidWalletId
  • context object required
    context object
    • id string required

      matches ^[0-9a-f]{32}$

  • error string required
    Human-readable error message
  • requestId string required
    Client request id
500
Internal Server Error

Response Body

object

  • name string
    Error code
  • context map of objects required
    Properties that apply to a specific error name
    context object
    • <key> object
  • error string required
    Human-readable error message
  • requestId string required
    Client request id