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

# Auto-conversion credentials

> Accept deposits in one currency and settle them into a wallet in a different currency, automatically.

Wallet credentials can accept deposits in a currency that differs from the wallet's own — arriving deposits are automatically converted into the wallet's currency at the FX rate live at conversion time. Two directions:

* **Auto-onramp** — a fiat credential on a crypto wallet. The payer sends fiat; the wallet is credited in crypto.
* **Auto-offramp** — a crypto credential on a fiat wallet. The payer sends crypto; the wallet is credited in fiat.

Same-currency credentials — where the credential currency matches the wallet's currency — remain the default and credit the wallet balance directly, with no conversion.

## Create a cross-currency credential

Pass an explicit `currency` on [`POST /v1/wallets/:id/credentials`](https://docs.globalstack.io/api-reference/wallets/create-a-wallet-credential) that is different from the wallet's currency. Currency codes are uppercase (`NGN`, `USDC`, `GHS`, `USDT`, `KES`, …).

```bash Auto-onramp (NGN on USDC wallet) theme={null}
curl https://api.globalstack.io/v1/wallets/wal_01HXYZABC1234567890ABCDEFG/credentials \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "bank",
    "currency": "NGN"
  }'
```

```bash Auto-offramp (USDC on NGN wallet) theme={null}
curl https://api.globalstack.io/v1/wallets/wal_01HXYZDEF9876543210ZYXWVUT/credentials \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "base",
    "currency": "USDC"
  }'
```

`network` is validated against the **credential's own** currency, not the wallet's. So an `NGN` credential uses `bank`; a `USDC` credential uses `base` / `ethereum` / `solana`.

## Eligibility

Cross-currency is admitted only when **every** condition below holds. Any failure returns a `400` with `invalid_input`.

* The pair must be **crypto ↔ fiat**. Crypto ↔ crypto and fiat ↔ fiat are rejected.
* **Both** currencies must advertise the matching direction capability:
  * Auto-onramp requires `can_onramp` on the credential currency and on the wallet currency.
  * Auto-offramp requires `can_offramp` on both.
* The credential currency must resolve to a supported currency row. An unknown code returns `404` `not_found`.

> [!NOTE]
>
> The set of currencies that support `can_onramp` / `can_offramp` is fixed by Global Stack. If your wallet's currency isn't eligible for a given direction, cross-currency provisioning will fail — reach out to support to confirm coverage.

## Minimum conversion amount

Every corridor has a minimum convertible amount (see [Transaction limits](https://docs.globalstack.io/essentials/limits.md)), and a conversion is only quoted once the
credential's balance clears it. Below that, the deposit is still recorded and you are still
notified — it simply has no converted value yet, and its funds wait on the credential for the next
deposit.

Conversions are sized from the **credential's whole available balance**, not from the deposit that
triggered them. So two 3,000 NGN deposits into a credential with a 4,500 NGN minimum convert
together as one 6,000 NGN conversion when the second arrives. Nothing is lost and nothing needs
chasing; small deposits accumulate until they are worth converting.

> [!NOTE]
>
> You can read the minimum for a corridor from `GET /v1/currencies`: it is
> `networks[].inbound.min` on the **credential's** currency, for the credential's `network`. The
> amount compared against it is the credential's available balance, which includes anything left
> over from earlier deposits — not the single deposit you just received.

A deposit that was not converted on arrival carries `metadata.conversion_pending_reason`:

| Reason | What it means | What to do |
| - | - | - |
| `below_minimum` | The credential's balance is under the corridor minimum. `metadata.conversion_minimum` carries the floor that was applied. | Nothing. The next deposit converts both. |
| `fx_rejected` | The amount was refused by the FX provider as outside the corridor's limits. | Nothing automatic is pending; if the balance never clears, contact support. |
| `deferred` | The conversion could not be attempted at that moment — another deposit on the same credential was mid-conversion, or the attempt timed out. | Nothing. The next deposit sweeps the balance. |

The deposit that finally triggers the conversion carries the **whole aggregated amount** as its
`destination_amount`, which can be larger than its own `source_amount`.
`metadata.converted_source_amount` tells you how much was actually converted.

> [!WARNING]
>
> Because the aggregate lands on one deposit, **do not sum `destination_amount` across deposits** to
> reconcile a credential. The deposits folded into an aggregate carry `null`, and the triggering
> one carries the total. Reconcile against the `conversion.*` events, which are one-per-conversion.

## Deposit lifecycle

A cross-currency deposit usually tells you twice: once when the money arrives, and again as the
conversion moves. The arrival event waits for the FX quote where there is one, so it can tell you
what the deposit is worth in your wallet's currency — the number you actually care about. Where the
balance is under the corridor minimum there is no quote to wait for, and the arrival event carries
no converted value.

| Event | When it fires | Meaning |
| - | - | - |
| `deposit.received` | Payer's funds arrived and a rate was quoted | The deposit is recorded, with `destination_amount` in your wallet's currency. |
| `deposit.received` (no amount) | Funds arrived but the balance is under the corridor minimum | The deposit is recorded with a `null` `destination_amount` and a `metadata.conversion_pending_reason`. See [Minimum conversion amount](#minimum-conversion-amount). No `conversion.*` events follow until a later deposit converts the balance. |
| `deposit.held` | Arrival breached your customer's money-in limit | The deposit is parked pending review. No conversion is quoted yet, so there is no `destination_amount`. |
| `conversion.created` | Conversion registered against the deposit | Rate is locked. |
| `conversion.funds_received` | The source funds have been received | The FX-side settlement leg is queued. |
| `conversion.processing` | Conversion is executing | Money is moving through the FX rails. |
| `conversion.success` | Conversion settled | The **wallet balance** has been credited in the wallet's currency. |
| `conversion.failed` | Conversion did not settle | Funds are parked on the credential balance until Global Stack drains it (see [Recovery on failure](#recovery-on-failure)). |
| `conversion.returned` | Conversion reversed after success | Same "funds parked, contact support" recovery as `conversion.failed`. |

### What `deposit.received` carries

The event body is the transaction resource — the same shape as
[`GET /v1/transactions/{transactionId}`](https://docs.globalstack.io/api-reference/transactions/get-a-transaction) — with `source_*` in the
credential's currency and `destination_*` in your wallet's currency:

```json theme={null}
{
  "event_type": "deposit.received",
  "event_object": {
    "id": "txn_01KPBG1Q3Z8X1Q6VJRE5R8ZFBG",
    "type": "deposit",
    "status": "received",
    "source_amount": "10000.00",
    "source_currency": "NGN",
    "destination_amount": "6.046600",
    "destination_currency": "USDC",
    "metadata": {
      "auto_conversion": "true",
      "quote_id": "quo_01HXYZABC1234567890ABCDEFG",
      "rate": "0.000605",
      "converted_source_amount": "10000.00"
    },
    "deposit_timestamp": "2026-04-22T02:01:29.000Z",
    "wallet": { "id": "wal_…", "currency": "USDC", "label": "Treasury USDC" },
    "customer": { "id": "cust_…", "type": "business", "name": "Acme Ltd" },
    "credential": {
      "id": "wcr_…",
      "currency": "NGN",
      "network": "bank",
      "details": {
        "accountName": "Acme Ltd",
        "accountNumber": "1234567890",
        "bankName": "Wema Bank",
        "bankCode": "035"
      }
    }
  }
}
```

The `wallet`, `customer` and `credential` blocks tell you which credential was funded without a
second API call — useful when you hand out one virtual account per customer. They appear only on
cross-currency deposit events.

> [!WARNING]
>
> `destination_amount` is the **quoted** amount, not the settled one. It reflects the rate at
> deposit time; the amount that actually lands is `actual_destination_amount` on
> `conversion.success`. Reconcile against the conversion, not the deposit.

`converted_source_amount` is how much the quote actually converted. It equals `source_amount` on a
deposit that converted on its own, and exceeds it when the conversion swept residue from earlier
deposits.

A deposit that was **not** converted carries the same shape with no converted value:

```json theme={null}
{
  "event_type": "deposit.received",
  "event_object": {
    "id": "txn_01KPBG1Q3Z8X1Q6VJRE5R8ZFBH",
    "type": "deposit",
    "status": "received",
    "source_amount": "3000.00",
    "source_currency": "NGN",
    "destination_amount": null,
    "destination_currency": "USDC",
    "metadata": {
      "auto_conversion": "true",
      "conversion_pending_reason": "below_minimum",
      "conversion_minimum": "4500.00"
    },
    "deposit_timestamp": "2026-04-22T02:01:29.000Z"
  }
}
```

> [!NOTE]
>
> A cross-currency deposit never reaches a terminal `deposit.*` state. It stays at `received` for
> its whole life, and the `conversion.*` topics carry the outcome — do not wait for
> `deposit.confirmed` or `deposit.failed` on this path. Subscribe to both the `deposit` and
> `conversion` categories to see the full lifecycle.

### Held deposits

If an arriving deposit breaches the customer's rolling money-in limit, you get `deposit.held`
instead, with `metadata.hold_reason` set to `tier_limit` and a null `destination_amount` — no
conversion is quoted while the deposit is under review. When Global Stack releases it, the
conversion runs at the **then-current rate** and you receive `deposit.received` carrying the
quoted amount, followed by the usual `conversion.*` sequence. A released deposit is subject to the
same [minimum](#minimum-conversion-amount): if the balance is under the floor at release, the
`deposit.received` you receive carries a `conversion_pending_reason` instead of an amount.

### Same-currency credentials

Same-currency credentials keep the original lifecycle: `deposit.received` on arrival,
`deposit.held` if a tier gate applies, then `deposit.confirmed` when the credit settles (or
`deposit.failed` if it does not). Their payloads do not carry the `wallet`, `customer` and
`credential` blocks, and their `destination_amount` equals `source_amount` — there is no
conversion.

## Fees

Auto-conversion fees follow the FX conversion contract: the destination amount is **net of fees**, and the fee breakdown is on the `conversion.*` webhook payloads. See [failure reasons](https://docs.globalstack.io/reference/failure-reasons.md) for the codes surfaced on a failed conversion.

## Recovery on failure

If `conversion.failed` (or `conversion.returned`) fires, funds stay on the credential's own balance. There is no auto-retry of the failed conversion — FX failures are typically structural, not transient — but the parked funds are **not stranded**: because conversions are sized from the credential's whole available balance, the next deposit into that credential converts the leftover along with itself, at the then-current rate.

If no further deposit is expected, contact Global Stack support to drain the parked funds; ops will run a fresh conversion at the then-current rate. Once the drain lands, the wallet balance is credited and the credential balance clears.

> [!WARNING]
>
> There is no merchant-facing "retry" or "refund" endpoint in v1. Recovery goes through Global Stack support.

## When to use auto-conversion

Reach for auto-conversion when your payers want to pay in a familiar local currency but your treasury runs in a different one — the classic example is accepting NGN bank deposits into a USDC treasury without a manual conversion step per deposit. If your payers already hold funds in the same currency as your wallet, stick with same-currency credentials: they credit the wallet directly with no FX exposure.


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