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

# Deposits

> Collect inside your own app. For each payment we give you a wallet address or a bank account to show your customer, and a webhook when the money arrives.

## Crypto deposits

Ask for an address on the network and token your customer will pay with. Each address is for one payment.

```bash cURL theme={null}
curl -X POST "https://api.pay.flipeet.io/api/v1/merchant/transactions/crypto/initialize" \
  -H "x-api-key: $FLIPEET_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "network": "base",
  "asset": "usdc",
  "amount": 100,
  "reference": "inv_2201",
  "metadata": {
    "customerId": "cus_77"
  }
}'
```

```javascript Node.js theme={null}
const response = await fetch("https://api.pay.flipeet.io/api/v1/merchant/transactions/crypto/initialize", {
  method: "POST",
  headers: {
    "x-api-key": process.env.FLIPEET_SECRET_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "network": "base",
    "asset": "usdc",
    "amount": 100,
    "reference": "inv_2201",
    "metadata": {
      "customerId": "cus_77"
    }
  }),
});
const { data } = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.post(
    "https://api.pay.flipeet.io/api/v1/merchant/transactions/crypto/initialize",
    headers={"x-api-key": os.environ["FLIPEET_SECRET_KEY"]},
    json={
        "network": "base",
        "asset": "usdc",
        "amount": 100,
        "reference": "inv_2201",
        "metadata": {
            "customerId": "cus_77"
        }
    },
)
data = response.json()["data"]
```

```json Response theme={null}
{
  "message": "Crypto transaction initialized",
  "status": "success",
  "statusCode": 201,
  "data": {
    "reference": "inv_2201",
    "type": "crypto",
    "network": "base",
    "asset": "usdc",
    "address": "0x3c5b0e8d1f6a4b2c9e7d0a1b2c3d4e5f60718293",
    "expectedAmount": 100,
    "status": "pending",
    "livemode": true
  }
}
```

Show the `address`, the network and the token.

> [!WARNING]
>
> Funds sent in a different token, or on a different network, may not be recoverable. Say clearly which ones you accept.

When the transfer confirms, we add what arrived to your balance, less fees, and send `transaction.crypto.completed`:

```json transaction.crypto.completed theme={null}
{
  "event": "transaction.crypto.completed",
  "reference": "inv_2201",
  "status": "completed",
  "currency": "usdc",
  "network": "base",
  "address": "0x3c5b0e8d1f6a4b2c9e7d0a1b2c3d4e5f60718293",
  "grossAmount": 100,
  "feeAmount": 0.6,
  "amount": 99.4,
  "txHash": "0x77aa3f0c9b1e2d4f6a8c0e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c5e7b19be",
  "metadata": { "customerId": "cus_77" },
  "livemode": true
}
```

| Field | Meaning |
| - | - |
| `grossAmount` | What the customer sent |
| `feeAmount` | Fees taken |
| `amount` | What was added to your balance |
| `metadata` | Your own data, as you sent it |

## Bank deposits

Your customer pays local currency by bank transfer, and you're settled in stablecoin. The response includes the account to pay into:

```bash cURL theme={null}
curl -X POST "https://api.pay.flipeet.io/api/v1/merchant/transactions/fiat/initialize" \
  -H "x-api-key: $FLIPEET_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 150000,
  "currency": "NGN",
  "reference": "inv_2202"
}'
```

```javascript Node.js theme={null}
const response = await fetch("https://api.pay.flipeet.io/api/v1/merchant/transactions/fiat/initialize", {
  method: "POST",
  headers: {
    "x-api-key": process.env.FLIPEET_SECRET_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "amount": 150000,
    "currency": "NGN",
    "reference": "inv_2202"
  }),
});
const { data } = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.post(
    "https://api.pay.flipeet.io/api/v1/merchant/transactions/fiat/initialize",
    headers={"x-api-key": os.environ["FLIPEET_SECRET_KEY"]},
    json={
        "amount": 150000,
        "currency": "NGN",
        "reference": "inv_2202"
    },
)
data = response.json()["data"]
```

Show `deposit.bank_name`, `deposit.account_number`, `deposit.account_name` and the exact amount. When the transfer clears you get `transaction.fiat.completed` with `fiatAmount`, `grossAmount`, `feeAmount` and `amount`. If it fails or expires, you get `transaction.fiat.failed`.

## Check a deposit

Look a deposit up by your reference, or [list them](https://docs.flipeet.io/api-reference/deposits/list-deposits.md) to reconcile with your own records.

```bash cURL theme={null}
curl "https://api.pay.flipeet.io/api/v1/merchant/transactions/inv_2201" \
  -H "x-api-key: $FLIPEET_SECRET_KEY"
```

```javascript Node.js theme={null}
const response = await fetch("https://api.pay.flipeet.io/api/v1/merchant/transactions/inv_2201", {
  method: "GET",
  headers: {
    "x-api-key": process.env.FLIPEET_SECRET_KEY,
  },
});
const { data } = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.get(
    "https://api.pay.flipeet.io/api/v1/merchant/transactions/inv_2201",
    headers={"x-api-key": os.environ["FLIPEET_SECRET_KEY"]},
)
data = response.json()["data"]
```

> [!NOTE]
>
> A reference can only be used once. If a request times out, send it again with the same reference: you either get the payment or `409`, never a second one. See [Retries](https://docs.flipeet.io/retries.md).


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