> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rach.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Customers & deposit addresses

> Give each of your customers static USDT and USDC deposit addresses on Ethereum, Base, BNB Chain, Polygon, TRON and Solana, and credit them from one webhook.

A **customer** is one of your own users, named by your own reference (`customer_ref`). Rach
gives each customer static deposit addresses on every chain enabled for your account and tells
you, by webhook, every time one of them receives USDT or USDC. You credit your customer from
that webhook.

Your customers never need a phone number, a seed phrase or gas. Rach holds the keys, pays the
network fees, and acts on the wallets only on your instructions.

| Chain | Address | Tokens |
| - | - | - |
| Ethereum, Base, BNB Chain, Polygon | One smart-wallet address, **the same on all four** | USDT, USDC (Base: USDC) |
| TRON | Its own `T…` address | USDT |
| Solana | Its own address, with USDT and USDC token accounts already created | USDT, USDC |

> [!NOTE]
>
> The addresses never change. Show them to your customer once and they stay valid. Send only the
> listed tokens to them: anything else is not credited.

## Create a customer

```bash theme={null}
curl -X POST https://api.rach.finance/caas/v1/customers \
  -H "X-API-Key: $RACH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer_ref": "cus_8f2a91"}'
```

```json theme={null}
{
  "customer_ref": "cus_8f2a91",
  "customer_id": "c4b1…9e",
  "status": "PROVISIONED",
  "addresses": [
    { "chain": "polygon",  "chain_id": 137,  "address": "0x8a3f…41", "tokens": ["USDT", "USDC"], "status": "READY" },
    { "chain": "base",     "chain_id": 8453, "address": "0x8a3f…41", "tokens": ["USDC"],         "status": "READY" },
    { "chain": "ethereum", "chain_id": 1,    "address": "0x8a3f…41", "tokens": ["USDT", "USDC"], "status": "READY" },
    { "chain": "bsc",      "chain_id": 56,   "address": "0x8a3f…41", "tokens": ["USDT", "USDC"], "status": "READY" },
    { "chain": "tron",                       "address": "TQ5d…Xh",  "tokens": ["USDT"],         "status": "READY" },
    { "chain": "solana",                     "address": "7EqQ…eK",  "tokens": ["USDT", "USDC"], "status": "READY" }
  ],
  "created_at": "2026-11-21T09:00:00Z"
}
```

* `customer_ref` is yours: up to 128 printable characters, unique within your account.
* **It is idempotent.** Calling again with the same reference returns the same addresses with
  `status: "ALREADY_EXISTS"`. Retry freely after a timeout.
* `customer_id` is Rach's identity for the customer. Webhooks carry both.
* `GET /v1/customers/{customer_ref}` returns the same response without creating anything.

Each address has its own `status`:

| Status | Meaning |
| - | - |
| `READY` | Give it to your customer. |
| `PENDING` | Solana only: the address exists, but its token accounts are still being created. Call again before showing it. |
| `NOT_PROVISIONED` | Only from `GET`: this chain was enabled after the customer was created. `POST` again to add it. |
| `UNAVAILABLE` | The chain could not be reached just now. `POST` again shortly; nothing is duplicated. |

Only chains enabled for your account are listed. [`GET /health/ready`](https://docs.rach.finance/api-reference/caas-introduction)
shows each chain's state.

## Get told about every deposit

Register a webhook in your **CaaS dashboard → Developers**. Every confirmed deposit to any of
your customers' addresses, on any chain, arrives as `transfer.received`:

```json theme={null}
{
  "event": "transfer.received",
  "event_id": "transfer.received:b5ecb7ac-…",
  "transfer_id": "b5ecb7ac-…",
  "customer_ref": "cus_8f2a91",
  "customer_id": "c4b1…9e",
  "chain": "tron",
  "recipient_wallet": "TQ5d…Xh",
  "amount": "250.000000",
  "amount_usdc": "250.000000",
  "token": "USDT",
  "tx_hash": "a9e3…",
  "tx_id": "a9e3…",
  "network": "mainnet",
  "settled_at": "2026-11-21T09:04:12Z"
}
```

Credit your customer when it arrives:

1. **Verify** the `X-Rach-Signature` header (HMAC-SHA256 of the raw body with your webhook
   secret; see [Webhooks](https://docs.rach.finance/guides/webhooks.md#caas-webhooks)).
2. **Deduplicate** on `event_id` (also sent as the `X-Rach-Event-Id` header). A retried delivery
   carries the same ID. Credit it once.
3. **Credit** `amount` of `token` to the customer named by `customer_ref`. `chain` (plus
   `chain_id` on EVM chains) tells you where it landed.
4. Answer `2xx` quickly and do the rest asynchronously.

> [!WARNING]
>
> Use `amount` and `token`. `amount_usdc` exists only for older integrations and does not mean the
> deposit was USDC.

Deposits are reported once the chain has confirmed them. TRON waits for solidified blocks and
Solana for finalized slots. Swap output and refunds that land in a customer's own address also
arrive as `transfer.received`, so this one event is your only signal to credit.

## Balances

```bash theme={null}
# One customer, every chain
curl https://api.rach.finance/caas/v1/customers/cus_8f2a91/balances -H "X-API-Key: $RACH_API_KEY"

# Everything you hold, per chain and token (add ?include=customers for each customer's share)
curl https://api.rach.finance/caas/v1/balances -H "X-API-Key: $RACH_API_KEY"
```

```json theme={null}
{
  "as_of": "2026-11-21T09:10:00Z",
  "totals": [
    { "chain": "tron", "token": "USDT", "total": "48210.500000", "pending_payouts": "1200.000000",
      "available": "47010.500000", "customers_with_balance": 312 }
  ]
}
```

Balances are read from the chains themselves and refreshed at most once a minute.
`pending_payouts` is what queued [payouts](https://docs.rach.finance/guides/caas-payouts.md) will still take, and
`available` is what is left after them. If some wallets could not be read, the response
carries `"partial": true`. Your own ledger stays the record of what each customer is owed;
use these numbers to reconcile against it.

## Next

* [Payouts, sweeps & balances](https://docs.rach.finance/guides/caas-payouts.md): send customers' funds to outside addresses.
* [Payout keys & signing](https://docs.rach.finance/guides/caas-payout-signing.md): the key your servers sign payouts with.
* [Stablecoin swaps](https://docs.rach.finance/guides/caas-swaps.md): USDT ↔ USDC on one chain or across chains.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.