BTCPay Server Lightning (Store) API

Lightning (Store) operations

GitHub OpenAPI

Operations 13

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/info Get information about a lightning node · Get node information #
Ask an LLM
“What is the status of my store's lightning node?”
“Can I check a lightning node's details before opening a channel?”
Tell an agent
Show info for {cryptoCode} lightning node {storeId}.
Get the status of the {cryptoCode} node in store {storeId}.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/balance Check a lightning node's balance · Get node balance #
Ask an LLM
“How much capacity does my lightning node have?”
“What is the current balance of a store's lightning node?”
Tell an agent
Show the balance of {cryptoCode} lightning node {storeId}.
Check capacity on the {cryptoCode} node in store {storeId}.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/histogram View a lightning node's balance histogram · Get node balance histogram #
Ask an LLM
“How has my lightning node's balance changed over time?”
“Can I see a balance histogram for a store's lightning node?”
Tell an agent
Show the balance histogram for {cryptoCode} lightning node {storeId}.
Get the balance history graph of the {cryptoCode} node in store {storeId}.
POST /api/v1/stores/{storeId}/lightning/{cryptoCode}/connect Connect to a lightning node · Connect to lightning node #
Ask an LLM
“How do I connect my lightning node to another node?”
“Can I add a new peer to a store's lightning node?”
Tell an agent
Connect to lightning node {nodeURI} on {cryptoCode} in store {storeId}.
Add a peer to the {cryptoCode} node of store {storeId}.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/channels List a lightning node's channels · Get channels #
Ask an LLM
“Which channels does my lightning node have open?”
“Can I list the channels of a store's lightning node?”
Tell an agent
Show the channels of {cryptoCode} lightning node {storeId}.
List open channels on the {cryptoCode} node in store {storeId}.
POST /api/v1/stores/{storeId}/lightning/{cryptoCode}/channels Open a channel to a lightning node · Open channel #
Ask an LLM
“How do I open a channel to another lightning node?”
“Can I fund a channel with a specific amount of satoshi?”
Tell an agent
Open a {channelAmount} satoshi channel to {nodeURI} on {cryptoCode} in store {storeId}.
Fund a channel to {nodeURI} on the {cryptoCode} node of store {storeId} at {feeRate} satoshi per byte.
POST /api/v1/stores/{storeId}/lightning/{cryptoCode}/address Get an on-chain deposit address for a lightning node · Get deposit address #
Ask an LLM
“Where should I send on-chain funds to top up my lightning node?”
“Can I get a deposit address for a store's lightning node?”
Tell an agent
Get a deposit address for {cryptoCode} lightning node {storeId}.
Show the on-chain address to fund the {cryptoCode} node in store {storeId}.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/payments/{paymentHash} Get a lightning payment · Get payment #
Ask an LLM
“Did a lightning payment go through?”
“Can I look up a payment by its hash?”
Tell an agent
Get lightning payment {paymentHash} on {cryptoCode} in store {storeId}.
Check the status of payment {paymentHash} on the {cryptoCode} node of store {storeId}.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices/{id} Get a lightning invoice · Get invoice #
Ask an LLM
“What are the details of a specific lightning invoice?”
“Can I fetch one invoice by its id?”
Tell an agent
Get lightning invoice {id} on {cryptoCode} in store {storeId}.
Show invoice {id} on the {cryptoCode} node of store {storeId}.
POST /api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices/pay Pay a lightning invoice · Pay Lightning Invoice #
Ask an LLM
“How do I pay a lightning invoice?”
“Can I cap the fee when paying an invoice?”
Tell an agent
Pay lightning invoice {BOLT11} on {cryptoCode} in store {storeId}.
Pay {BOLT11} on the {cryptoCode} node of store {storeId} with a max fee of {maxFeePercent} percent.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices List a store's lightning invoices · Get invoices #
Ask an LLM
“Which lightning invoices has my store received?”
“Can I list only pending invoices?”
Tell an agent
List lightning invoices for {cryptoCode} in store {storeId}.
Show {pendingOnly} invoices on the {cryptoCode} node of store {storeId}.
POST /api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices Create a lightning invoice · Create lightning invoice #
Ask an LLM
“How do I create a lightning invoice for a customer?”
“Can I set an expiry on a new invoice?”
Tell an agent
Create a {amount} satoshi invoice on {cryptoCode} in store {storeId}.
Create an invoice for {amount} satoshi on the {cryptoCode} node of store {storeId} expiring in {expiry} seconds.
GET /api/v1/stores/{storeId}/lightning/{cryptoCode}/payments List a store's lightning payments · Get payments #
Ask an LLM
“Which lightning payments has my store made?”
“Can I include pending payments in the list?”
Tell an agent
List payments on {cryptoCode} in store {storeId}.
Show {includePending} payments on the {cryptoCode} node of store {storeId}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/btcpay:btcpay-lightning-store-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

btcpay-lightning-store-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: BTCPay Greenfield Lightning (Store) API
  version: v1
  description: '# Introduction


    The BTCPay Server Greenfield API is a REST API. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.


    # Authentication


    You can authenticate either via Basic Auth or an API key. It''s recommended to use an API key for better security. You can create an API key in the BTCPay Server UI under `Account` -> `Manage Account` -> `API keys`. You can restrict the API key for one or multiple stores and for specific permissions. For testing purposes, you can give it the ''Unrestricted access'' permission. On production you should limit the permissions to the actual endpoints you use, you can see the required permission on the API docs at the top of each endpoint under `AUTHORIZATIONS`.


    If you want to simplify the process of creating API keys for your users, you can use the Authorization endpoint to predefine permissions and redirect your users to the BTCPay Server Authorization UI. You can find more information about this on the API Authorization Flow docs page.


    # Usage examples


    Use **Basic Auth** to read store information with cURL:

    ```bash

    BTCPAY_INSTANCE="https://mainnet.demo.btcpayserver.org"

    USER="MyTestUser@gmail.com"

    PASSWORD="notverysecurepassword"

    PERMISSION="btcpay.store.canmodifystoresettings"

    BODY="$(echo "{}" | jq --arg "a" "$PERMISSION" ''. + {permissions:[$a]}'')"


    API_KEY="$(curl -s \

    -H "Content-Type: application/json" \

    --user "$USER:$PASSWORD" \

    -X POST \

    -d "$BODY" \

    "$BTCPAY_INSTANCE/api/v1/api-keys" | jq -r .apiKey)"

    ```


    Use an **API key** to read store information with cURL:

    ```bash

    STORE_ID="yourStoreId"


    curl -s \

    -H "Content-Type: application/json" \

    -H "Authorization: token $API_KEY" \

    -X GET \

    "$BTCPAY_INSTANCE/api/v1/stores/$STORE_ID"

    ```


    You can find more examples on our docs for different programming languages:

    - cURL

    - Javascript/Node.Js

    - PHP'
  contact:
    name: BTCPay Server
    url: https://btcpayserver.org
  license:
    name: MIT
    url: https://github.com/btcpayserver/btcpayserver/blob/master/LICENSE
servers:
- url: /
  description: BTCPay Server Greenfield API
security:
- API_Key: []
  Basic: []
tags:


# --- truncated at 32 KB (34 KB total) ---
# Full source: https://artifacts.apis.io/btcpay/openapi/btcpay-lightning-store-api-openapi.yml