Create Lightning Invoice

Create a Lightning invoice and optionally retrieve it. See the Guide.

  1. You generate a Lightning invoice by specifying the amount in millisatoshis (valueMsat) or satoshis (valueSat) and optional metadata such as a memo or expiry time. Share the invoice with a payer to complete the payment. Custody wallets accept both valueSat and valueMsat; Go Lightning only accepts valueSat.

    BitGo currently limits individual Lightning transactions to a value of $500 USD or less.

    API Reference

  2. You can retrieve an individual Lightning invoice using the paymentHash from the creation response, or list all invoices for a wallet.

    API Reference

// 1. Create Lightning Invoice
export COIN="tlnbtc"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X POST \
  https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/lightning/invoice \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "valueMsat": string,   # Amount in millisatoshis
    "valueSat": string,    # Amount in satoshis
    "memo": string,        # Description of the invoice (optional)
    "expiry": number       # Expiration time in seconds (optional)
}'
// 2. (Optional) Get Lightning Invoice
export PAYMENT_HASH="<YOUR_INVOICE_PAYMENT_HASH>"

curl -X GET \
  https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/lightning/invoice/$PAYMENT_HASH \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
// 1. Create Lightning Invoice Response
{
    "valueMsat": "bigint",
    "valueSat": "bigint",
    "memo": "string",
    "paymentHash": "string",
    "invoice": "string",
    "walletId": "string",
    "status": "open",
    "expiresAt": "string"
}

// 2. (Optional) Get Lightning Invoice Response
{
  "memo": "Payment for the coffee",
  "amtPaidMsat": "string",
  "invoice": "lnbc500n1p3zv5vk...",
  "paymentHash": "63d9ce82e09d16761a85116ed8b65407db4fb22f85d03573de09c480f2c6d175",
  "valueMsat": "50000",
  "expiresAt": "2022-04-01T18:46:24.677Z",
  "status": "open",
  "walletId": "59cd72485007a239fb00282ed480da1f",
  "createdAt": "2022-04-01T18:46:24.677Z",
  "updatedAt": "2022-04-01T18:46:24.677Z"
}