BTCPay Server Invoices API

Invoice operations

GitHub OpenAPI
Business capability
Payment Initiation Management BC-1340.10

Operations 11

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}/invoices List a store's invoices · Get invoices #
Ask an LLM
“Which invoices have been created in my store?”
“Can I filter a store's invoices by status or by order ID?”
Tell an agent
List invoices in store {storeId}.
Show {status} invoices for order {orderId} in store {storeId}.
POST /api/v1/stores/{storeId}/invoices Create an invoice · Create a new invoice #
Ask an LLM
“How do I create a new invoice for a customer?”
“Can I set a custom amount and currency on an invoice?”
Tell an agent
Create an invoice for {amount} {currency} in store {storeId}.
Create an invoice in store {storeId} with metadata {metadata}.
GET /api/v1/invoices/{invoiceId} Get an invoice · Get invoice #
Ask an LLM
“What is the status and amount of a specific invoice?”
“Can I include the payment methods available on an invoice?”
Tell an agent
Get invoice {invoiceId}.
Show invoice {invoiceId} with payment methods {includePaymentMethods}.
DELETE /api/v1/invoices/{invoiceId} Archive an invoice · Archive invoice #
Ask an LLM
“How do I archive an invoice I no longer need?”
“Can I remove an invoice from view without deleting it?”
Tell an agent destructive · confirm first
Archive invoice {invoiceId}.
Hide invoice {invoiceId} by archiving it.
PUT /api/v1/invoices/{invoiceId} Update an invoice's metadata · Update invoice #
Ask an LLM
“Can I change the metadata on an existing invoice?”
“How do I edit an invoice after it has been created?”
Tell an agent
Update invoice {invoiceId} with metadata {metadata}.
Change the metadata on invoice {invoiceId}.
GET /api/v1/invoices/{invoiceId}/payment-methods List an invoice's payment methods · Get invoice payment methods #
Ask an LLM
“Which payment methods can a customer pay an invoice with?”
“Can I see only accounted payments on an invoice?”
Tell an agent
List payment methods for invoice {invoiceId}.
Show payment methods on invoice {invoiceId} with accounted payments {onlyAccountedPayments}.
POST /api/v1/invoices/{invoiceId}/status Mark an invoice as settled or invalid · Mark invoice status #
Ask an LLM
“How do I mark an invoice as invalid?”
“Can I settle an invoice manually?”
Tell an agent
Mark invoice {invoiceId} as {status}.
Set invoice {invoiceId} to invalid.
POST /api/v1/invoices/{invoiceId}/unarchive Restore an archived invoice · Unarchive invoice #
Ask an LLM
“How do I bring back an invoice I archived?”
“Can I undo archiving an invoice?”
Tell an agent
Unarchive invoice {invoiceId}.
Restore archived invoice {invoiceId}.
POST /api/v1/invoices/{invoiceId}/payment-methods/{paymentMethodId}/activate Activate a lazy payment method on an invoice · Activate Payment Method #
Ask an LLM
“How do I activate a payment method on an invoice after it was created?”
“Can I turn on a lazy payment method for an invoice?”
Tell an agent
Activate payment method {paymentMethodId} on invoice {invoiceId}.
Turn on lazy payment method {paymentMethodId} for invoice {invoiceId}.
POST /api/v1/invoices/{invoiceId}/refund Refund an invoice · Refund invoice #
Ask an LLM
“How do I refund an invoice to a customer?”
“Can I refund an invoice at the current rate instead of the rate it was paid?”
Tell an agent
Refund invoice {invoiceId} using refund variant {refundVariant}.
Refund {customAmount} {customCurrency} from invoice {invoiceId} with variant {refundVariant}.
GET /api/v1/invoices/{invoiceId}/refund/{paymentMethodId} Calculate a refund amount for a payment method · Get invoice refund trigger data #
Ask an LLM
“How much would a refund be for a specific payment method?”
“What refund amount is calculated for an invoice's payment method?”
Tell an agent
Calculate the refund for payment method {paymentMethodId} on invoice {invoiceId}.
Show refund amounts for {paymentMethodId} on invoice {invoiceId}.

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-invoices-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-invoices-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: BTCPay Greenfield Invoices 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 (48 KB total) ---
# Full source: https://artifacts.apis.io/btcpay/openapi/btcpay-invoices-api-openapi.yml