Pay Lightning Invoice - Custody

Pay a Lightning Network invoice from a custody wallet. See the Guide.

  1. You pay a valid Lightning invoice by providing the invoice string and your wallet passphrase. You can optionally set fee limits using feeLimitMsat or feeLimitRatio, a custom sequenceId for tracking, and a comment for internal reference. Payments route over the Lightning Network and typically settle or fail immediately.

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

    API Reference

// 1. Pay Lightning Invoice
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="tlnbtc"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ADDRESS="<DESTINATION_ADDRESS>"
export AMOUNT="<AMOUNT_IN_BASE_UNITS>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"

curl -X POST \
  http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/$WALLET_ID/lightning/payment \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "invoice": string,                       # Encoded payment request (required)
    "passphrase": "'"$WALLET_PASSPHRASE"'",  # Wallet passphrase (required)
    "amountMsat": string,     # Amount to pay in millisatoshis (optional, required for zero-amount invoices)
    "feeLimitMsat": string,   # Maximum fee to pay in millisatoshis
    "feeLimitRatio": number,  # Maximum fee expressed as a ratio of the payment amount
    "sequenceId": string,     # Custom identifier for tracking the payment
    "comment": string         # Additional note or comment for internal reference
}'
Response
// 1. Pay Lightning Invoice Response
{
    "txRequestId": "string",
    "txRequestState": "delivered",
    "paymentStatus": {
      "status": "pending",
      "paymentHash": "string",
      "paymentPreimage": "string",
      "amountMsat": "string",
      "feeMsat": "string",
      "failureReason": "string"
    },
    "transfer": {
      "id": "string",
      "coin": "string",
      "wallet": "string",
      "walletType": "string",
      "enterprise": "string",
      "organization": "string",
      "txid": "string",
      "state": "string",
      "type": "string",
      "value": 0,
      "valueString": "string",
      "coinSpecific": {
        "isOffchain": true,
        "invoice": "string"
      }
    }
}