Developer Guide

Sending

10min

Sending Payments

This guide explains how to send Lightning Network payments using the Voltage API.

Prerequisites

  • A Voltage account with an active wallet
  • An API key (get this from the "API Keys" page in your dashboard)

Sending a Payment

Endpoint

Text


Headers

Text


Request Body

JSON


Required Fields

  • id: A unique identifier for the payment
  • wallet_id: The ID of the wallet sending the payment
  • currency: Currently only "btc" is supported
  • type: Currently only "bolt11" is supported
  • data.payment_request: The Lightning invoice you want to pay
  • data.amount_msats: Payment amount in millisatoshis
  • data.max_fee_msats: Maximum routing fee you're willing to pay

Monitoring Payment Status

After sending a payment, monitor its status using:

Text


The payment will transition through these states:

  • sending: Payment is in progress
  • completed: Payment was successful
  • failed: Payment failed (check error field for details)

Error Handling

Common HTTP status codes:

  • 200: Success
  • 400: Invalid request (check error message)
  • 403: Authentication error
  • 404: Payment not found
  • 500: Server error

Example Implementation

Curl