# For fintech apps

Offer BTC to your customers from your own backend. You hold the balances and the signing keys, sign on your servers, and reconcile Maxy orders like any other ledger entry. For neobanks, brokerages and payment apps that run their own custody and compliance.

## What to build

1. **Keep the key on your server.** Your secret key lives in your server's secret store and never reaches an app. Rotate it with `POST /keys/rotate`, deploy the new one, then revoke the old one: [Keys and limits](https://maxy.co/docs/keys-and-limits).
2. **Quote for each customer.** `GET /quote` from your server, with the paying wallet as `fromAddress` and the customer's Bitcoin address as `toAddress`: [Get a quote](https://maxy.co/docs/buy-btc#get-a-quote). Check the address first with `GET /addresses/validate`.
3. **Sign with your own key system.** Each signature step carries `typedData` and its EIP-712 `hash`. Sign the hash with your HSM, KMS or MPC signer, or sign the typed data with a library and compare hashes: [Sign](https://maxy.co/docs/buy-btc#sign).
4. **Tag every order.** Send your own `externalId` and `externalCustomerId` on `POST /orders`. Maxy stores them as given, and every list, webhook and statement carries them.
5. **Post to your ledger from webhooks.** One signed `order.updated` event per change. Process each event `id` once, and order them by `sequence`: [Webhooks](https://maxy.co/docs/webhooks).
6. **Close each month.** Export the month and join on `orderId`: [Reconcile](https://maxy.co/docs/order-states#reconcile).

## Tag and find orders

The ids you send come back on every read, and `GET /orders` filters by them. The sample uses the setup from [Get a quote](https://maxy.co/docs/buy-btc#get-a-quote). It signs every signature step: the witness, and a permit when the allowance is short (Pay with USDC).

```sh
curl -s -G "$BASE/quote" -H "x-maxy-key: $MAXY_API_KEY" --data-urlencode "from=USDC on base" -d to=BTC -d amount=20 \
  -d fromAddress="$WALLET" -d toAddress="$MY_BTC_ADDRESS" > quote.json
SIGS='{}'
for ID in $(jq -r '.steps[] | select(.kind == "signature") | .id' quote.json); do
  SIG=$(cast wallet sign --private-key "$TEST_WALLET_KEY" --data "$(jq -c --arg id "$ID" '.steps[] | select(.id == $id) | .typedData' quote.json)")
  SIGS=$(echo "$SIGS" | jq -c --arg id "$ID" --arg sig "$SIG" '. + {($id): $sig}')
done
curl -s -X POST "$BASE/orders" -H "x-maxy-key: $MAXY_API_KEY" -H "content-type: application/json" \
  -d "$(jq -c --argjson sigs "$SIGS" '{order: .order, signatures: $sigs, externalId: "txn-88231", externalCustomerId: "cust-4410"}' quote.json)" | jq -c '{orderId, submitted}'
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/orders?externalCustomerId=cust-4410" | jq -c '.orders[] | {orderId, state, externalId}'
```

## Statements

A month as a statement: each order, and totals by state and route, for your keys in one environment. It is a record of orders, not an invoice. `BASE` and `KEY` are as on [Get a price](https://maxy.co/docs/buy-btc#get-a-price).

```sh
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/statements?month=2026-11" | jq '.totals'
curl -s -H "x-maxy-key: $MAXY_API_KEY" "$BASE/statements?month=2026-11&format=csv" > statement-2026-11.csv
```

```ts
const statement = await fetch(`${BASE}/statements?month=2026-11`, { headers: { 'x-maxy-key': KEY } }).then((r) => r.json());
console.log(statement.totals); // { orders, completed, refunded, open, failed, completedSats, byRoute }
```

```python
statement = requests.get(f"{BASE}/statements", params={"month": "2026-11"}, headers={"x-maxy-key": KEY}).json()
print(statement["totals"])  # orders, completed, refunded, open, failed, completedSats, byRoute
```

`format=pdf` gives the same month as a PDF. `GET /orders?format=csv` gives up to 1,000 orders in one file. An order stays listed for 30 days after it ends, so export monthly.

## What stays with you

Maxy holds no user funds, performs no identity checks, and screens the addresses in every order. Your onboarding and identity checks, any further screening your policy requires, your customers' records and your terms with them stay with you: [Compliance](https://maxy.co/docs/security-and-compliance#compliance). Your support team needs the [support script](https://maxy.co/docs/when-it-fails#support-script).

## Selling for your customers

The same backend can sell BTC for a stablecoin or the chain's own coin. The payout is locked in the settler before your BTC moves; pay one output of exactly `sats`, on time: [Sell BTC](https://maxy.co/docs/sell-btc).

---
Source: https://maxy.co/docs/for-fintech-apps (Maxy Docs › Maxy for your app › Use cases)
