---
title: "Wallet & funding"
description: "Fund your MXN wallet by SPEI, card or OXXO and track each payment."
---

The wallet (monedero) holds your balance in Mexican pesos. Buying a label debits the quoted price. Choose an amount to fund by SPEI, card or OXXO.

## Endpoints

| Method | Path | Description |
| --- | --- | --- |
| `GET` | `/v1/wallet/funding-instructions` | Get your CLABE |
| `POST` | `/v1/wallet/fund/card` | Start a card funding |
| `POST` | `/v1/wallet/fund/spei` | Request a bank-transfer payment |
| `POST` | `/v1/wallet/fund/oxxo` | Generate a cash voucher (OXXO) |
| `GET` | `/v1/wallet/fund/:paymentIntentId/status` | Payment status |
| `GET` | `/v1/wallet/balance` | Current balance |
| `GET` | `/v1/wallet/summary` | Income/expenses/net summary for a period |
| `GET` | `/v1/wallet/transactions` | Transaction history |
| `GET` | `/v1/wallet/events` | Live events over SSE (`WALLET_CREDITED`, `USAGE_ALERT`; with JWT accepts `?livemode=false`) |
| `PATCH` | `/v1/wallet/settings` | Set the low-balance threshold (ADMIN+) |
| `POST` | `/v1/wallet/test/reset` | Reset the test balance (dashboard session only) |

## Fund by SPEI

SPEI is Mexico’s bank transfer network. Create a payment for the amount you want to add. Save its ID.

Use a LIVE session with an OPERATOR or higher role, or a LIVE key with the `wallet:write` scope. In TEST, replenish the virtual balance from the dashboard.

| Prop | Type | Default | Description |
| - | - | - | - |
| `amount` | `number` | - | Amount in MXN, from 200 to 50,000. |

```bash
curl -X POST https://api.sendit.mx/v1/wallet/fund/spei \
  -H "X-API-Key: sk_live_..." \
  -H "Idempotency-Key: 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 500 }'
```

```json
{
  "success": true,
  "data": {
    "paymentIntentId": "pi_spei_example",
    "status": "requires_action",
    "amount": 500,
    "currency": "MXN",
    "instructions": {
      "amountRemaining": "500.00",
      "reference": null,
      "hostedInstructionsUrl": null,
      "clabe": "646000000000000000",
      "bankName": "STP",
      "bankCode": "646"
    }
  }
}
```

Transfer `instructions.amountRemaining` to the supplied CLABE (bank account number). Include the reference if supplied. The instructions and their fields can be `null`. Check payment status before transferring if details are missing.

If you transfer MXN 300.00 toward a MXN 500.00 payment, MXN 200.00 remains. The wallet credit posts after full collection. Check `GET /v1/wallet/fund/:paymentIntentId/status` until `walletCredited` is `true`.

Use `GET /v1/wallet/funding-instructions` to read previously issued bank details. Create a new payment for each top-up.

| Code | When it happens | How to resolve it |
| --- | --- | --- |
| `400 LIVE_MODE_REQUIRED` | Request in TEST | Use the virtual balance or switch to LIVE |
| `400 INVALID_INPUT` | Amount outside the supported range | Send between MXN 200 and 50,000 |
| `403` | Missing permission | Use an operator or grant the required scope |

## Fund with a card

```bash
curl -X POST https://api.sendit.mx/v1/wallet/fund/card \
  -H "Authorization: Bearer <jwt>" \
  -H "Idempotency-Key: 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 500 }'
```

```json
{
  "success": true,
  "data": {
    "paymentIntentId": "pi_3QyAbc123xyz",
    "clientSecret": "pi_3QyAbc123xyz_secret_def456",
    "amount": 500,
    "currency": "MXN",
    "publishableKey": "pk_test_xxxxx"
  }
}
```

### Body parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `amount` | `number` | - | Amount to fund in MXN. Minimum $200, maximum $50,000 per operation. |

Use the `clientSecret` with Stripe.js on your frontend to collect the card and complete 3D Secure. Once confirmed, the wallet is credited automatically.

### Check the payment status

```text
GET /v1/wallet/fund/pi_3QyAbc123xyz/status
```

```json
{
  "success": true,
  "data": {
    "paymentIntentId": "pi_3QyAbc123xyz",
    "status": "succeeded",
    "amount": 500,
    "currency": "MXN",
    "paymentMethodType": "card",
    "walletCredited": true
  }
}
```

When `status` is `succeeded` and `walletCredited` is `true`, the balance already reflects the funding.

:::note
The `Idempotency-Key` header is optional but **recommended** on funding calls. With it, retries reuse the same payment intent and there are never two charges. See [Idempotency](/en/api-conventions/idempotency).
:::

## Fund with OXXO (cash)

To pay in cash, use `POST /v1/wallet/fund/oxxo`. It generates a **voucher with a barcode**: show or print it and pay at any OXXO store. The voucher expires in 3 days. The wallet is credited once OXXO confirms payment, so treat it as pending until then. Check it through `/v1/wallet/fund/:paymentIntentId/status`.

### Body parameters

| Prop | Type | Default | Description |
| - | - | - | - |
| `amount` | `number` | - | Amount to fund in MXN. Minimum $200, maximum $10,000, the OXXO voucher cap. |

