### Programmatic Node Access with API/CLI Source: https://docs.voltageapi.com/node-backed-setup This guide provides resources for accessing your Voltage Lightning Node programmatically. It includes links to configuration details, LND API methods, and LNCLI methods for managing balances and funds. ```N/A Configure your desired interface for accessing your Node programatically https://enterprise.voltage.cloud/configuration Utilize LND methods for checking balances and moving funds for both Onchain and Lightning https://enterprise.voltage.cloud/lnd-api-methods-overview Utilize LNCLI methods for checking balances and moving funds for both Onchain and Lightning https://enterprise.voltage.cloud/lncli-methods-overview Check out easy-lncli for an easy secure environment for running lncli in just a few clicks ``` -------------------------------- ### API Key Authentication Example Source: https://docs.voltageapi.com/voltage-payments-api Demonstrates how to authenticate API requests using an x-api-key header. Replace 'YOUR_API_KEY' with your actual API key. ```Shell --header 'x-api-key: YOUR_API_KEY' ``` -------------------------------- ### Initiate On-Chain Withdrawal using lncli Source: https://docs.voltageapi.com/node-backed-setup This command initiates an on-chain withdrawal from your Voltage node to a specified Bitcoin address. Ensure you have the necessary permissions and the correct destination address and amount. ```shell lncli sendcoins --addr= --amt= ``` -------------------------------- ### Bake Support Macaroon for Voltage Source: https://docs.voltageapi.com/node-backed-setup This process involves generating a custom permission token (Macaroon) using Voltage's Macaroon Bakery. This token grants Voltage the necessary permissions for liquidity management and payment success assurance for your infrastructure. ```N/A On your Voltage Lightning Node Dashboard go to Manage Access -> Macaroon Bakery then click Bake Support Macaroon button ``` -------------------------------- ### Stream Channel Backups with LND API Source: https://docs.voltageapi.com/node-backed-setup This snippet demonstrates how to use the LND API's SubscribeChannelBackups endpoint to stream static channel backup updates directly to your system for enhanced redundancy. This is useful for automating backup processes. ```Go package main import ( "context" "fmt" "log" "github.com/lightningnetwork/lnd/lnrpc/chainrpc" "google.golang.org/grpc" ) func main() { // Replace with your LND gRPC endpoint and TLS cert path conn, err := grpc.Dial("your-lnd-grpc-endpoint:10009", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { log.Fatalf("failed to connect: %v", err) } defer conn.Close() client := chainrpc.NewChainNotifierClient(conn) req := &chainrpc.ChanBackupSubsription{ // Add any specific subscription parameters if needed } stream, err := client.SubscribeChannelBackups(context.Background(), req) if err != nil { log.Fatalf("could not subscribe to channel backups: %v", err) } fmt.Println("Subscribed to channel backup updates...") for { backup, err := stream.Recv() if err != nil { log.Printf("error receiving backup update: %v", err) // Implement retry logic or exit break } // Process the received channel backup data fmt.Printf("Received channel backup update: %+v\n", backup) } } ``` -------------------------------- ### Accessing Node Funds and Channels via ThunderHub Source: https://docs.voltageapi.com/node-backed-setup This section explains how to use ThunderHub, a Node Management dashboard for LND, to manage your node's funds and channels. It covers sending/receiving payments and checking balances through the ThunderHub UI. ```N/A Access ThunderHub on your Voltage Lightning Node Dashboard You can Send Lightning or Onchain payments (designated with anchor icon) _Receiving onchain is how you will initially fund your node_ You can check your balances at the top and see many more detailed transaction reports accross ThunderHub's various dashboards. ``` -------------------------------- ### Get Wallet Balance (Curl) Source: https://docs.voltageapi.com/developer-guide Fetches the balance of a specific wallet by sending a GET request to the VoltageAPI. Requires organization and wallet IDs. ```Curl curl 'https://voltageapi.com/v1/organizations/{organization_id}/wallets/{wallet_id}' ``` -------------------------------- ### Add Custom Metadata to Wallet Creation Source: https://docs.voltageapi.com/developer-guide This example demonstrates how to include custom metadata when creating a wallet via the VoltageAPI. This is useful for associating specific identifiers or purposes with your wallets, such as customer IDs or usage reasons. ```bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/wallets' \ --request POST \ --data '{ "name": "Customer Wallet", "metadata": { "customer_id": "cust_123", "purpose": "subscription_payments" } // ... other wallet creation fields }' ``` -------------------------------- ### Webhook Response Example Source: https://docs.voltageapi.com/webhooks This is an example of the response received after successfully creating a webhook. It contains the webhook ID and a shared secret, which is crucial for verifying webhook signatures. ```JSON { "id": "123e4567-e89b-12d3-a456-426614174000", "shared_secret": "vltg_GDtRrrJFJ6afRrAYMW3t9RpxgCdcT8zp" } ``` -------------------------------- ### Get Payment History (Curl) Source: https://docs.voltageapi.com/developer-guide Retrieves the history of a specific payment by sending a GET request to the VoltageAPI. Requires organization, environment, and payment IDs. ```Curl curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}/history' ``` -------------------------------- ### Get Payment Details Source: https://docs.voltageapi.com/voltage-payments-api Fetches specific information about a particular payment. This is a GET request to the /organizations/{organization_id}/environments/{environment_id}/payments/{payment_id} endpoint. ```HTTP GET /organizations/{organization_id}/environments/{environment_id}/payments/{payment_id} ``` -------------------------------- ### Example Payment Details Response Source: https://docs.voltageapi.com/developer-guide This JSON object represents the detailed response received after fetching payment information from the Voltage API. It includes the BIP21 URI, creation and update timestamps, currency, payment specifics (amount, memo, payment request), direction, environment and organization IDs, status, type, and wallet ID. ```JSON { "bip21_uri": "lightning:lntbs140n1pnag...", "created_at": "2025-03-14T16:08:11.692963Z", "currency": "btc", "data": { "amount_msats": 14000, "memo": "test payment", "payment_request": "lntbs140n1pnag..." }, "direction": "receive", "environment_id": "{environment_id}", "error": null, "id": "11ca843c-bdaa-44b6-965a-39ac550fcdf3", "organization_id": "{organization_id}", "status": "receiving", "type": "bolt11", "updated_at": "2025-03-14T16:08:13.959324Z", "wallet_id": "{wallet_id}" } ``` -------------------------------- ### View All Credit Lines Source: https://docs.voltageapi.com/voltage-payments-api Lists all lines of credit available across an organization. This is a GET request to the /organizations/{organization_id}/lines_of_credit/summaries endpoint. ```HTTP GET /organizations/{organization_id}/lines_of_credit/summaries ``` -------------------------------- ### Fetch Payment Status (Bash) Source: https://docs.voltageapi.com/developer-guide Retrieves the current status of a payment by sending a GET request to the VoltageAPI. Requires organization, environment, and payment IDs. This is used to monitor the progress after an initial payment initiation. ```Bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}' \ --request GET ``` -------------------------------- ### Initiate Payment Send (Bash) Source: https://docs.voltageapi.com/developer-guide Initiates a payment transaction by sending a POST request to the VoltageAPI. Requires organization and environment IDs, an API key, and payment details including amount and payment request. Returns a 202 status code on successful initiation. ```Bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments' \ --request POST \ --header 'x-api-key: your-api-key' \ --header 'Content-Type: application/json' \ --data '{ "id": "68d00852-8dd8-4c71-94d2-91c84695da78", # Unique payment identifier "wallet_id": "{wallet_id}", "currency": "btc", "type": "bolt11", "data": { # Optional when payment_request already has an amount # Required when payment_request has no amount # If provided with an amount-containing payment_request, values must match "amount_msats": 150000, # Optional: defaults to 1% of payment value or 1,000 msats (whichever is greater) "max_fee_msats": 1000, # Required: Lightning invoice to pay "payment_request": "lntbs1500n1p..." } }' ``` -------------------------------- ### Create Wallet Source: https://docs.voltageapi.com/voltage-payments-api Creates a new wallet in either development or production environments for an organization. This is a POST request to the /organizations/{organization_id}/wallets endpoint. ```HTTP POST /organizations/{organization_id}/wallets ``` -------------------------------- ### List Wallets Source: https://docs.voltageapi.com/voltage-payments-api Retrieves a list of all wallets within a specified organization. This is a GET request to the /organizations/{organization_id}/wallets endpoint. ```HTTP GET /organizations/{organization_id}/wallets ``` -------------------------------- ### Track Payment History Source: https://docs.voltageapi.com/voltage-payments-api Views the complete lifecycle and history of a specific payment. This is a GET request to the /organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}/history endpoint. ```HTTP GET /organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}/history ``` -------------------------------- ### Create Payment Source: https://docs.voltageapi.com/voltage-payments-api Initiates a new Bitcoin payment, either sending or receiving, via the Lightning Network. This is a POST request to the /organizations/{organization_id}/environments/{environment_id}/payments endpoint. ```HTTP POST /organizations/{organization_id}/environments/{environment_id}/payments ``` -------------------------------- ### List Payments Source: https://docs.voltageapi.com/voltage-payments-api Retrieves a history of payments, with options for filtering, for a given organization and environment. This is a GET request to the /organizations/{organization_id}/environments/{environment_id}/payments endpoint. ```HTTP GET /organizations/{organization_id}/environments/{environment_id}/payments ``` -------------------------------- ### Create Staging Wallet - Voltage Payments API Source: https://docs.voltageapi.com/staging-environment This snippet demonstrates how to create a new staging wallet using the Voltage Payments API. It requires organization ID, environment ID, line of credit ID, and specifies a limit and network. The metadata can be used for tagging test wallets. ```Bash curl 'https://voltageapi.com/api/v1/organizations/{organization_id}/wallets' \ --request POST \ --data '{ "environment_id": "{environment_id}", "id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", # UUID you generate "line_of_credit_id": "your-line-of-credit-id", "limit": 100000000, "metadata": { "tag": "testing wallet" }, "name": "My First Wallet", "network": "mutinynet" }' ``` -------------------------------- ### View Credit Summary Source: https://docs.voltageapi.com/voltage-payments-api Retrieves details about the available credit line for an organization. This is a GET request to the /organizations/{organization_id}/lines_of_credit/{line_id}/summary endpoint. ```HTTP GET /organizations/{organization_id}/lines_of_credit/{line_id}/summary ``` -------------------------------- ### Voltage Payments API Staging Environment Base URL Source: https://docs.voltageapi.com/staging-environment This provides the base URL for making API requests to the Voltage Payments staging environment. All interactions with the staging API should use this endpoint. ```Text https://voltageapi.com/v1 ``` -------------------------------- ### Fetch Payment Details and Invoice Source: https://docs.voltageapi.com/developer-guide After creating a payment, this command fetches the payment details from the Voltage API using the organization ID, environment ID, and the payment ID. This is necessary to retrieve the invoice and monitor the payment status. The response includes details like BIP21 URI, creation timestamp, currency, payment data, direction, status, and wallet information. ```Bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}' \ --request GET ``` -------------------------------- ### Create Staging Wallet via API Source: https://docs.voltageapi.com/developer-guide This snippet shows how to create a new staging wallet using the VoltageAPI. It requires your organization ID, environment ID, and a generated line of credit ID. You can also specify a limit, metadata, and a name for the wallet. ```curl curl 'https://voltageapi.com/v1/organizations/{organization_id}/wallets' \ --request POST \ --data '{ "environment_id": {environment_id}, "id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", # UUID you generate "line_of_credit_id": "your-line-of-credit-id", # denominated in msats "limit": 100000000, "metadata": { "tag": "testing wallet" }, "name": "My First Wallet", "network": "mutinynet" }' ``` -------------------------------- ### Retrieve Wallet Details Source: https://docs.voltageapi.com/voltage-payments-api Fetches detailed information, including balance and status, for a specific wallet within an organization. This is a GET request to the /organizations/{organization_id}/wallets/{wallet_id} endpoint. ```HTTP GET /organizations/{organization_id}/wallets/{wallet_id} ``` -------------------------------- ### Generate New VoltageAPI Webhook Key (Bash) Source: https://docs.voltageapi.com/webhooks This command-line example shows how to generate a new webhook key for a specific VoltageAPI webhook. It uses `curl` to send a POST request to the API endpoint, requiring authentication with an API key. ```bash curl 'https://voltageapi.com/v1/organizations/{org_id}/environments/{env_id}/webhooks/{webhook_id}/keys' \ --request POST \ --header 'X-Api-Key: YOUR_SECRET_TOKEN' ``` -------------------------------- ### Wallet Metadata Example Source: https://docs.voltageapi.com/wallet-management Demonstrates the use of wallet metadata for storing custom information, such as customer IDs or purpose. Metadata can be any valid JSON object and is returned with wallet objects for filtering and organization. ```json "metadata": { "customer_id": "cust_123", "purpose": "subscription_payments", "team": "engineering", "region": "north-america" } ``` -------------------------------- ### Create a Lightning Payment Source: https://docs.voltageapi.com/developer-guide This snippet demonstrates how to create a new payment request using the Voltage API. It requires organization ID, environment ID, payment details like amount, currency, description, a unique payment ID, payment kind (e.g., 'bolt11'), and wallet ID. The API returns a 202 status on success, indicating the request has been accepted. ```Bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments' \ --request POST \ --data '{ "amount_msats": 10000, "currency": "btc", "description": "test payment", "id": {payment_id}, // unique UUID created by you "payment_kind": "bolt11", "wallet_id": {wallet_id} }' ``` -------------------------------- ### VoltageAPI Payment Operations with cURL Source: https://docs.voltageapi.com/sending A combined example using cURL to first send a Lightning payment and then check its status. This illustrates a common workflow for payment processing, including request formatting and authentication headers. ```curl # Send payment curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments' \ --request POST \ --header 'x-api-key: your-api-key' \ --header 'Content-Type: application/json' \ --data '{ "id": "68d00852-8dd8-4c71-94d2-91c84695da78", "wallet_id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", "currency": "btc", "type": "bolt11", "data": { "amount_msats": 150000, "max_fee_msats": 1000, "payment_request": "lntbs1500n1p..." } }' # Check payment status curl 'https://voltageapi.com/api/v1/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id}' \ --header 'x-api-key: your-api-key' ``` -------------------------------- ### List Deliveries via HTTP Source: https://docs.voltageapi.com/webhooks Retrieves a history of webhook deliveries for a specified webhook ID. This is a GET request to the Voltage Payments API. ```HTTP GET /.../webhooks/{webhook_id}/deliveries ``` -------------------------------- ### Monitor Payment Status (JS) Source: https://docs.voltageapi.com/developer-guide Asynchronously monitors the status of a payment by repeatedly fetching its details. It checks for 'completed' or 'failed' states and includes a delay between checks to avoid excessive polling. Throws an error if the payment fails. ```JS async function monitorPayment(paymentId) { while (true) { const response = await fetchPaymentStatus(paymentId); if (response.status === 'completed') { return response; // Payment successful } if (response.status === 'failed') { throw new Error(response.error || 'Payment failed'); } // Wait before checking again await new Promise(resolve => setTimeout(resolve, 2000)); } } ``` -------------------------------- ### View Wallet Transaction History Source: https://docs.voltageapi.com/voltage-payments-api Accesses the ledger of all transactions associated with a specific wallet. This is a GET request to the /organizations/{organization_id}/wallets/{wallet_id}/ledger endpoint. ```HTTP GET /organizations/{organization_id}/wallets/{wallet_id}/ledger ``` -------------------------------- ### Expose Localhost with Tunneling Service Source: https://docs.voltageapi.com/webhooks Provides commands for exposing a local development server to the internet using tunneling services like Smee.io or ngrok, enabling external services to send webhooks to the local environment. ```Bash # Using smee.io npm install -g smee-client smee --url https://smee.io/YOUR_CHANNEL --target http://localhost:7999 # Or using ngrok ngrok http 7999 ``` -------------------------------- ### Create Voltage Webhook Source: https://docs.voltageapi.com/webhooks This snippet demonstrates how to create a webhook for Voltage Payments by making a POST request to the webhooks endpoint. It includes specifying the URL, name, and the events to subscribe to, along with authentication headers and a sample JSON payload. ```Bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/webhooks' \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: YOUR_SECRET_TOKEN' \ --data '{ "id": "b0fc9829-f139-4035-bb14-4a4b6cd58f0e", "url": "https://your-domain.com/webhook", "name": "Production Payment Webhook", "events": [ {"send": "succeeded"}, {"send": "failed"}, {"receive": "generated"}, {"receive": "completed"}, {"receive": "failed"} ] }' ``` -------------------------------- ### Run Webhook Tester Script Source: https://docs.voltageapi.com/webhooks Executes the webhook tester script, which is used for local development and testing of webhook integrations. ```Bash python webhook_tester.py ``` -------------------------------- ### Get Specific Delivery via HTTP Source: https://docs.voltageapi.com/webhooks Retrieves details for a specific webhook delivery using its unique delivery ID. This is a GET request to the Voltage Payments API. ```HTTP GET /.../webhooks/{webhook_id}/deliveries/{delivery_id} ``` -------------------------------- ### Delete Wallet Source: https://docs.voltageapi.com/voltage-payments-api Removes a wallet from an organization when it is no longer needed. This is a DELETE request to the /organizations/{organization_id}/wallets/{wallet_id} endpoint. ```HTTP DELETE /organizations/{organization_id}/wallets/{wallet_id} ``` -------------------------------- ### View Deliveries for a Webhook Source: https://docs.voltageapi.com/webhooks Lists all deliveries associated with a specific webhook. Requires organization ID, environment ID, and webhook ID. Authentication is done via an X-Api-Key. ```Bash curl 'https://voltageapi.com/v1/organizations/{org_id}/environments/{env_id}/webhooks/{webhook_id}/deliveries' \ --header 'X-Api-Key: YOUR_SECRET_TOKEN' ``` -------------------------------- ### Create Wallet - Voltage Payments API Source: https://docs.voltageapi.com/wallet-management This snippet demonstrates how to create a new wallet using the Voltage Payments API. It requires an organization ID, environment ID, line of credit ID, and specifies wallet details like name, network, and limit. Authentication is handled via a Bearer token. ```bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/wallets' \ --request POST \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "environment_id": "{environment_id}", "id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", # UUID you generate "line_of_credit_id": "your-line-of-credit-id", "limit": 100000000, # denominated in msats (100,000,000 msats = 0.001 BTC) "metadata": { "tag": "testing wallet", "customer_id": "cust_123" # your custom metadata }, "name": "Customer Wallet", "network": "mutinynet" # or "mainnet", "testnet3" }' ``` -------------------------------- ### Configure Webhook Tester Source: https://docs.voltageapi.com/webhooks Defines the configuration for the webhook tester script, including host, port, shared secret, output file, and log level. ```JSON { "host": "localhost", "port": 7999, "secret": "vltg_GDtRrrJFJ6afRrAYMW3t9RpxgCdcT8zp", "output_file": "webhooks.json", "log_level": "DEBUG" } ``` -------------------------------- ### Send Onchain Payment - Voltage API Source: https://docs.voltageapi.com/sending Initiate an onchain Bitcoin payment via the Voltage API. This method requires a Bitcoin address, amount in satoshis, and supports optional fee limits and labels. ```json { "id": "2ec1e783-19b4-4c10-8181-66336a6232bd", "wallet_id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", "currency": "btc", "type": "onchain", "data": { "address": "tb1pzkhtj4ld86g9c49du5yagnncfrm0s489t76vmrwmt2ecxfnf7spsvjte49", // Required: Bitcoin address "amount_sats": 150000, // Required: Amount in satoshis (must be greater than 0) "max_fee_sats": 1000, // Optional: defaults to 1% of payment value or 1,000 sats "label": "test payment" // Optional: Label for the payment } } ``` -------------------------------- ### Implement VoltageAPI Webhook Signature Verification (JavaScript) Source: https://docs.voltageapi.com/webhooks This snippet demonstrates how to set up an Express.js server to receive and verify incoming webhook requests from VoltageAPI. It includes middleware to capture the raw request body and a function to validate the signature using HMAC-SHA256. ```javascript const express = require('express'); const crypto = require('crypto'); // Middleware to capture raw body for signature verification app.use('/webhook', express.raw({ type: 'application/json' })); app.post('/webhook', async (req, res) => { try { // Get headers and raw body const signature = req.headers['x-voltage-signature']; const timestamp = req.headers['x-voltage-timestamp']; const rawBody = req.body.toString('utf-8'); // Verify signature if (!verifyWebhookSignature(rawBody, signature, timestamp, process.env.WEBHOOK_SECRET)) { return res.status(401).json({ error: 'Invalid signature' }); } // Parse payload const payload = JSON.parse(rawBody); // Queue for async processing (using your preferred queue system) await processWebhookAsync(payload); // e.g., Bull, RabbitMQ, etc. return res.status(200).json({ status: 'accepted' }); } catch (error) { console.error('Webhook processing error:', error); return res.status(500).json({ error: 'Internal error' }); } }); function verifyWebhookSignature(payload, signature, timestamp, sharedSecret) { if (!signature || !timestamp || !sharedSecret) { return false; } const message = `${payload}.${timestamp}`; const hmac = crypto.createHmac('sha256', sharedSecret); hmac.update(message); const expectedSignature = hmac.digest('base64'); return crypto.timingSafeEqual( Buffer.from(expectedSignature), Buffer.from(signature) ); } ``` -------------------------------- ### Test Webhook Endpoint with cURL Source: https://docs.voltageapi.com/webhooks Sends a POST request to a Voltage API webhook test endpoint to verify webhook functionality. It includes an API key for authentication and a sample payload representing a completed payment. ```Bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/webhooks/{webhook_id}/test' \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: YOUR_SECRET_TOKEN' \ --data '{ "delivery_id": "123e4567-e89b-12d3-a456-426614174002", "payload": { "type": "receive", "detail": { "event": "completed", "data": { "id": "test-payment-123", "currency": "BTC", "direction": "receive", "status": "completed", "data": { "amount_msats": 250000, "description": "Test webhook" } } } } }' ``` -------------------------------- ### Create Lightning Payment Request (Voltage API) Source: https://docs.voltageapi.com/receiving This snippet demonstrates how to create a payment request for receiving Lightning Network payments using the Voltage API. It requires an API key, organization ID, environment ID, and specifies payment details like amount, currency, and wallet ID. ```HTTP POST https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments --header 'x-api-key: your-api-key' --header 'Content-Type: application/json' --data '{ "amount_msats": 10000, "currency": "btc", "description": "test payment", "id": "11ca843c-bdaa-44b6-965a-39ac550fcdf3", "payment_kind": "bolt11", "wallet_id": "{wallet_id}" }' ``` -------------------------------- ### Retry Failed Delivery via HTTP Source: https://docs.voltageapi.com/webhooks Initiates a retry for a previously failed webhook delivery. This is a POST request to the Voltage Payments API. ```HTTP POST /.../webhooks/{webhook_id}/deliveries/{delivery_id}/retry ``` -------------------------------- ### Send Lightning Payment with cURL Source: https://docs.voltageapi.com/sending This snippet demonstrates how to send a Lightning payment using the VoltageAPI. It requires specifying payment details like amount, fee, and payment request within a JSON payload. Authentication is handled via an x-api-key header. ```bash # Send Lightning payment curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments' \ --request POST \ --header 'x-api-key: your-api-key' \ --header 'Content-Type: application/json' \ --data '{ "id": "68d00852-8dd8-4c71-94d2-91c84695da78", "wallet_id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", "currency": "btc", "type": "bolt11", "data": { "amount_msats": 150000, "max_fee_msats": 1000, "payment_request": "lntbs1500n1p..." } }' ``` -------------------------------- ### Monitor Payment Status (Voltage API) Source: https://docs.voltageapi.com/receiving This snippet demonstrates how to monitor the status of a Lightning Network payment using the Voltage API. It requires the payment ID, organization ID, environment ID, and an API key. ```HTTP GET https://voltageapi.com/api/v1/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id} --header 'x-api-key: your-api-key' ``` -------------------------------- ### List Wallets - Voltage Payments API Source: https://docs.voltageapi.com/wallet-management This snippet shows how to retrieve a list of all wallets within an organization using the Voltage Payments API. It requires the organization ID and authentication via a Bearer token. ```bash curl 'https://voltageapi.com/v1/organizations/{organization_id}/wallets' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Retrieve Payment Details (Voltage API) Source: https://docs.voltageapi.com/receiving This snippet shows how to retrieve the details of a previously created payment request using the Voltage API. It requires the payment ID, organization ID, environment ID, and an API key. ```HTTP GET https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments/{payment_id} --header 'x-api-key: your-api-key' ``` -------------------------------- ### Send Lightning Payment Source: https://docs.voltageapi.com/sending This snippet demonstrates how to send a Lightning payment using the Voltage API. It requires the organization ID, environment ID, an API key, and a JSON payload containing payment details like amount, currency, and payment request. ```curl curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments' \ --request POST \ --header 'x-api-key: your-api-key' \ --header 'Content-Type: application/json' \ --data '{ "id": "68d00852-8dd8-4c71-94d2-91c84695da78", "wallet_id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", "currency": "btc", "type": "bolt11", "data": { "amount_msats": 150000, "max_fee_msats": 1000, "payment_request": "lntbs1500n1p..." } }' ``` -------------------------------- ### Retrieve a Specific Wallet Source: https://docs.voltageapi.com/wallet-management Fetches the details for a single wallet, including its ID, balances, and metadata. The response format mirrors that of a single wallet object from the list endpoint. ```curl curl 'https://voltageapi.com/v1/organizations/{organization_id}/wallets/{wallet_id}' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Send Unified Payment (bip21) - Voltage API Source: https://docs.voltageapi.com/sending Facilitate a unified Bitcoin payment using BIP21 URIs with the Voltage API. This allows specifying both Lightning and onchain details, including addresses, amounts, and fees. ```json { "id": "3e84b6c5-5bbe-4e0f-9fb3-f1198330f6fa", "wallet_id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", "currency": "btc", "type": "bip21", "data": { "address": "bitcoin:tb1pzkhtj4ld86g9c49du5yagnncfrm0s489t76vmrwmt2ecxfnf7spsvjte49?amount=0.0015", // Required: BIP21 URI "amount_msats": 150000, // Optional: Amount specification "max_fee_msats": 1000, // Optional: Max fee for Lightning portion "max_fee_sats": 10, // Optional: Max fee for onchain portion "description": "Payment for services" // Optional: Payment description } } ``` -------------------------------- ### Send Onchain Payment with cURL Source: https://docs.voltageapi.com/sending This snippet shows how to send an onchain payment via the VoltageAPI. It includes details such as the recipient address, amount in sats, maximum fee, and an optional label, all formatted within a JSON payload and sent via cURL with API key authentication. ```bash # Send onchain payment curl 'https://voltageapi.com/v1/organizations/{organization_id}/environments/{environment_id}/payments' \ --request POST \ --header 'x-api-key: your-api-key' \ --header 'Content-Type: application/json' \ --data '{ "id": "2ec1e783-19b4-4c10-8181-66336a6232bd", "wallet_id": "7a68a525-9d11-4c1e-a3dd-1c2bf1378ba2", "currency": "btc", "type": "onchain", "data": { "address": "tb1pzkhtj4ld86g9c49du5yagnncfrm0s489t76vmrwmt2ecxfnf7spsvjte49", "amount_sats": 150000, "max_fee_sats": 1000, "label": "test payment" } }' ```