# BTCPay Server integrations: invoices

> Create an invoice, create a payment request and create a pull payment in BTCPay Server, and start a workflow when BTCPay Server sends “Invoice created”.

**Canonical page:** https://tray.ai/connectors/btcpay-server-integrations/
**Categories:** Finance
**Connects through:** HTTP Connector

## Overview

BTCPay Server is a free, open-source, self-hosted payment processor that lets merchants accept Bitcoin and Lightning payments through invoices, payment requests and payouts. Tray.ai connects to BTCPay Server through the HTTP Connector, so your workflows can call the BTCPay Server API alongside the rest of your stack.

## Use cases

### Invoices

Read, create, update, and delete invoices in BTCPay Server from any Tray.ai workflow. The BTCPay Server API covers calls such as list invoices and create an invoice.

- List invoices
- Create an invoice
- Update an invoice

### Payment requests

Read, create, update, and delete payment requests in BTCPay Server from any Tray.ai workflow. The BTCPay Server API covers calls such as list payment requests and create a payment request.

- List payment requests
- Create a payment request
- Update a payment request

### Pull payments

Read, create, and delete pull payments in BTCPay Server from any Tray.ai workflow. The BTCPay Server API covers calls such as list pull payments and create a pull payment.

- List pull payments
- Create a pull payment
- Archive a pull payment

### Payouts

Read, create, update, and delete payouts in BTCPay Server from any Tray.ai workflow. The BTCPay Server API covers calls such as list store payouts and create a payout.

- List store payouts
- Create a payout
- Approve a payout

### Webhooks

Read, create, update, delete, and manage webhooks in BTCPay Server from any Tray.ai workflow. The BTCPay Server API covers calls such as list webhooks and create a webhook.

- List webhooks
- Create a webhook
- Update a webhook

### BTCPay Server events

Start a Tray.ai workflow the moment something happens in BTCPay Server. BTCPay Server sends events such as invoice created and invoice received payment to a Tray.ai webhook trigger.

- Invoice created
- Invoice received payment
- Invoice processing

## Challenges Tray.ai solves

### Keeping BTCPay Server credentials out of logs

A raw API call usually means pasting a key or token into the request, where it ends up in step inputs, logs, and screenshots.

**How Tray.ai helps:** Store BTCPay Server credentials once as a Tray.ai authentication and reference them from the HTTP Connector. Tray.ai masks authentication values in logs, so the secret never shows up in a step's input or output.

### Going from the BTCPay Server API docs to a working call

Translating an example request from API docs into a workflow step means copying the method, URL, headers, and body by hand.

**How Tray.ai helps:** Paste a cURL example from the BTCPay Server API docs into the HTTP Connector and Tray.ai fills in the method, URL, headers, and body for you.

### Handling files and non-JSON responses

Not every API answers in JSON. Some return XML, files, or binary data, or expect a multipart upload.

**How Tray.ai helps:** The HTTP Connector parses JSON and XML responses, returns files you can pass to the next step, and sends multipart form data for uploads.

## Frequently asked questions

### Does Tray.ai connect to BTCPay Server?

Yes. Tray.ai connects to BTCPay Server through the HTTP Connector, which calls the BTCPay Server API directly. Any call the BTCPay Server API documents can run as a step in a Tray.ai workflow.

### How does Tray.ai authenticate with BTCPay Server?

The BTCPay Server API uses an API key in a request header and basic authentication. You save it once as a Tray.ai authentication, and the HTTP Connector adds it to every request.

### Can I get a dedicated BTCPay Server connector?

BTCPay Server runs through the HTTP Connector rather than a dedicated connector. If your team wants one, the Tray.ai connector SDK can build a dedicated BTCPay Server connector from the BTCPay Server API.

## Learn more

- Intelligent Integration: https://tray.ai/platform/intelligent-ipaas/
- Merlin Agent Builder: https://tray.ai/platform/merlin-agent-builder/
- Agent Gateway for MCP: https://tray.ai/platform/agent-gateway/
- Book a demo: https://tray.ai/contact/