```bash
curl -X POST https://api.sendit.mx/v1/wallet/fund/oxxo \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 500 }'
```

```json
{
  "success": true,
  "data": {
    "paymentIntentId": "pi_3Oxxo123xyz",
    "hostedVoucherUrl": "https://payments.stripe.com/oxxo/voucher/...",
    "expiresAfter": 1800000000,
    "amount": 500,
    "currency": "MXN"
  }
}
```

`hostedVoucherUrl` is the printable voucher. `expiresAfter` is a Unix timestamp in seconds. The balance updates after the cash payment clears. Until then the transaction stays pending.

If the voucher expires unpaid, the wallet does not move — there is nothing to reverse — and SendIt emails the organization owner. To try again, generate a new voucher.

## Check your balance

```text
GET /v1/wallet/balance
```

```json
{
  "success": true,
  "data": {
    "id": "clxwallet123",
    "balance": "1500.00",
    "promotionalBalance": "15.00",
    "currency": "MXN",
    "lowBalanceThreshold": "100.00",
    "lowBalanceAlertSent": false,
    "hasFundingSource": true
  }
}
```


`promotionalBalance` is the part of `balance` that comes from extra balance on SPEI top-ups (Growth and Scale plans). It is spent after the rest of your balance and is not refundable. In test mode it is `"0.00"`.

Amounts are decimal strings. Never do floating-point arithmetic on money.

With a `sk_test_` key this endpoint returns the **test balance**. See [Test mode](/en/getting-started/test-mode).

### Set the low-balance alert

`PATCH /v1/wallet/settings` sets the balance at which you want a warning. It requires the ADMIN role or higher, and the `wallet:write` scope if you use an API key.

```bash
curl -X PATCH https://api.sendit.mx/v1/wallet/settings \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "lowBalanceThreshold": 500 }'
```

Send `null` to turn the alert off.

## Movements summary

For "income vs. expenses" cards without paging through every transaction, `GET /v1/wallet/summary` aggregates the window you ask for. Both date params are optional (`from` inclusive, `to` exclusive):

```text
GET /v1/wallet/summary?from=2026-07-01&to=2026-08-01
```

```json
{
  "success": true,
  "data": {
    "income": "1050.00",
    "expenses": "730.50",
    "net": "314.50",
    "adjustments": "-5.00",
    "transactionCount": 7,
    "currency": "MXN",
    "byType": {
      "CREDIT": { "count": 2, "amount": "1000.00" },
      "REFUND": { "count": 1, "amount": "50.00" },
      "DEBIT": { "count": 3, "amount": "-730.50" },
      "ADJUSTMENT": { "count": 1, "amount": "-5.00" }
    }
  }
}
```

`income` sums credits and refunds. `expenses` is the magnitude of the debits, which are stored negative. All amounts are decimal strings.

The summary respects the mode of the request. With `?livemode=false` it aggregates test movements.

## Review your transactions

```text
GET /v1/wallet/transactions?type=CREDIT&page=1&limit=20
```

```json
{
  "success": true,
  "data": [
    {
      "id": "clxtx_spei_456",
      "type": "CREDIT",
      "amount": "1000.00",
      "currency": "MXN",
      "balanceAfter": "2500.00",
      "description": "Depósito vía transferencia bancaria SPEI",
      "referenceType": "stripe_payment_intent",
      "referenceId": "pi_spei_example",
      "metadata": { "funding_method": "spei" },
      "status": "COMPLETED",
      "createdAt": "2026-07-17T10:00:00.000Z"
    },
    {
      "id": "clxtx_label_789",
      "type": "DEBIT",
      "amount": "-326.82",
      "currency": "MXN",
      "balanceAfter": "1500.00",
      "description": "Compra de guía DHL Express Nacional",
      "referenceType": "label_purchase",
      "referenceId": "clxq1w2e3r4t5y6u7i8o9p0a",
      "metadata": { "carrierCode": "DHL" },
      "status": "COMPLETED",
      "createdAt": "2026-07-17T09:00:00.000Z"
    }
  ],
  "meta": { "page": 1, "limit": 20, "total": 143, "totalPages": 8 }
}
```

| Parameter | Values |
| --- | --- |
| `type` | `CREDIT`, `DEBIT`, `REFUND`, `ADJUSTMENT`, `PROMOTION` |
| `referenceType` | `stripe_payment_intent` (SPEI, card or OXXO), `label_purchase`, `label_purchase_refund`, `label_void_refund`, `promotion` |
| `page` | Page number. Default 1 |
| `limit` | Items per page. Default 20, maximum 100 |
| `sortOrder` | `asc` or `desc`. Default `desc` |

Read `metadata.funding_method` to distinguish `spei`, `card` and `oxxo`. Earlier transfers can have the `stripe_bank_transfer` reference type.

Every transaction carries `balanceAfter`. The history is a complete, auditable statement.

## Handle errors

| Code | When it happens | How to resolve it |
| --- | --- | --- |
| `400 INVALID_INPUT` | The amount or parameters are invalid | Correct the request and try again |
| `400 LIVE_MODE_REQUIRED` | You tried to fund or check a payment in TEST mode | Switch to a LIVE session or key |
| `402 INSUFFICIENT_BALANCE` | An operation needs more than the available balance | Fund the wallet |
