# Nora API - Full Docs Dump
---
## Source: integrate/addresses.mdx
---
title: Addresses
description: BRS token, protocol and governance contract addresses on Solana, Ethereum, Base, Polygon and Optimism, in production and sandbox.
---
{/* Generated by `pnpm gen:addresses` from src/lib/brs-contracts.ts. Edit the catalog, not this file. */}
Every address links to its block explorer. The same address on any other
chain is not Nora's BRS. The sandbox and production EVM addresses share
their first six and last four characters, so an abbreviated `0x0000…B125`
is the same for both: compare the full string.
##
Solana [#solana]
### Production [#solana-production]
| Name | Address |
| --- | --- |
| **BRS mint**
SPL token, 6 decimals | [`BRSxQRUaGswjLs7ewcH7uXj3r7SgmfKSSLLXyCKHZtUo`](https://solscan.io/token/BRSxQRUaGswjLs7ewcH7uXj3r7SgmfKSSLLXyCKHZtUo) |
| **Cuiaba program**
Mints, burns and enforces wallet whitelisting | [`noRAkuzHAdMjsbj2P9gNPMm94hui54NLkBDXe6uasVt`](https://solscan.io/account/noRAkuzHAdMjsbj2P9gNPMm94hui54NLkBDXe6uasVt) |
| **BRS OFT program**
LayerZero OFT that bridges BRS to and from Ethereum, Base and Polygon | [`oftBRWDv3cK6DSei44HnwBABHYynNTTQSEkFqTjUh2e`](https://solscan.io/account/oftBRWDv3cK6DSei44HnwBABHYynNTTQSEkFqTjUh2e) |
| **OFT Store**
LayerZero peer account; holds the bridge configuration | [`LzSyZHztuuHBcgLwQNX5ViYTdeeb6p7iMRYJjjesjVr`](https://solscan.io/account/LzSyZHztuuHBcgLwQNX5ViYTdeeb6p7iMRYJjjesjVr) |
| **OFT escrow**
Token account the OFT SDK takes as tokenEscrow | [`FJSzLfUH8UzKAPNqnjeWNAC4jYPvX49L74Y2Jubc9GtF`](https://solscan.io/account/FJSzLfUH8UzKAPNqnjeWNAC4jYPvX49L74Y2Jubc9GtF) |
| **Program admin (Squads vault)**
Upgrade authority of the Cuiaba and OFT programs | [`AnPh3ST2XagcAZ1S8B1zgxxzFmEhEXAoVSnv3Xqx1Mfh`](https://solscan.io/account/AnPh3ST2XagcAZ1S8B1zgxxzFmEhEXAoVSnv3Xqx1Mfh) |
### Sandbox [#solana-sandbox]
| Name | Address |
| --- | --- |
| **BRS mint**
SPL token, 6 decimals | [`BRS2CELW6Cueo2mrMUVvAr5GDT7Pw8TeostC2JLMpBk4`](https://solscan.io/token/BRS2CELW6Cueo2mrMUVvAr5GDT7Pw8TeostC2JLMpBk4?cluster=devnet) |
| **Cuiaba program**
Mints, burns and enforces wallet whitelisting | [`9fBSeVHUCaHHUzkktiRp5Yn35emxx3S1ERzn7oHsi8je`](https://solscan.io/account/9fBSeVHUCaHHUzkktiRp5Yn35emxx3S1ERzn7oHsi8je?cluster=devnet) |
| **BRS OFT program**
LayerZero OFT that bridges BRS to and from the EVM testnets | [`oftBRfLxPyov8qXmf7gZa8b76idqg2zXfUiEe6KE5tN`](https://solscan.io/account/oftBRfLxPyov8qXmf7gZa8b76idqg2zXfUiEe6KE5tN?cluster=devnet) |
| **OFT Store**
LayerZero peer account; holds the bridge configuration | [`LzSoZB3hNwzR4cV3JrXoCNW3hgsqKCLJ7RZBh2Rzach`](https://solscan.io/account/LzSoZB3hNwzR4cV3JrXoCNW3hgsqKCLJ7RZBh2Rzach?cluster=devnet) |
| **OFT escrow**
Token account the OFT SDK takes as tokenEscrow | [`4t5jfe6f23SGcrkoMqGhTgLZLeRzQTN2H2hoWwSccodi`](https://solscan.io/account/4t5jfe6f23SGcrkoMqGhTgLZLeRzQTN2H2hoWwSccodi?cluster=devnet) |
| **Program admin**
Upgrade authority of the Cuiaba program | [`nora7ZTxmDrLdVheVazpsthHFB8u3JzgHeyh9foTZWC`](https://solscan.io/account/nora7ZTxmDrLdVheVazpsthHFB8u3JzgHeyh9foTZWC?cluster=devnet) |
##
Ethereum [#ethereum]
### Production [#ethereum-production]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000006238e3C7797Ae71827da303560bae1B125`](https://etherscan.io/token/0x0000006238e3C7797Ae71827da303560bae1B125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xbbBbb2883992E3562Ad19d80219341c0413Eb125`](https://etherscan.io/address/0xbbBbb2883992E3562Ad19d80219341c0413Eb125) |
| **Governance Safe (3-of-5)**
Owns the token and the beacon | [`0xaAAaAFeEd42dFC6384249758271bEF2e8324b125`](https://etherscan.io/address/0xaAAaAFeEd42dFC6384249758271bEF2e8324b125) |
### Sandbox [#ethereum-sandbox]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000884179F857221EFC49C21BCb94af93CEB125`](https://sepolia.etherscan.io/token/0x0000884179F857221EFC49C21BCb94af93CEB125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xBEaCdef77497bb13F9c30084157e6B5e2214b125`](https://sepolia.etherscan.io/address/0xBEaCdef77497bb13F9c30084157e6B5e2214b125) |
| **Governance Safe**
Owns the token and the beacon | [`0xf33B9A5E4Dc0AFcbdF561C5695e913D407A4502B`](https://sepolia.etherscan.io/address/0xf33B9A5E4Dc0AFcbdF561C5695e913D407A4502B) |
##
Base [#base]
### Production [#base-production]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000006238e3C7797Ae71827da303560bae1B125`](https://basescan.org/token/0x0000006238e3C7797Ae71827da303560bae1B125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xbbBbb2883992E3562Ad19d80219341c0413Eb125`](https://basescan.org/address/0xbbBbb2883992E3562Ad19d80219341c0413Eb125) |
| **Governance Safe (3-of-5)**
Owns the token and the beacon | [`0xaAAaAFeEd42dFC6384249758271bEF2e8324b125`](https://basescan.org/address/0xaAAaAFeEd42dFC6384249758271bEF2e8324b125) |
### Sandbox [#base-sandbox]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000884179F857221EFC49C21BCb94af93CEB125`](https://sepolia.basescan.org/token/0x0000884179F857221EFC49C21BCb94af93CEB125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xBEaCdef77497bb13F9c30084157e6B5e2214b125`](https://sepolia.basescan.org/address/0xBEaCdef77497bb13F9c30084157e6B5e2214b125) |
| **Governance Safe**
Owns the token and the beacon | [`0xf33B9A5E4Dc0AFcbdF561C5695e913D407A4502B`](https://sepolia.basescan.org/address/0xf33B9A5E4Dc0AFcbdF561C5695e913D407A4502B) |
##
Polygon [#polygon]
### Production [#polygon-production]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000006238e3C7797Ae71827da303560bae1B125`](https://polygonscan.com/token/0x0000006238e3C7797Ae71827da303560bae1B125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xbbBbb2883992E3562Ad19d80219341c0413Eb125`](https://polygonscan.com/address/0xbbBbb2883992E3562Ad19d80219341c0413Eb125) |
| **Governance Safe (3-of-5)**
Owns the token and the beacon | [`0xaAAaAFeEd42dFC6384249758271bEF2e8324b125`](https://polygonscan.com/address/0xaAAaAFeEd42dFC6384249758271bEF2e8324b125) |
### Sandbox [#polygon-sandbox]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000884179F857221EFC49C21BCb94af93CEB125`](https://amoy.polygonscan.com/token/0x0000884179F857221EFC49C21BCb94af93CEB125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xBEaCdef77497bb13F9c30084157e6B5e2214b125`](https://amoy.polygonscan.com/address/0xBEaCdef77497bb13F9c30084157e6B5e2214b125) |
| **Governance Safe**
Owns the token and the beacon | [`0xf33B9A5E4Dc0AFcbdF561C5695e913D407A4502B`](https://amoy.polygonscan.com/address/0xf33B9A5E4Dc0AFcbdF561C5695e913D407A4502B) |
##
Optimism [#optimism]
### Production [#optimism-production]
| Name | Address |
| --- | --- |
| **BRS**
Upgradeable ERC-20 proxy, 6 decimals | [`0x0000006238e3C7797Ae71827da303560bae1B125`](https://optimistic.etherscan.io/token/0x0000006238e3C7797Ae71827da303560bae1B125) |
| **BRSWhitelister beacon**
Beacon every partner whitelister proxies to | [`0xbbBbb2883992E3562Ad19d80219341c0413Eb125`](https://optimistic.etherscan.io/address/0xbbBbb2883992E3562Ad19d80219341c0413Eb125) |
| **Governance Safe (3-of-5)**
Owns the token and the beacon | [`0xaAAaAFeEd42dFC6384249758271bEF2e8324b125`](https://optimistic.etherscan.io/address/0xaAAaAFeEd42dFC6384249758271bEF2e8324b125) |
---
## Source: integrate/api-reference/index.mdx
---
title: API Reference
description: Endpoint-by-endpoint reference for the Nora /v2 API.
---
The Nora `/v2` API is a JSON-over-HTTPS REST API. The public surface includes
**intents** (onramp, offramp, prepare-burn, approve-burn) and **wallets** (registration and
on-chain whitelist activation).
## Base URLs
| Environment | Base URL |
|--------------|---------------------------------------|
| Sandbox | `https://sandbox.api.nora.finance` |
| Production | `https://api.nora.finance` |
## Authentication
Every request sends a single header:
```
X-API-Key: sk_test_...
```
Keys bind to `(organization, instance)` — no other auth header is needed.
See [Authentication](/integrate/core-concepts/authentication).
## Response envelope
**Success:** the resource shape directly (no `data` wrapper).
```json
{ "id": "…", "status": "active" }
```
**Failure:** `/v2` endpoints return JSON errors. The exact shape varies
by endpoint family:
- `/v2/intents/*` returns `{ code: string, message: string, details?: object }`.
- `/v2/wallets/*` returns `{ code: string, message: string, details?: object }`.
Wallet-specific machine codes appear in `details.code`, for example
`TRANSACTION_EXPIRED` and `SYNC_PROOF_REQUIRED`.
- Structural validation failures on any route use the validator shape
`{ data, error: [{ code, path, message }], success: false }` instead — see
[Errors](/integrate/getting-started/errors).
See [Error handling](/integrate/core-concepts/error-handling) for
the full taxonomy.
## Idempotency
`POST /v2/intents/onramp` and `POST /v2/intents/offramp` accept an
`idempotency-key` header (UUID). `POST /v2/wallets` and
`POST /v2/wallets/:id/submit` require the header. Successful same-key,
same-body replays return the original operation: intent replays expose its
current state, while wallet replays return the stored result. An onramp
retry can return `503` again while payment instructions remain unavailable.
Offramps with an explicit `clientReference` return `409` on retry. Page
through `GET /v2/intents?intentType=offramp` using `limit` and `offset`, and
match `clientReference` in the returned items; no `clientReference` filter
exists. A different body with the same key returns `409`. See
[Idempotency](/integrate/core-concepts/idempotency).
`POST /v2/intents/:id/approve-burn` is the exception — no header is sent;
it accepts one burn proof per intent, and a repeat answers `400`.
## Versioning
`/v2` is the current stable surface. Breaking changes ship under a new
version prefix; no silent changes to existing endpoints.
## Resources
- [Intents](/integrate/api-reference/intents) — onramp, offramp, prepare-burn, approve-burn, fetch, list.
- [Wallets](/integrate/api-reference/wallets) — register minter wallets, prepare or submit grants, and verify on-chain state.
---
## Source: integrate/api-reference/intents.mdx
---
title: Intents
description: Create onramp / offramp intents, fetch and list them, prepare and approve the burn for offramps.
---
Intents are the state-tracked transactions between your end-users' fiat
and on-chain balances. Two flavours: **onramp** (fiat → crypto) and
**offramp** (crypto → fiat). Offramps additionally require an on-chain
burn from the token holder's wallet, prepared with `prepare-burn` and
reported back to Nora via `approve-burn`.
`chainId` accepts `"solana"`, `"ethereum"`, or `"base"`. Base is live in both environments (sandbox = Base Sepolia, production = Base mainnet). It also accepts `"polygon"`, live in both environments (sandbox = Polygon Amoy, production = Polygon mainnet).
## Error envelope
All intents endpoints return errors in the intents-family shape:
```json
{
"code": "BAD_REQUEST",
"message": "evm_destination_wallet_not_authorized",
"details": { }
}
```
`code` and `message` are present on every non-2xx response except
structural validation failures, which come back as
`{ "data": …, "error": [{ "code", "path", "message" }], "success": false }`
(for example `amountCents` below the minimum). `details` is optional and
endpoint-specific. See
[Error handling](/integrate/core-concepts/error-handling).
## The intent response shape
Create (`200`/`201`), fetch (`200`), and the items inside list
(`200`) all return the same intent object:
| Field | Type | Notes |
|---|---|---|
| `id` | string (uuid) | |
| `instanceId` | string (uuid) | |
| `intentType` | `"onramp"` \| `"offramp"` | |
| `flowVersion` | integer | Pin on at least the version your code was written against. |
| `status` | see status enum | |
| `scheduledFor` | string \| omitted | ISO 8601. Present only while an offramp is `scheduled`. It is the earliest time payout processing can start, not a completion guarantee. |
| `statusReason` | string \| null | Human-readable status context. |
| `failureCode` | enum \| null | Machine-readable failure class for supported failures. |
| `providerFailureCode` | string \| null | Raw provider rejection code, when available. |
| `originalFailureCode` | enum \| null | Initial failure class when a later failed event changes `failureCode`. |
| `originalProviderFailureCode` | string \| null | Raw provider code for the initial failure. |
| `clientReference` | string \| null | Echoed from your body. |
| `metadata` | object \| null | |
| `expiresAt` | string \| null | ISO 8601. |
| `createdAt` | string | ISO 8601. |
| `updatedAt` | string | |
| `pixPayment` | object \| null | Payable onramp instructions. `null` on offramps and outside `awaiting_fiat_payment`; automatic instructions are also hidden when unavailable, expired, or payment is recorded, including payment under review. See [creation recovery](#onramp-creation-recovery). |
| `depositInstructions` | null | Always `null` in the current `/v2` response. |
| `party` | object \| null | The party behind the intent: `displayName`, `documentMasked`, and `solanaWallet` (the party's bound Solana wallet, `null` when it has none). |
| `chainId` | `"solana"` \| `"ethereum"` \| `"base"` \| `"polygon"` | The chain the intent settles on. |
`pixPayment` when present:
| Field | Type | Notes |
|---|---|---|
| `brcode` | string | Complete PIX BR Code: static for manual settlement, provider-generated charge instructions for automatic settlement. Render or pay the returned value unchanged. An embedded key, amount tag `54`, and fixed layout are not guaranteed across modes. |
| `txid` | string | Transaction ID. |
| `amountCents` | integer | Payment amount in BRL cents. Use this field rather than assuming the BR Code contains the amount. |
| `expiresAt` | string \| null | Instruction deadline in ISO 8601 when supplied. Can precede the intent deadline; do not present expired instructions. `null` means no instruction deadline is supplied in this field. |
### Status enum
`created`, `requires_compliance`, `awaiting_fiat_payment`,
`fiat_received`, `minting`, `awaiting_onchain_transfer`,
`awaiting_burn_approval`, `burn_approved`, `onchain_received`,
`burning`, `scheduled`, `paying_out`, `completed`, `expired`, `canceled`, `failed`,
`refunding`, `refunded`.
## POST /v2/intents/onramp
Create an onramp intent. Successful creation of a payable intent includes
`pixPayment` in the same response. The request fields stay the same for
manual and automatic settlement. Your payment service provider (PSP) must support the returned
payment instrument; see [payment modes and validation](/integrate/flows/onramp-intent#render-the-pix-instructions).
### Headers
| Header | Required | Notes |
|------------------|----------|--------------------------------------------------------|
| `X-API-Key` | Yes | |
| `Content-Type` | Yes | `application/json` |
| `idempotency-key`| Recommended | UUID (format-validated). One key per user intent; reuse across retries. |
### Request body
| Field | Type | Required | Description |
|---------------------|---------|----------|---------------------------------------------------------------------|
| `amountCents` | integer | Yes | BRL amount in cents. Must be ≥ 500 (R$5.00 = 5 BRS minimum). |
| `destinationWallet` | string | Yes | Solana address, or a whitelisted Ethereum address (1–255 chars). |
| `chainId` | string | Yes | `"solana"`, `"ethereum"`, `"base"`, or `"polygon"`. |
| `clientReference` | string | No | Up to 255 chars. Echoed on the intent. Unique per environment, forever, across both intent types; defaults to the `idempotency-key`. |
### Response 200 / 201
The intent response shape above, including the QR instructions while
payable. Same-key replays return the original intent's current state;
paid or closed intents can return `pixPayment: null`.
Rarely, a new creation also returns `201` with `pixPayment: null` when the
automatic charge is paid before the response. Track that original intent
instead of creating another charge.
### Onramp creation recovery
Creation waits for persisted payment instructions within a bounded budget.
If instructions remain unavailable or the wait expires, the API returns
`503` in the intents error envelope. A new automatic intent that fails,
is canceled, or expires before creation responds also returns `503`.
The response identifies the original intent in `details.intentId`.
A timed-out wait also includes `details.outcome: "indeterminate"`:
```json
{
"code": "SERVICE_UNAVAILABLE",
"message": "Payment instructions are not ready. Recover the original intent before creating another.",
"details": {
"intentId": "8f2a...",
"outcome": "indeterminate"
}
}
```
The error does not prove that creation failed or that no charge exists.
Recovery can continue after the response or a client disconnect.
Keep the original intent ID and request body. Choose the recovery path
based on the original request:
- With an `idempotency-key`, retry creation with that same key and body.
While the original intent remains payable, the retry waits for its
original instructions. It can return `503` again; use backoff and keep
the original key and body.
- Without an `idempotency-key`, use `GET /v2/intents/:id` with
`details.intentId` to recover it. Do not repeat creation.
A timeout does not authorize a replacement charge or a switch to manual
settlement. Normal successful creation returns the QR in `200`/`201`;
there is no normal `202` flow requiring a separate QR retrieval step.
See [Idempotency](/integrate/core-concepts/idempotency#onramp-creation-after-a-timeout).
### Example
Generate and persist one key per user order. In Bash or Zsh:
```bash
ORDER_KEY=$(uuidgen)
```
For fish, use this key-generation command instead:
```fish
set -l ORDER_KEY (uuidgen)
```
Use the stored key for creation and every retry. Do not regenerate it when
retrying the same order. The request below works in Bash, Zsh and fish.
```bash
curl -X POST https://sandbox.api.nora.finance/v2/intents/onramp \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-H "idempotency-key: $ORDER_KEY" \
-d '{
"amountCents": 10000,
"destinationWallet": "So11111111111111111111111111111111111111112",
"chainId": "solana",
"clientReference": "ord_123"
}'
```
### Errors
- `400` — body validation (negative amount, missing field, address format), or on Ethereum the on-chain check of your whitelister: `evm_destination_wallet_not_authorized` (no authorization for `destinationWallet`), `evm_destination_wallet_rate_limit_exceeded` (daily limit below `amountCents`), `evm_mint_amount_below_minimum` / `evm_mint_amount_above_maximum` (outside the BRS token's per-mint bounds).
- `409` — idempotency-key collision with a different body, or a `clientReference` that already exists in this environment (`Intent with clientReference 'ord_123' already exists`); references are unique forever, expired intents included.
- `503` - payment instructions unavailable or creation wait exceeded. Recover the original intent as described [above](#onramp-creation-recovery).
## POST /v2/intents/offramp
Create an offramp intent. Once created, call `prepare-burn` — Nora
issues an attested burn authorization for the token holder — then have
the holder burn on-chain and report the proof via `approve-burn`
(`txSignature` on Solana, `txHash` on Ethereum). See
[Burn signing](/integrate/flows/burn-signing).
### Headers
| Header | Required | Notes |
|------------------|----------|--------------------------------------------------------|
| `X-API-Key` | Yes | |
| `Content-Type` | Yes | `application/json` |
| `idempotency-key`| Recommended | UUID (format-validated). |
### Request body
| Field | Type | Required | Description |
|----------------------|---------|----------|---------------------------------------------------------------------|
| `amountCents` | integer | Yes | BRL payout amount in cents. Must be ≥ 500 (R$5.00 = 5 BRS minimum). |
| `destinationAddress` | string | Yes | PIX key on your organization's Pix-key list: your own CNPJ, an email, a `+55` phone or an EVP key. CPF and other companies' CNPJs are rejected. |
| `chainId` | string | Yes | `"solana"`, `"ethereum"`, `"base"`, or `"polygon"`. |
| `clientReference` | string | No | Up to 255 chars. Unique per environment, forever, across both intent types; defaults to the `idempotency-key`. |
### Response 200 / 201
The intent response shape above. `pixPayment` is `null` on offramps and
`depositInstructions` is always `null`.
### Example
```bash
curl -X POST https://sandbox.api.nora.finance/v2/intents/offramp \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-H "idempotency-key: $(uuidgen)" \
-d '{
"amountCents": 10000,
"destinationAddress": "user@example.com",
"chainId": "solana",
"clientReference": "payout_xyz_42"
}'
```
### Errors
- `400` — body validation; a key not on your Pix-key list (`The Pix key attempting to receive the offramp is not whitelisted by the organization.`); a CNPJ key that is not your own (`destinationAddress must equal the organization CNPJ for CNPJ-typed Pix keys.`).
- `409` — idempotency-key collision, or a `clientReference` that already exists in this environment (`Intent with clientReference 'payout_xyz_42' already exists`). Offramp replays a retry only when no `clientReference` is sent; with one, every retry gets this 409, so page through `GET /v2/intents?intentType=offramp` and match `clientReference` (no filter exists for it).
## GET /v2/intents/:id
Fetch a single intent by id.
### Path parameters
| Param | Type | Required |
|-------|---------------|----------|
| `id` | string (uuid) | Yes |
### Headers
| Header | Required |
|-------------|----------|
| `X-API-Key` | Yes |
### Response 200
The intent response shape above.
### Errors
- `404` — no intent with that id in this org/instance.
## GET /v2/intents
List intents — filterable and paginated with `limit` / `offset`.
### Headers
| Header | Required |
|-------------|----------|
| `X-API-Key` | Yes |
### Query parameters
| Parameter | Type | Default | Description |
|--------------|--------|---------|------------------------------------------------------------------|
| `intentType` | string | `"all"` | `"onramp"`, `"offramp"`, or `"all"`. |
| `status` | string | `"all"` | Any intent status (see enum above) or `"all"`. |
| `limit` | number | `50` | 1–100. |
| `offset` | number | `0` | Zero-based. |
### Response 200
```json
{
"intents": [
{ "id": "…", "status": "…", "…": "…" }
],
"total": 42,
"limit": 50,
"offset": 0
}
```
Pagination is **offset-based** (not cursor-based). The key is `intents`
(plural), not `items`. `total` is the full match count for the
filter.
## POST /v2/intents/:id/prepare-burn
Issue the burn authorization for an offramp intent in
`awaiting_burn_approval`.
### Request body
| Field | Type | Required | Description |
|---------------|--------|----------|-------------------------------------------------------------------|
| `tokenHolder` | string | Yes | The wallet that holds the BRS and will burn. Base58 on Solana, `0x` on Ethereum, 1–255 chars; the wrong family is a `400`. |
### Response 200
- Solana: always `{ "status": "preparing" }`. The unsigned `user_burn`
transaction appears at `metadata.userBurnTransaction` on the intent.
- Ethereum: `{ "status": "preparing" }` until the authorization is issued,
then `{ "status": "ready", "burn": { chainRef, from, to, data, amountMinor, expiresAt } }`
on every later call while it is live. `from` is the only address that may
send the call. `expiresAt` is earlier than the intent's own `expiresAt`, so
the holder can still burn and you can still approve inside the intent's
window. A lapsed authorization is not replaced: by then the intent is too
close to its own expiry for a new one, so the call keeps answering
`preparing`. Create a new offramp intent only if no burn was broadcast;
a broadcast burn's hash is still accepted by `approve-burn` until the
intent expires. If a fresh intent behaves the same way, stop and
contact Nora with the intent id.
### Errors
- `400` — the intent is not `awaiting_burn_approval`, the address family does
not match the intent's chain, `amountCents` is below the minimum, or
(Ethereum) a different `tokenHolder` while an authorization is still live.
On Solana a different `tokenHolder` while a grant is live is **not**
rejected: the call answers `preparing` and the first holder stays bound;
compare `metadata.burnTokenHolder` with the holder you asked for before
handing out the staged transaction.
- `400` (Solana only) — `burn_wallet_not_authorized` (the holder is not a
registered mint/burn wallet of your organization), `token_holder_not_authorized`
(not whitelisted on-chain; `details.tokenHolder` carries the address), or
`Intent expires too soon to prepare a burn. Create a new intent and prepare the burn on it.`
- `404` — intent not found.
## POST /v2/intents/:id/approve-burn
Submit the proof of the on-chain burn for an offramp intent.
### Path parameters
| Param | Type | Required |
|-------|---------------|----------|
| `id` | string (uuid) | Yes |
### Headers
| Header | Required | Notes |
|---------------|----------|--------------------|
| `X-API-Key` | Yes | |
| `Content-Type`| Yes | `application/json` |
> No separate `idempotency-key` header. One proof per intent: after a
> successful call the intent is `burn_approved` and a repeat answers `400`.
### Request body
| Field | Type | Required | Description |
|---------------|--------|----------|----------------------------------------------------------|
| `txSignature` | string | Solana | Base58 signature of the broadcast `user_burn` transaction. |
| `txHash` | string | Ethereum | `0x` plus 64 hex characters: the hash of the transaction that carried the burn. |
| `tokenHolder` | string | Yes | The same address passed to `prepare-burn`. Base58 on Solana (the wallet owner, not the ATA), `0x` on Ethereum. |
Use the proof field of the intent's chain. The other chain's field name is
tolerated and means the same field, but the value must be well-formed for
the intent's chain (base58 signature on Solana, `0x` 32-byte hash on
Ethereum); otherwise `400`. Sending both is allowed only when they are
identical.
### Response 200
```json
{ "status": "burn_approved" }
```
Single field — no intent echo. Re-fetch `GET /v2/intents/:id` to
observe subsequent transitions.
### Errors
- `400` — body validation, a proof that is not well formed for the intent's chain, or the intent is no longer `awaiting_burn_approval`.
- `404` — intent not found.
On both chains the proof is accepted after a format check and verified in
the background; a proof that does not land or does not match fails the
intent later with a `statusReason` naming the cause — see
[Burn signing](/integrate/flows/burn-signing).
---
## Source: integrate/api-reference/wallets.mdx
---
title: Wallets
description: Register and manage whitelisted minter wallets on Solana, Ethereum, Base and Polygon. You sign every grant. Nora does not sign routine grants.
---
A wallet needs an on-chain whitelist grant before it can receive mints or
burn BRS in your flows. This surface registers **minter** wallets for your
organization and activates their grant. The server fixes the role to
`minter`; the request schema has no role field. You register whitelister
wallets on the [dashboard](/dashboard/wallets), not through this API.
`chainId` accepts `"solana"` (the default), `"ethereum"`, `"base"` or `"polygon"`; every chain is live in both environments (see [BRS token](/integrate/core-concepts/brs-token)). The solana and
EVM (ethereum, base, polygon) arms share every path and every response shape, and differ in
three fields: who signs, what you send to `submit`, and whether a
`limitMinor` applies. Each section below marks the difference.
## Signing model
You sign every grant. Nora does not sign routine grants and does not hold
the signing key.
**solana.** Your **whitelister wallet** signs the grant transaction. It also
pays the rent and the fee. Two paths complete a registration:
- **Prepared**: Nora returns an unsigned transaction. You sign it with your
whitelister and return it via `submit`.
- **Self-built**: you build and broadcast your own `whitelist` transaction.
Then you call `sync` with the `txSignature` as authorship proof.
**ethereum.** The signing contract is your organization's own BRSWhitelister,
provisioned by Nora. There is **no** `whitelisterWallet` request field — Nora
resolves the contract server-side. Nora returns `wallet.calldata` and
`transaction` is `null`; the contract's **owner wallet** (reported as
`calldata.signerWallet`) signs and broadcasts that call, and you return the
resulting `txHash` via `submit`.
See the [wallet whitelisting flow](/integrate/flows/wallet-whitelisting)
for the full sequence.
## Daily limits (ethereum)
`limitMinor` is a **daily limit in BRL cents** — the same unit as
`amountCents` on intents. `100000` is R$1.000,00. It is **not** token units;
Nora scales it to the token's own decimals at the chain boundary, and every
response reports cents back.
The whitelister contract clamps the requested value to your organization's
on-chain ceiling. **A clamp is a success, not an error.** The wallet becomes
`active` with the effective (lower) `limitMinor` and a `statusReason` such as:
```
limit_clamped: requested 200000000, effective 100000000 (the whitelister's on-chain ceiling)
```
Once a wallet is `active`, **its `limitMinor` cannot be changed through any
`/v2` endpoint.** `prepare` returns `200` with `calldata: null` — a silent
no-op, not an error. Raising or lowering an active wallet's limit requires
Nora support.
## Wallet states
| State | Meaning |
|---|---|
| `pending` | Registered. The grant is not yet proven on-chain. |
| `active` | The grant was confirmed and proven. It passes intent preflights only when `reconciliationStatus` is `synced`. |
| `revoked` / `banned` | The grant is gone or the address is barred. On ethereum a `revoked` wallet can be repaired through this API — see below. |
`statusReason: "awaiting_sync_proof"` marks a pending wallet with observed
on-chain state and no authorship proof. Call `sync` with the grant's
`txSignature` to activate it. (solana only — on ethereum the contract state
is the proof, so `sync` needs nothing in the body.)
**Revocation is not instant on ethereum.** If the authorization is zeroed
out-of-band, the first `sync` reports `outcome: "not_on_chain"` while `state`
stays `active`. The row flips to `revoked` only once the zero is confirmed at
the chain's confirmation depth (a few blocks; the exact depth per environment is an operational setting).
**A `revoked` ethereum wallet can be repaired.** `POST /v2/wallets/:id/prepare`
issues fresh **positive** calldata for the last limit the wallet requested,
and `submit` returns it to `active`. No re-registration is needed.
## Response schemas
### Wallet
| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | Yes | Nora wallet-registration ID. |
| `address` | string | Yes | Base58 on solana, `0x`-prefixed on ethereum. |
| `chainId` | `"solana"` \| `"ethereum"` \| `"base"` \| `"polygon"` | Yes | Chain for this registration. |
| `role` | `"minter"` \| `"whitelister"` \| `"buyer"` \| `"buyerAndMinter"` \| `"admin"` | Yes | The API creates only `minter` rows. Other roles are read-only. |
| `label` | string \| null | Yes | Partner-defined label. |
| `state` | `"pending"` \| `"active"` \| `"revoked"` \| `"banned"` | Yes | Current registration state. |
| `statusReason` | string \| null | Yes | Diagnostic for a pending registration or an on-chain drift. It can include `"awaiting_sync_proof"`, `"awaiting_onchain_confirmation"`, `"address_unavailable"`, `"not_on_chain"`, or (ethereum) `"limit_clamped: …"`. |
| `reconciliationStatus` | `"synced"` \| `"missing_onchain"` \| `"drifted"` | Yes | Agreement between the row and on-chain state. |
| `whitelisterWallet` | string \| null | Yes | The wallet that signs the grant. Your whitelister on solana; the whitelister contract's owner on ethereum. |
| `limitMinor` | integer \| null | Yes | Effective, already-clamped daily limit in **BRL cents**. Always `null` on solana. |
| `calldata` | Calldata \| null | Yes | The EVM call still awaiting your broadcast. Always `null` on solana, and `null` on ethereum when there is nothing left to sign. |
| `createdAt` | string | Yes | ISO 8601 creation time. |
| `updatedAt` | string | Yes | ISO 8601 last-update time. |
### Operation
| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string (uuid) | Yes | Operation ID. |
| `operationType` | `"grant"` \| `"regrant"` \| `"accept_onchain"` \| `"revoke"` \| `"ban"` \| `"repair"` | Yes | Action represented by this operation. |
| `status` | `"prepared"` \| `"linked_existing"` \| `"submitted"` \| `"confirmed"` \| `"failed"` \| `"expired"` | Yes | Current operation state. |
| `txSignature` | string \| null | Yes | Broadcast transaction signature, when available. |
| `errorMessage` | string \| null | Yes | Failure diagnostic, when available. |
| `createdAt` | string | Yes | ISO 8601 creation time. |
| `updatedAt` | string | Yes | ISO 8601 last-update time. |
### Transaction (solana)
`transaction` is the solana preparation. It is **always `null` on ethereum** —
the EVM preparation lives at `wallet.calldata` instead. `transaction` is also
`null` when the wallet has no current preparation.
| Field | Type | Required | Description |
|---|---|---|---|
| `unsignedTransaction` | string | Yes | Base64-encoded Solana transaction. |
| `blockhash` | string | Yes | Recent blockhash used by the preparation. |
| `lastValidBlockHeight` | integer | Yes | Last block height at which the transaction is valid. |
| `expiresAt` | string | Yes | ISO 8601 expiration time. |
| `signerWallet` | string | Yes | Bound whitelister and transaction fee payer. |
| `instruction` | Instruction \| null | Yes | Decomposed grant instruction for transaction composition. `null` when the stored preparation is not decodable. |
`Instruction` has these fields:
| Field | Type | Required | Description |
|---|---|---|---|
| `programId` | string | Yes | Solana program address. |
| `keys` | InstructionKey[] | Yes | Ordered instruction accounts. |
| `data` | string | Yes | Base64-encoded instruction data. |
Each `InstructionKey` has `pubkey` (string), `isSigner` (boolean), and
`isWritable` (boolean). Preserve the array order when you build a transaction.
### Calldata (ethereum)
`wallet.calldata` is the EVM sibling of `transaction`: the exact call you send
from `signerWallet`. It is `null` on solana, and `null` on ethereum whenever
there is nothing left to sign (including on an `active` wallet).
| Field | Type | Required | Description |
|---|---|---|---|
| `to` | string | Yes | Your organization's BRSWhitelister contract. |
| `data` | string | Yes | ABI-encoded call data, `0x`-prefixed. |
| `chainRef` | string | Yes | CAIP-2 ref of the chain the call is valid on — `"ethereum"` alone cannot say Sepolia vs mainnet. |
| `signerWallet` | string | Yes | The only wallet that may send it: the whitelister contract's owner. Nora does not hold this key. |
| `limitMinor` | integer | Yes | The **requested** daily limit in BRL cents, before the on-chain clamp. |
| `expiresAt` | string | Yes | ISO 8601. The window is 24 hours. Past it, `submit` returns `410` and you call `prepare` again. |
### Idempotency flags
Create and submit responses include two booleans:
- `linkedExisting` is `true` when Nora finds a proven on-chain grant and
activates the wallet without a new broadcast.
- `replayed` is `true` when Nora returns the stored response for the same
`Idempotency-Key` and request body. It is `false` for the first execution.
## GET /v2/wallets
List your registered wallets. Whitelister rows appear read-only.
The list returns only `minter` and `whitelister` rows. A detail request can
also return a legacy read-only role.
| Query | Type | Notes |
|---|---|---|
| `state` | enum | `pending` \| `active` \| `revoked` \| `banned` |
| `role` | enum | `minter` \| `whitelister` |
### Response 200
`{ wallets: Wallet[] }`
## GET /v2/wallets/:id
Wallet detail.
### Response 200
`{ wallet: Wallet, transaction: Transaction | null, operations: Operation[] }`
`transaction` holds the current preparation (`unsignedTransaction`,
`blockhash`, `lastValidBlockHeight`, `expiresAt`, `signerWallet`,
`instruction`) or `null`. `instruction` is the decomposed grant instruction
(`programId`, `keys`, `data` in base64) for partners who compose their own
transaction. `operations` contains at most 25 records, newest first. Poll
this endpoint to observe state transitions; do not use it as an audit-history
feed.
## POST /v2/wallets
Register a minter wallet. The response stages the grant you must sign.
### Headers
| Header | Required | Notes |
|---|---|---|
| `X-API-Key` | Yes | |
| `Idempotency-Key` | Yes | UUID. The same key with a different payload returns `409`. |
| `Content-Type` | Yes | `application/json` |
### Request body — solana
| Field | Type | Required | Description |
|---|---|---|---|
| `address` | string | Yes | Base58 wallet to whitelist as minter. |
| `whitelisterWallet` | string | Yes | Your active whitelister. It signs the grant. |
| `chainId` | `"solana"` | No | Default `"solana"`. |
| `label` | string | No | Up to 64 characters. |
### Request body — ethereum
| Field | Type | Required | Description |
|---|---|---|---|
| `chainId` | `"ethereum"` \| `"base"` \| `"polygon"` | Yes | Required here — it is the discriminator that picks this arm, so it has no default. |
| `address` | string | Yes | `0x`-prefixed wallet to whitelist as minter. |
| `limitMinor` | integer | Yes | Requested daily limit in **BRL cents**. `100000` is R$1.000,00. Positive integer. |
| `label` | string | No | Up to 64 characters. |
This body is strict. There is **no `whitelisterWallet`** on the ethereum arm —
Nora resolves your organization's whitelister contract server-side, and
sending the field returns `400`. If no contract is provisioned for your
organization yet, the call returns `409` with `details.code` of
`WHITELISTER_NOT_PROVISIONED`.
### Response 200 / 201
`{ wallet: Wallet, operation: Operation | null, transaction: Transaction | null, linkedExisting: boolean, replayed: boolean }`
**solana.** When `transaction` is present, `transaction.unsignedTransaction`
is base64. Its `feePayer` is your whitelister. `transaction.instruction`
carries the same grant decomposed (`programId`, `keys`, `data`) for your own
composition.
**ethereum / base / polygon.** `transaction` is always `null`. When a grant
is needed it is at `wallet.calldata` — send it from `calldata.signerWallet` on
the network `calldata.chainRef` names, then call `submit` with the `txHash`
you get back.
**solana.** If a proven grant already exists on-chain at create time, the
wallet activates without a broadcast, there is nothing to sign, and
`linkedExisting` is `true`.
**The EVM create path reads the chain.** If your whitelister does not yet
authorize the address, the wallet comes back `pending` with `wallet.calldata`.
If it already authorizes it, the wallet comes back `active` at the on-chain
limit with `calldata: null` — there is nothing to sign and nothing to submit.
Branch on `wallet.calldata`: `null` means the wallet is already whitelisted
and you are done; an object means send it and then call `submit`.
## POST /v2/wallets/:id/prepare
Return the current preparation, or a fresh one after the old one expired.
The bound signer never changes.
**solana.** Returns the same preparation, including its decomposed
`instruction`, while `blockHeight` is at or below `lastValidBlockHeight`. It
generates a new one only after expiry.
**ethereum.** Returns the same `wallet.calldata` while its 24-hour window is
open, and re-prepares it — same requested limit, same signer — once the window
closed or a `submit` failed. Two cases return `calldata: null`:
- The wallet is **`active`**. There is nothing left to sign, and this route
cannot change an active wallet's limit. `200`, not an error.
- A grant is already live on-chain. Nora adopts it and `activated` is `true`.
A **`revoked`** wallet re-prepares fresh **positive** calldata for the last
limit it requested — submit it and the wallet returns to `active`.
If the wallet has no recorded limit to re-prepare from, the call returns `409`
with `details.code` of `LIMIT_REQUIRED`: re-register the address with a
`limitMinor`.
### Response 200
`{ wallet: Wallet, transaction: Transaction | null, activated: boolean }`
On solana, `transaction` is `null` when Nora observes an on-chain grant; if
`activated` is `false`, call `sync` with the grant transaction signature to
provide authorship proof.
## POST /v2/wallets/:id/submit
Complete the grant. Requires `Idempotency-Key`, with the same rules as create.
Send the field your wallet's chain uses — the other one returns `400` naming
the expected field.
### Request body — solana
| Field | Type | Required | Description |
|---|---|---|---|
| `signedTransaction` | string | Yes | The prepared transaction, signed, base64. |
Nora verifies the signed bytes against the preparation and broadcasts them.
The fee payer, the blockhash, and the instructions must match. You may add
only bounded ComputeBudget instructions. A mismatch returns `details.code` of
`TRANSACTION_MISMATCH`. An expired preparation returns `details.code` of
`TRANSACTION_EXPIRED` while the preparation is still stored; once it has been
dropped the same case is a plain `400` `BAD_REQUEST` with
`message: "Wallet has no pending prepared transaction to submit — call prepare
(or sync, to adopt an existing grant with proof) first"`. Either way: call
`prepare`, re-sign, and submit again with a new `Idempotency-Key`. A Solana
preparation lives only as long as its blockhash, well under the time a
human signer or a multisig round-trip takes; call `prepare` right before
signing.
### Request body — ethereum
| Field | Type | Required | Description |
|---|---|---|---|
| `txHash` | string | Yes | The hash of the transaction **you** broadcast — `0x` plus 64 hex characters. Not `signedTransaction`, not `txSignature`. |
You broadcast the calldata yourself; Nora verifies the receipt. The emitted
grant must match the prepared recipient and the clamped limit.
| Outcome | Response |
|---|---|
| Confirmed | `200`. The wallet is `active` (or `revoked` for a zero grant) with the effective `limitMinor`. |
| Not mined or not yet confirmed | `409` `RECEIPT_PENDING` with a `Retry-After` header. Retry with the **same** `txHash` and `Idempotency-Key`. |
| Preparation past its window | `410` `PREPARATION_EXPIRED`. Call `prepare` for fresh calldata. |
| Receipt does not satisfy the grant | `422` `VERIFICATION_FAILED`. Reverted, wrong contract, wrong recipient, or a limit that does not match the clamped value. `prepare` again. |
| Receipt fine, but another transaction changed the authorization since | `422` `RECIPIENT_STATE_MISMATCH`. Read the wallet; `prepare` again if you still want the grant. |
| A different `txHash` for the same operation | `409` `TX_HASH_MISMATCH`. Resend the original hash. |
| Preparation not bound to a chain height | `409` `OPERATION_UNBOUND`. Call `prepare` again and submit against the new calldata. |
### Response 200
`{ wallet: Wallet, operation: Operation, linkedExisting: boolean, replayed: boolean }`
## POST /v2/wallets/:id/sync
Reconcile the wallet from on-chain state. Use it after you broadcast your
own transaction, or anytime as a drift re-check.
| Field | Type | Required | Description |
|---|---|---|---|
| `txSignature` | string | No | solana only. The grant transaction's signature. Required to activate a grant Nora did not broadcast. |
**solana.** Activation requires authorship proof. The grant must bind to this
registration's own preparation, or the `txSignature`'s
`WhitelistUpdatedEvent.updated_by` must be one of your active whitelisters.
When Nora observes a grant on-chain that it cannot attribute, the call
returns `422` with `details.code` of `SYNC_PROOF_REQUIRED` and the wallet
stays `pending` with `statusReason: "awaiting_sync_proof"`. When there is no
grant on-chain at all, the call is a `200` with `outcome: "not_on_chain"`
and the row is unchanged.
**ethereum.** No proof is needed and the body can be empty — Nora reads the
recipient's authorization straight from your whitelister contract, and the
contract state is the proof. A live limit activates the wallet with that
effective value. A zeroed authorization does not flip the row on the first
read: the outcome is `not_on_chain` and the state stays `active` until the
zero is confirmed at the chain's confirmation depth.
### Response 200
`{ outcome: "activated" | "already_synced" | "not_on_chain", wallet: Wallet, operation: Operation | null }`
`operation` can be `null` or a record for any outcome (a `not_on_chain`
read on Ethereum can carry a confirmed `repair` record, for example).
Treat `outcome` as the result and `operation` as an audit detail, never as
a state change.
## DELETE /v2/wallets/:id
Cancel a `pending` registration, on either chain. The row and its operations
are hard-deleted and **the address is freed**: a follow-up `GET` returns
`404`, and you can register the same address again as a fresh registration.
This API cannot delete active wallets — that is a `409` with `details.code` of
`WALLET_NOT_PENDING`, or `ALREADY_ACTIVE` when the pre-delete on-chain check
already sees the grant.
### Response 200
`{ id: string }`
## Error envelope
Every wallet endpoint returns this shape for non-2xx responses:
```json
{
"code": "CONFLICT",
"message": "The prepared transaction has expired.",
"details": { "code": "TRANSACTION_EXPIRED" }
}
```
`code` and `message` are always present, except on structural validation
failures (missing `Idempotency-Key`, mistyped body), which come back as
`{ "data": …, "error": [{ "code", "path", "message" }], "success": false }`.
`details` is optional. For a wallet-specific error, use `details.code` for
recovery. Use the top-level `code` only for the general error category.
## Machine error codes
| Code | Meaning |
|---|---|
| `WHITELISTER_NOT_FOUND` | `whitelisterWallet` is not registered for your org and environment. |
| `WHITELISTER_NOT_ACTIVE` | The whitelister exists and is not `active`. |
| `WHITELISTER_NOT_PROVISIONED` | (ethereum) No whitelister contract is provisioned for your org yet. Contact Nora. |
| `WALLET_ALREADY_REGISTERED` | The address already has a row in your org. |
| `ADDRESS_UNAVAILABLE` | The address cannot be registered. |
| `WALLET_BANNED` | The address is banned on-chain. |
| `TRANSACTION_EXPIRED` | The preparation's blockhash expired. Call `prepare` again. |
| `TRANSACTION_MISMATCH` | The signed bytes do not match the preparation. |
| `ALREADY_ACTIVE` | The wallet is already active. |
| `NOT_ON_CHAIN` | `sync` found no grant, or `submit` could not confirm an exact minter grant. Poll the wallet or call `sync`. |
| `SYNC_PROOF_REQUIRED` | On-chain state exists and authorship proof is missing. |
| `IDEMPOTENCY_KEY_MISMATCH` | The same `Idempotency-Key` arrived with a different payload. |
| `WALLET_NOT_PENDING` | Only pending registrations can be cancelled. |
| `WALLET_NOT_MANAGED` | The wallet is not a minter registration managed by this API. |
| `WALLET_CAP_EXCEEDED` | The organization reached its active and pending minter-wallet limit. |
| `RECEIPT_PENDING` | (ethereum) The receipt is not confirmed yet. Retry `submit` with the same `txHash` and `Idempotency-Key` after `Retry-After`. |
| `PREPARATION_EXPIRED` | (ethereum) The prepared calldata is past its 24-hour window. Call `prepare`. |
| `VERIFICATION_FAILED` | (ethereum) The receipt does not satisfy the prepared grant. |
| `LIMIT_REQUIRED` | (ethereum) The wallet has no recorded limit to re-prepare from. Re-register the address with a `limitMinor`. |
| `RECIPIENT_STATE_MISMATCH` | (ethereum, submit) The receipt verified, but another transaction changed the recipient's authorization since. Read the wallet and `prepare` again if you still want the grant. |
| `TX_HASH_MISMATCH` | (ethereum, submit) A different `txHash` was sent for an operation that already has one. Resend the original. |
| `OPERATION_UNBOUND` | (ethereum) The preparation could not be bound to a chain height. Call `prepare` again and submit against the new calldata. |
| `OPERATION_IN_FLIGHT` | (prepare) A prepared or submitted grant is still awaiting its receipt. Submit it, or let it expire, before preparing another. |
## Rate limits
`prepare`, `submit`, and `sync` share a dedicated limit of 20 requests per
minute per API key. This limit is in addition to the global per-key limit.
Poll `GET /v2/wallets/:id` for status. Do not poll `sync`.
---
## Source: integrate/api-reference/webhooks.mdx
---
title: Webhooks
description: Real-time push notifications for intent state changes. Verify signatures, dedupe by event id, ack any 2xx.
---
import { Callout } from 'fumadocs-ui/components/callout';
import payinCompleted from '../../../../webhooks/fixtures/payin.completed.completed.json';
import payinCreated from '../../../../webhooks/fixtures/payin.created.awaiting_fiat_payment.json';
import payoutCompleted from '../../../../webhooks/fixtures/payout.completed.completed.json';
import payoutFailed from '../../../../webhooks/fixtures/payout.failed.failed.json';
Webhooks deliver intent state changes to your server in real time. Use
them to reconcile payments without polling. Every event arrives as a
signed HTTPS POST with the same envelope shape — only the `type` and
the contents of `data` change.
**Explore interactively:** [Sandbox](https://sandbox.api.nora.finance/reference) · [Production](https://api.nora.finance/reference) — both link to the same OpenAPI catalog with a server-switcher.
## When you'll receive events
Each intent transition that's partner-facing fires exactly one event.
Fourteen event types total:
| Event | When you receive it |
|---|---|
| `payin.created` | Onramp intent created — show the PIX QR code to your customer |
| `payin.processing` | PIX confirmed or BRS minting in progress |
| `payin.completed` | BRS minted to destination wallet (terminal) |
| `payin.failed` | Onramp failed; inspect `data.statusReason` |
| `payin.expired` | Onramp expired before payment |
| `payin.refunding` | An onramp refund is in progress |
| `payin.refunded` | An onramp refund completed (terminal) |
| `payout.created` | Offramp intent created — awaiting BRS burn |
| `payout.processing` | Burn approved / burning / scheduled / paying out |
| `payout.completed` | PIX paid out to destination (terminal) |
| `payout.failed` | Offramp failed; inspect `data.failureCode` |
| `payout.expired` | Offramp expired before BRS receipt |
| `payout.refunding` | An offramp refund is in progress |
| `payout.refunded` | An offramp refund completed (terminal) |
For event types with multiple intermediate states (`payin.processing`,
`payout.created`, `payout.processing`), use `data.status` for
fine-grained UX. The list of valid `data.status` values per event type
is documented in the interactive reference.
## Payload shape
Every payload is a JSON object with exactly seven envelope fields and
thirteen standard fields inside `data`. A scheduled payout also has
`scheduledFor`. Volatile fields (`id`, `createdAt`,
`idempotencyKey`, `data.id`) change per delivery; the rest is stable
for a given `(type, data.status)` pair.
Canonical `payin.completed`:
{JSON.stringify(payinCompleted, null, 2)}
### Envelope fields
| Field | Type | Notes |
|---|---|---|
| `id` | string (uuid) | Event identifier. **Use this for idempotency** — Nora may deliver the same event multiple times on retry. |
| `apiVersion` | `"v2"` | Pin your handler to this. Additive changes ship as new optional fields; rename/removal bumps to `v3`. |
| `type` | enum | One of the 14 event types above. |
| `environment` | `"sandbox" \| "production"` | Matches the API key prefix that created the intent. |
| `createdAt` | ISO 8601 UTC | When Nora produced the event, not when delivered. |
| `idempotencyKey` | string \| null | Echoes the `Idempotency-Key` header from your original create call. `null` for intents created before this feature shipped. |
| `data` | object | The intent block (13 fields below). |
### `data` fields
`chainId` is `"solana"`, `"ethereum"`, or `"base"`. Base is live in both environments (sandbox = Base Sepolia, production = Base mainnet). `chainId` can also be `"polygon"`, live in both environments (sandbox = Polygon Amoy, production = Polygon mainnet).
| Field | Type | Notes |
|---|---|---|
| `id` | string (uuid) | The intent id. Look this up via `GET /v2/intents/{id}` for richer detail (PIX info, party, deposit instructions). |
| `intentType` | `"onramp" \| "offramp"` | Coarser than `type` — `payin.*` ⇔ `onramp`, `payout.*` ⇔ `offramp`. |
| `status` | enum | Current intent state. `payin.processing` covers both `fiat_received` and `minting`; `payout.processing` covers five. |
| `scheduledFor` | string \| omitted | ISO 8601. Present only when `data.status` is `scheduled`. It is the earliest time payout processing can start, not a completion guarantee. |
| `statusReason` | string \| null | Human-readable status context. |
| `failureCode` | enum \| null | Machine-readable current failure class. See payout recovery below. |
| `providerFailureCode` | string \| null | Raw provider rejection code, when available. |
| `originalFailureCode` | enum \| null | Initial failure class when a later failed event changes `failureCode`. |
| `originalProviderFailureCode` | string \| null | Raw provider code for the initial failure. |
| `clientReference` | string \| null | Your foreign key from the original create call. |
| `amountCents` | integer | BRL cents. |
| `chainId` | `"solana"` \| `"ethereum"` \| `"base"` \| `"polygon"` | The chain on which the intent executes. |
| `createdAt` / `updatedAt` | ISO 8601 UTC | Intent timestamps. |
## Payout failure recovery
Use `data.failureCode` to handle the current failure. If a later `failed`
event changes it, use `data.originalFailureCode` to identify the initial failure.
Do not retry the same intent.
| Failure code | Action |
|---|---|
| `destination_invalid`, `destination_ownership_mismatch`, `recipient_account_invalid` | Correct the PIX destination. If Nora starts a refund, wait for it to complete. Create a replacement intent with a new `clientReference`. |
| `provider_rejected`, `burn_failed`, `operator_aborted`, `unknown` | Wait for Nora recovery or contact support. |
| `refund_failed` | The refund attempt returned the intent to `failed`. Wait for Nora recovery or contact support. |
`data.providerFailureCode` and `data.originalProviderFailureCode` can help
with diagnosis. Do not use either as your primary business rule because
providers can add or change codes.
An intent in `failed` can transition to `refunding`, but a refund does not
always start. Wait for refund events only after Nora starts a refund.
## Verify the signature
Every webhook carries three headers:
```text
webhook-id:
webhook-timestamp:
webhook-signature: v1,
```
Nora's signing is **Svix-compatible**. The signature is HMAC-SHA256 over
`{id}.{timestamp}.{rawBody}`, base64-encoded, prefixed `v1,`. The signing
key is your endpoint secret with the `whsec_` prefix stripped and the
remainder base64-decoded — **not** the raw secret string. During the
24-hour rotation window two signatures arrive separated by a space —
accept either.
The simplest correct path is any Svix-standard library:
```ts
import { Webhook } from 'svix';
// `secret` is the `whsec_...` value from the dashboard — pass it as-is.
const wh = new Webhook(secret);
const event = wh.verify(rawBody, {
'webhook-id': req.headers['webhook-id'],
'webhook-timestamp': req.headers['webhook-timestamp'],
'webhook-signature': req.headers['webhook-signature'],
});
```
If you'd rather not add a dependency, verify by hand. Two things matter:
the secret must be `whsec_`-stripped and base64-decoded into the key, **and**
the `webhook-timestamp` header must be checked for freshness — otherwise an
attacker who captured a single valid delivery can replay it indefinitely.
```ts
import { createHmac, timingSafeEqual } from 'node:crypto';
const FIVE_MINUTES_SECONDS = 5 * 60;
function verifyWebhook(
rawBody: string,
webhookId: string,
webhookTimestamp: string,
signatureHeader: string,
secret: string, // the `whsec_...` value from the dashboard
): boolean {
// Replay guard: reject anything more than 5 minutes off our clock. The
// Svix library does the same — skip this and captured deliveries verify
// forever. Tune the window only if you have clock-sync issues.
const ts = Number(webhookTimestamp);
if (!Number.isFinite(ts)) return false;
if (Math.abs(Date.now() / 1000 - ts) > FIVE_MINUTES_SECONDS) return false;
// The HMAC key is base64(secret-without-`whsec_`), decoded to bytes.
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
const message = `${webhookId}.${webhookTimestamp}.${rawBody}`;
const expected = createHmac('sha256', key).update(message).digest();
// Header: "v1," — or space-delimited "v1, v1," during rotation.
return signatureHeader
.split(' ')
.map((part) => part.replace(/^v1,/, ''))
.some((sig) => {
const got = Buffer.from(sig, 'base64');
return got.length === expected.length && timingSafeEqual(got, expected);
});
}
```
Reject any request whose signature doesn't verify. Don't trust the
body otherwise — anyone with your endpoint URL could forge a POST.
## Stay idempotent
Use `event.id` as your dedupe key. Persist the id (and the
`(endpointId, eventId)` pair if you support multi-endpoint partners)
so that a redelivered event is a no-op.
```ts
const seen = await db.webhookEventsSeen.findOne({ id: event.id });
if (seen) return res.status(200).end(); // already processed
await db.webhookEventsSeen.insert({ id: event.id, receivedAt: new Date() });
// ... handle event
```
## Retry policy
Every non-2xx response — `4xx` included — and every timeout triggers a
retry on this fixed schedule. Eight attempts total, ~27h35m to
dead-letter:
| Attempt | Delay before | Cumulative |
|---|---|---|
| 1 | immediate | 0 |
| 2 | 5 seconds | 5s |
| 3 | 5 minutes | 5m 5s |
| 4 | 30 minutes | 35m 5s |
| 5 | 2 hours | 2h 35m 5s |
| 6 | 5 hours | 7h 35m 5s |
| 7 | 10 hours | 17h 35m 5s |
| 8 | 10 hours | **27h 35m 5s (dead-letter)** |
After attempt 8 fails, the delivery row is marked `exhausted`. After
**5 consecutive exhausted days**, the endpoint is auto-disabled and
stays disabled until Nora re-enables it — ask your Nora contact, with
the endpoint's URL, to turn it back on.
**There is no "do not retry" status.** A `4xx` is retried like a `5xx`,
and an endpoint that keeps failing is auto-disabled. If your handler
decides an event is not for it (unknown `clientReference`, already
processed), answer `2xx` and drop it; log it on your side.
## Set up an endpoint
Endpoints are created on the dashboard, per environment: **Webhooks →
Add endpoint**, paste your HTTPS URL, and copy the **signing secret**
shown once (it can be rotated there later). The same page has the
delivery log with every attempt, its response code and a **Redeliver**
button. There is no dashboard control to re-enable a disabled
endpoint: if yours gets auto-disabled, ask your Nora contact, with the
endpoint's URL, to re-enable it. The endpoint's id (`ENDPOINT_ID`
below) is not yet displayed on the page; ask your Nora contact for it
until it is.
## Test your integration
With the endpoint registered, send sample events without creating real
intents:
```bash
curl -X POST https://sandbox.api.nora.finance/v2/webhooks/endpoints/$ENDPOINT_ID/test \
-H "X-API-Key: sk_test_..." \
-H "Content-Type: application/json" \
-d '{"eventType":"payin.completed"}'
```
You receive the canonical payload above (with fresh `id`, `createdAt`,
`idempotencyKey`, and `data.id`), signed and ready for your handler.
### Testing non-canonical cases
For event types with multiple internal statuses (`payin.processing`,
`payout.created`, `payout.processing`), pass an explicit `caseId`:
```bash
curl -X POST https://sandbox.api.nora.finance/v2/webhooks/endpoints/$ENDPOINT_ID/test \
-H "X-API-Key: sk_test_..." \
-H "Content-Type: application/json" \
-d '{"eventType":"payin.processing","caseId":"payin.processing.minting"}'
```
The valid `caseId` values per `eventType` are enumerated in the
interactive [API reference](https://sandbox.api.nora.finance/reference).
## Example: `payin.created`
Sent when an onramp intent is created and ready to receive PIX
payment. Show the PIX QR code from the **create response** (not from
this event) to your customer.
{JSON.stringify(payinCreated, null, 2)}
## Example: `payout.completed`
Sent when the PIX payout to the destination has been confirmed. The
offramp is terminal.
{JSON.stringify(payoutCompleted, null, 2)}
## Example: `payout.failed`
This example shows an EFI recipient-account rejection. The Nora code is
stable. The provider code is diagnostic information.
{JSON.stringify(payoutFailed, null, 2)}
## Versioning
This is `apiVersion: "v2"`. Within `v2`, we may **add** optional fields.
Write tolerant parsers that ignore unknown fields. We will **never** remove
or rename fields in
`v2`; that bumps to `v3` with a minimum 6-month deprecation window.
Watch the [CHANGELOG](https://github.com/Nora-Finance/nora-core-api/blob/main/CHANGELOG.md)
for version history.
## Next
- [Onramp flow](../flows/onramp-intent) — when a `payin.*` event fires
- [Offramp flow](../flows/offramp-intent) — when a `payout.*` event fires
- [Error handling](../core-concepts/error-handling) — handler retry semantics
---
## Source: integrate/core-concepts/authentication.mdx
---
title: Authentication
description: How X-API-Key binds to organization and instance, and why /v2 has no cp-* headers.
---
Every Nora `/v2` endpoint authenticates with a single header: `X-API-Key`.
No bearer tokens, no OAuth, no cookies, no separate org or instance
headers. The key is the whole credential — the backend derives
everything else from it.
## The one header
```
X-API-Key: sk_live_...
```
That's it. You'll never send an org-scoping header, an instance-
scoping header, or a bearer token alongside it. `/v2` has no
legacy `cp-*` scoping headers — if a snippet you're porting from an
older `/cp` integration shows any of them, drop them — `/v2` ignores
them and scopes only by the key.
## How a key binds
Every key encodes a tuple: **(organization, instance)**. When Nora
receives a request, it looks up the key and resolves that tuple on the
server. There's no way to "call a different org with the same key" —
every query the backend runs is scoped by whatever org and instance
the key maps to.
```mermaid
flowchart LR
A[Your server] -->|X-API-Key: sk_live_...| B[Nora API]
B --> C{Lookup key}
C -->|resolves| D[(org, instance)]
D --> E[Scope query]
```
Concretely: if you need to call `sandbox` **and** `production`, that's
two keys. If you need to call two different organizations, that's two
keys. Keys are not portable.
## Sandbox vs production
| Environment | Base URL | Key prefix |
|-------------|--------------------------------------|-------------|
| Sandbox | `https://sandbox.api.nora.finance` | `sk_test_` |
| Production | `https://api.nora.finance` | `sk_live_` |
The prefix is informational — the authoritative binding is in the
server-side lookup. Pointing a sandbox key at `api.nora.finance`, or a
production key at `sandbox.api.nora.finance`, always returns a `403`
(`API key targets sandbox but this runtime serves production`). There is
no cross-environment call. A `403` with `IP not present on allowlist of
this API key` means the request came from an address outside the key's
allowlist, which is enforced fail-closed by default. Add at least one
entry before your first call: in production a key with no allowlist
entries is rejected with that same `403`.
## Rotation
There is no in-place rotate endpoint. The rotation pattern is:
1. **Create** a new key in the dashboard (give it a dated name, e.g.
`backend-2026-04`).
2. **Swap** the secret into your config (env var, secret manager, etc.).
3. **Deploy** and verify traffic flows cleanly on the new key.
4. **Revoke** the old key.
Revoked keys return `401` with `code: "INVALID_API_KEY"` and
`message: "API key is not active"`; a never-valid key has the same `code`
and `message: "Invalid API key"`; an expired key has
`code: "API_KEY_EXPIRED"`. Branch on `message` for the first two.
## Gotchas
- **Plaintext is shown once.** The secret is displayed at create time;
Nora never stores or re-displays it. Write it to your secret manager
before you close the modal.
- **Keys are instance-scoped.** One key cannot span sandbox and
production, even within the same org. Don't try.
- **Never embed keys in client-side code.** `X-API-Key` is a server-
side credential. If it ends up in a browser bundle, mobile app, or
public repo, treat it as compromised and rotate immediately.
- **No `cp-*` headers.** If you're migrating from a `/cp` integration,
strip every legacy scoping header from your request code — `/v2`
doesn't read them.
## See also
- [Authentication (getting started)](/integrate/getting-started/authentication) — the action-oriented "set up your first key" walkthrough
- [Dashboard → API keys](/dashboard/api-keys) — UI for creating, listing, and revoking keys
- [Error handling](/integrate/core-concepts/error-handling) — the `401` responses you'll see
---
## Source: integrate/core-concepts/brs-token.mdx
---
title: BRS token
description: How BRS works across chains — decimals, chainId and networks, whitelisting, brand assets and adding a chain.
---
**BRS** (Brazilian Real Stablecoin) is the token every intent mints or
burns. One BRS is one Brazilian real. It has **6 decimals on every chain**.
Amounts on the API are always BRL **cents** (`amountCents: 500` = R$5,00 =
5 BRS). Token units appear only in `amountMinor` fields
(`"5000000"` = 5 BRS). `limitMinor`, the daily limit on a wallet grant, is
BRL cents like `amountCents`, not token units. Nora scales between cents
and token units at the chain boundary; you never convert.
## Chains
Pick the chain with `chainId`: `"solana"`, `"ethereum"`, `"base"` or
`"polygon"`. It is required on every intent. On `POST /v2/wallets` it
defaults to `"solana"`. The environment is chosen by your API key: a sandbox
key settles on the test network, a production key on mainnet.
`GET /v2/info` lists the chains your key can use.
| `chainId` | Sandbox network | Production network |
|---|---|---|
| `solana` | Solana devnet | Solana mainnet |
| `ethereum` | Sepolia (`eip155:11155111`) | Ethereum mainnet (`eip155:1`) |
| `base` | Base Sepolia (`eip155:84532`) | Base mainnet (`eip155:8453`) |
| `polygon` | Polygon Amoy (`eip155:80002`) | Polygon PoS mainnet (`eip155:137`) |
The `eip155:` values are CAIP-2 chain references. Every EVM response that
carries calldata also carries its `chainRef`, so you always know which
network to send a transaction to.
Each chain has its own whitelister and its own grants, and an intent
settles on exactly one chain. Moving BRS between chains (the EVM chains, and
Solana devnet in sandbox) is a separate on-chain operation, see
[Bridging BRS between chains](/integrate/flows/bridging); a wallet
that receives bridged BRS still needs a grant on that chain before it can
burn through an intent.
## Addresses
The BRS contract address, `chainRef` and explorer link for every network
are on the [Addresses](/integrate/addresses) page.
Mints and burns are restricted: only wallets authorized by your
organization's **BRSWhitelister** contract can receive a mint or burn
through an intent. Ordinary ERC-20 transfers between holders are not
restricted. You get one whitelister per chain, provisioned by Nora; its
owner authorizes your wallets. Per-mint bounds are checked before Nora
charges a PIX. A daily cap can only be seen on-chain, so a mint over the
remaining budget fails after the charge. Both are covered in
[Wallet whitelisting](/integrate/flows/wallet-whitelisting), with the
grant flow and error codes.
## Brand assets
Use these when you list BRS in a wallet, an explorer or your own UI.
They are display assets only: nothing on-chain points at them, so they
prove nothing about a token. The contract addresses on the
[Addresses](/integrate/addresses) page are the source of truth.
| Asset | URL |
|---|---|
| Logo, SVG | [static.nora.finance/brs/icon.svg](https://static.nora.finance/brs/icon.svg) |
| Logo, 256 px PNG | [static.nora.finance/brs/icon.png](https://static.nora.finance/brs/icon.png) |
| Token metadata (name, symbol, image) | [static.nora.finance/brs/metadata.json](https://static.nora.finance/brs/metadata.json) |
## Adding a chain to your integration
1. Confirm the chain is listed by `GET /v2/info` for your key.
2. Ask Nora for a whitelister on that chain if you do not have one. Until
it exists, `POST /v2/wallets` with that `chainId` returns `409` with
`details.code` of `WHITELISTER_NOT_PROVISIONED`.
3. Fund the whitelister's owner wallet with that chain's native token (ETH
on Ethereum and Base, POL on Polygon). It pays the gas for every grant.
4. Register and authorize the wallets that will hold BRS, with the same
`chainId`, following
[Path C of Wallet whitelisting](/integrate/flows/wallet-whitelisting#path-c--evm-calldata-ethereum-base-polygon).
5. Send `chainId` on every intent. Nothing else in the request changes.
---
## Source: integrate/core-concepts/error-handling.mdx
---
title: Error handling
description: The HTTP status codes, error envelopes, and retry semantics you'll encounter when integrating with the Nora API.
---
Nora uses conventional HTTP status codes and returns JSON error bodies
on every non-2xx response. Branch on status first, then on the
appropriate error envelope for actionable details.
## Status codes
| Status | Meaning | What to do |
|---|---|---|
| `200` / `201` | Success | Parse body. |
| `400` | Bad request — a structural validation failure (validator envelope, `error[].path` names each failing field) or a rejected business rule (`message` slug) | Fix the payload. |
| `401` | Missing, invalid, revoked or expired key (`code: INVALID_API_KEY` / `API_KEY_EXPIRED`) | Fix your `X-API-Key` configuration. Do **not** retry. |
| `403` | Valid key, not allowed here: the key belongs to the other environment, or the request came from an IP outside the key's allowlist | Do **not** retry; fix the host or the allowlist. |
| `404` | Resource does not exist in this key's environment | Check the id and that you are on the right host for the key. |
| `409` | Conflict — state precondition failed (for example, an `idempotency-key` reused with a different body) | Read the latest resource state and decide whether to proceed. |
| `422` | On-chain verification failed on a wallet submit/sync | Read `details.code`. |
| `429` | Rate limited | Respect `Retry-After`. See [Rate limits](/integrate/getting-started/rate-limits). |
| `503` on onramp creation | Payment instructions unavailable or bounded QR wait exceeded; the intent can already exist | Keep `details.intentId`. Retry with the original key and body; without an original key, retrieve that intent. See [creation recovery](/integrate/api-reference/intents#onramp-creation-recovery). |
| `5xx` | Server error | Safe to retry with backoff. **Keep the same `idempotency-key` and body** for an idempotent operation. |
## Response envelopes
```json
{
"code": "BAD_REQUEST",
"message": "evm_destination_wallet_not_authorized",
"details": { }
}
```
- `code` and `message` are present on every non-2xx response that is not
a structural validation failure; for business rules `message` is a
stable slug.
- `details` is optional and endpoint-specific.
Structural validation failures (a missing or mistyped field, a missing
required header) use a different, validator-generated shape: no `code`, no
`message`, an `error` array with one entry per problem and the offending
`path`, and a `data` echo of what you sent (empty for header failures):
```json
{
"data": { "amountCents": 100, "destinationWallet": "…", "chainId": "solana" },
"error": [
{ "code": "too_small", "path": ["amountCents"], "minimum": 500,
"message": "amountCents must be at least 500 (R$5.00 = 5 BRS minimum)" }
],
"success": false
}
```
Branch on the HTTP status first; on a `400`, check for `success === false`
and read `error[].path` / `error[].message`. Do not log `data`: it echoes
the body you sent, which on an offramp includes a PIX key. The `code`/`message` envelope
covers every other error, including business-rule `400`s.
### Wallets family (`/v2/wallets/*`)
```json
{
"code": "CONFLICT",
"message": "The prepared transaction has expired.",
"details": { "code": "TRANSACTION_EXPIRED" }
}
```
- `code` and `message` are always present, except on structural
validation failures, which use the validator shape above.
- `details` is optional and contains endpoint-specific context.
- For wallet-specific errors, `details.code` contains the uppercase value listed in the
[Wallets reference](/integrate/api-reference/wallets#machine-error-codes).
## Branching on the error body
On wallet endpoints, inspect `response.details?.code` for the wallet-specific
code. Use `response.code` for the general error category and
`response.message` for diagnostics. Use your own copy for end users.
> **`code` is the HTTP class, `message` is the reason.** `code` takes the
> upper-case values listed on the [Errors](/integrate/getting-started/errors)
> page; the business-rule slugs live in `message` and are documented next
> to each endpoint. Branch on HTTP status first, then on `message` for the
> specific failures you want to special-case.
## Retry semantics
Not every error is retry-safe:
- **Safe to retry with the same idempotency key and body:** `5xx`,
transport failures, and connection resets on intent creation,
wallet creation, or wallet submission. Successful intent replays return
the existing intent's current state; wallet retries return the stored
result. An onramp retry can return `503` again while instructions remain
unavailable. An offramp with an explicit `clientReference` returns `409`
on retry. Page through `GET /v2/intents?intentType=offramp` using `limit`
and `offset`, and match `clientReference` in the returned items. There
is no `clientReference` filter.
- **Safe to retry with a new idempotency key:** time-sensitive rebuilds
— a wallet submission after `details.code: TRANSACTION_EXPIRED`. Call `prepare`,
sign the new transaction, and use a new key.
- **Safe to retry with a new signature:** burn signing, where a
stale-blockhash failure before broadcast means you fetch a fresh payload
and re-sign; the intent is still `awaiting_burn_approval`.
- **Do not retry, fix first:** `400`, `401`, `403`, `422`.
- **Read first, then decide:** `404`, `409`. These often mean the
state you're acting on has moved — fetching the latest resource
tells you what to do next.
An onramp creation `503` does not prove that no charge exists.
`details.intentId` identifies the original intent, and a timed-out QR wait
also returns `details.outcome: "indeterminate"`. Recovery continues on that
operation. Without an original idempotency key, retrieve the identified
intent instead of repeating creation. Do not create another charge or
switch settlement mode because the response timed out. See
[Onramp creation after a timeout](/integrate/core-concepts/idempotency#onramp-creation-after-a-timeout).
## Gotchas
- **`401` is not a "try again" signal.** The credential itself is the
problem; no retry will fix it. Check the `X-API-Key` value and
whether it matches the environment you're calling.
- **`422` is wallets-only.** Intents report rejected business rules as
`400` with a slug in `message`; `422` is the wallet endpoints'
receipt-verification failure. Branch on `message` on intents, on
`details.code` on wallets.
- **Error bodies are NOT Nora's typed happy-path shape.** If you only
care about the typed response for 2xx, you still need a fallback
path for errors — the envelope is separate and varies by family.
- **Don't consume the response body twice.** If your HTTP client auto-
parses non-ok responses, don't re-read the stream.
## See also
- [Authentication](/integrate/core-concepts/authentication) — fixing `401`
- [Idempotency](/integrate/core-concepts/idempotency) — how retries stay safe
- [Wallets](/integrate/api-reference/wallets) — wallet machine codes and recovery actions
- [Rate limits](/integrate/getting-started/rate-limits) — handling `429`
---
## Source: integrate/core-concepts/idempotency.mdx
---
title: Idempotency
description: Retry intent creation and wallet registration safely. Intent creation accepts an idempotency-key header. Wallet create and submit require it. Burn approval takes one proof per intent and no key.
---
Network failures, timeouts, and user double-clicks are facts of life.
Nora uses the `idempotency-key` header to make selected write operations
safe to retry. Generate one UUID for a logical operation. Reuse that UUID
and the same request body for every retry of that operation.
## How it works
```mermaid
sequenceDiagram
participant App as Your app
participant Nora as Nora API
App->>App: user submits → mint UUID
App->>Nora: POST /v2/intents/onramp (idempotency-key: 7b3f2c9a-...)
Nora-->>App: 201 Created { id: "…" }
Note over App,Nora: Network blip — app retries
App->>Nora: POST /v2/intents/onramp (idempotency-key: 7b3f2c9a-... SAME key)
Nora-->>App: 200 OK { id: "…" } (current state)
```
On intent creation, Nora looks the intent up by its reference: the
`clientReference` you send, or the `idempotency-key` when you send none
(it is then echoed back as the intent's `clientReference`). References
are permanent and shared by onramp and offramp within an environment. A
second call with the same key and the same body does not re-execute the
operation. A successful replay returns the existing intent with HTTP `200`
instead of the `201` a fresh create answers. An onramp retry can also return
`503` while payment instructions remain unavailable; see
[creation after a timeout](#onramp-creation-after-a-timeout).
Intent responses carry no `replayed` field; wallet responses do. A different
body, or a reference that belongs to another intent, is a `409`. Offramps
with an explicit `clientReference` have the exception described below.
## Which operations carry a key
The `/v2` API uses the `idempotency-key` header on these endpoints:
- `POST /v2/intents/onramp` — mint a fresh UUID per user intent;
reuse the **same** UUID when retrying the same click.
- `POST /v2/intents/offramp` — same rule as onramp, with one difference:
the replay happens only when the body carries no `clientReference`.
With one, every retry answers
`409 Intent with clientReference '…' already exists`; the intent exists,
page through `GET /v2/intents?intentType=offramp` and match
`clientReference` (there is no filter for it).
- `POST /v2/wallets` — the header is required. Reuse the same UUID and
body when retrying one wallet registration.
- `POST /v2/wallets/:id/submit` — the header is required. Reuse the same
UUID and signed transaction when retrying one submission.
The header is format-validated as a UUID.
`clientReference` is unique per environment, forever (expired intents
included), on both endpoints. A new user operation needs a new reference.
- `POST /v2/intents/:id/approve-burn` — **no separate
`idempotency-key` header.** See [Burn-approval nuance](#burn-approval-nuance).
`GET` endpoints are already idempotent and don't need the header.
## Rule of thumb: one key per logical write
- Generate a fresh UUID before the first request.
- Persist the UUID with the request body.
- Reuse both values after a timeout, connection reset, or application restart.
- Generate a new UUID when the body changes or the user starts a new operation.
## Onramp creation after a timeout
A `503` while waiting for the QR can follow a committed onramp creation.
`details.intentId` identifies that intent; a timed-out wait also includes
`details.outcome: "indeterminate"`. The original charge can still complete
after the response or a client disconnect.
Retry with the original `idempotency-key` and unchanged body. A retry waits
for the original instructions while the intent remains payable. If they
remain unavailable, the retry can return `503` again. Use backoff and keep
the original key and body. A paid or closed intent returns its current state
and can have `pixPayment: null`. The replay preserves the original
settlement decision.
If the first request had no key, retrieve `details.intentId` through
`GET /v2/intents/:id` instead of repeating creation. An uncertain outcome
does not permit another charge, a new key, or a switch to manual settlement.
See the [creation response and recovery contract](/integrate/api-reference/intents#onramp-creation-recovery).
## Burn-approval nuance
**`POST /v2/intents/:id/approve-burn`** — one proof per intent. If your
call timed out, retry with the *same* proof (`txSignature` on Solana,
`txHash` on Ethereum): either it lands, or you get
`400 Intent is not awaiting burn approval`, which means the first call had
already succeeded. Never sign a second burn for the same intent. If a
Solana blockhash expired before broadcast, rebuild and re-sign from a fresh
payload: nothing was burned, and the intent is still
`awaiting_burn_approval`.
## Wallet-submission nuance
If `POST /v2/wallets/:id/submit` times out, retry the same signed transaction
with the same `idempotency-key`. Do not sign a second transaction while the
first preparation remains valid.
If the preparation expires, call `POST /v2/wallets/:id/prepare`. Sign the
new transaction and submit it with a new `idempotency-key`. Reusing the old
key with the new signed bytes returns `409` with `details.code` of
`IDEMPOTENCY_KEY_MISMATCH`.
Wallet create and submit responses include `replayed`. It is `true` when the
server returns the stored result for an idempotent retry.
## Gotchas
- **Keys are scoped per endpoint.** The same UUID sent to two different
paths is two separate cache entries — you don't need to globally
coordinate keys.
- **Keys are scoped per API key (and therefore per instance).** Because
`X-API-Key` binds to an (org, instance) tuple, the same UUID reused
against sandbox and production is two separate operations on two
separate servers' cache entries.
- **Don't generate the key at module load.** If your process is long-
lived, a module-level `randomUUID()` would make every user intent
share one key — the opposite of what you want. Generate inside the
request handler, per user action.
- **There is no expiry.** A reference stays taken for as long as the
intent exists, including after it expired or failed. A new user
operation always needs a new key and, if you send one, a new
`clientReference`.
## See also
- [Authentication](/integrate/core-concepts/authentication) — how `X-API-Key` scopes your idempotency-key cache
- [Error handling](/integrate/core-concepts/error-handling) - retry rules and uncertain creation outcomes
- [Burn signing](/integrate/flows/burn-signing) — one proof per intent, no `idempotency-key`
- [Wallets](/integrate/api-reference/wallets) — wallet create and submit response schemas
---
## Source: integrate/core-concepts/index.mdx
---
title: Core Concepts
description: The patterns every /v2 call follows.
---
Before you read a flow walkthrough, read these pages. They explain the
patterns you'll see on every `/v2` request: how you authenticate, how to
make writes retry-safe, and how errors come back.
- [Authentication](/integrate/core-concepts/authentication) — X-API-Key model
- [Idempotency](/integrate/core-concepts/idempotency) — safe retries
- [Error handling](/integrate/core-concepts/error-handling) — status codes and error.code taxonomy
- [BRS token](/integrate/core-concepts/brs-token) — decimals, chains and whitelisting
---
## Source: integrate/flows/bridging.mdx
---
title: Bridging BRS between chains
description: Move BRS between Solana, Ethereum, Base, Polygon and Optimism, straight from the token contract or the Solana OFT program, with no Nora API call. BRS is a LayerZero OFT, so any holder can bridge.
---
BRS is a [LayerZero v2](https://docs.layerzero.network/v2) **OFT**
(Omnichain Fungible Token). Bridging burns BRS on the source chain and mints
the same amount on the destination, delivered by LayerZero. It is
permissionless: the holder calls the token contract (or, on Solana, the OFT
program) directly and pays the LayerZero fee in the source chain's native
token. No Nora API call is in the path; Nora's controls on the token itself
still apply, see [Rules that still apply](#rules-that-still-apply).
Solana is part of the mesh in both environments: BRS moves between Solana
and the three EVM chains in both directions, Solana mainnet in production
and Solana devnet in sandbox.
Use this page if you are building on BRS and want to move balances between
chains. To turn BRL into BRS or back, use [intents](/integrate/flows).
## What you need
- The BRS contract address for your environment; it is the same on every
chain of that environment, see [Addresses](/integrate/addresses).
- The LayerZero **endpoint id** (`eid`) of the destination. It is not the
EIP-155 chain id.
- A wallet on the source chain holding BRS and enough native token for gas
plus the LayerZero fee.
| `chainRef` | LayerZero `eid` |
|---|---|
| `eip155:1` | `30101` |
| `eip155:8453` | `30184` |
| `eip155:137` | `30109` |
| `eip155:10` | `30111` |
| `eip155:11155111` | `40161` |
| `eip155:84532` | `40245` |
| `eip155:80002` | `40267` |
| `solana` (mainnet) | `30168` |
| `solana` (devnet) | `40168` |
Every pair inside an environment is wired in both directions: Solana,
Ethereum, Base, Polygon and Optimism form the production mesh; Solana
devnet, Sepolia, Base Sepolia and Amoy form the sandbox mesh. A mainnet
never bridges to a testnet.
## The two calls
1. `quoteSend(sendParam, false)` returns the fee. `nativeFee` is in the
source chain's native token (ETH on Ethereum, Base and Optimism, POL on
Polygon).
2. `send(sendParam, fee, refundAddress)` with `msg.value` **exactly equal**
to `nativeFee`: more or less reverts with `NotEnoughNative` and nothing is
burned. It burns `amountLD` from the caller and emits `OFTSent`.
`refundAddress` receives the difference only when the fee recomputed at
send time is lower than the one you passed; use your own wallet.
`SendParam` fields:
| Field | Value |
|---|---|
| `dstEid` | destination `eid` from the table |
| `to` | recipient, 32 bytes. For an EVM destination, the address left-padded to 32 bytes. For Solana, the recipient **wallet's** public key as its raw 32 bytes (decode the base58, no padding): the delivery creates that wallet's BRS token account and its rent is already inside `nativeFee`. Never pass a token account or a program address. The credit is a plain mint to that recipient, whether or not anything controls it there, so use an address you control **on the destination chain**: a Safe or smart account deployed only on the source chain would receive BRS nobody can move |
| `amountLD` | amount in token units, 6 decimals (`5000000` = 5 BRS) |
| `minAmountLD` | same as `amountLD`; BRS has 6 shared decimals, so nothing is rounded away |
| `extraOptions` | `0x`; the contract already enforces the destination gas |
| `composeMsg` | `0x` |
| `oftCmd` | `0x` |
The quote is live. Quote and send in the same run. If the fee rises in
between, `send` reverts and nothing is burned; quote again.
## Example (viem)
Bridges 5 BRS from Base Sepolia to Sepolia, to the same address.
```ts
import { createWalletClient, createPublicClient, http, pad, parseAbi } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";
const BRS = "0x0000884179F857221EFC49C21BCb94af93CEB125"; // sandbox; production address on the Addresses page
const DST_EID = 40161; // Sepolia
const abi = parseAbi([
"struct SendParam { uint32 dstEid; bytes32 to; uint256 amountLD; uint256 minAmountLD; bytes extraOptions; bytes composeMsg; bytes oftCmd; }",
"struct MessagingFee { uint256 nativeFee; uint256 lzTokenFee; }",
"function quoteSend(SendParam s, bool payInLzToken) view returns (MessagingFee)",
"function send(SendParam s, MessagingFee fee, address refundAddress) payable",
]);
// Any viem Account works here: a hardware or custodial signer in production,
// a throwaway test key on Base Sepolia.
const account = privateKeyToAccount(process.env.HOLDER_KEY as `0x${string}`);
const publicClient = createPublicClient({ chain: baseSepolia, transport: http() });
const wallet = createWalletClient({ account, chain: baseSepolia, transport: http() });
const sendParam = {
dstEid: DST_EID,
to: pad(account.address),
amountLD: 5_000_000n,
minAmountLD: 5_000_000n,
extraOptions: "0x",
composeMsg: "0x",
oftCmd: "0x",
} as const;
const fee = await publicClient.readContract({ address: BRS, abi, functionName: "quoteSend", args: [sendParam, false] });
const hash = await wallet.writeContract({
address: BRS,
abi,
functionName: "send",
args: [sendParam, fee, account.address],
value: fee.nativeFee,
});
console.log("sent", hash);
```
## Sending from Solana
On Solana the holder calls the BRS OFT program instead of a token contract;
the program id, its Store and its escrow are on the [Addresses](/integrate/addresses#solana)
page, under Solana production and Solana sandbox. The shape is the same two calls, through
LayerZero's [`@layerzerolabs/oft-v2-solana-sdk`](https://docs.layerzero.network/v2/developers/solana/oft/sdk):
1. `oft.quote(...)` with the BRS mint, the OFT escrow (the SDK derives the
Store from it), `dstEid` and `to` returns `nativeFee` in lamports.
2. `oft.send(...)` with the same arguments and that fee burns the BRS from
the holder's token account and emits the message.
`to` is the EVM recipient left-padded to 32 bytes; `amountLd` and
`minAmountLd` are equal, in 6-decimal units. The destination gas is enforced
by the OFT, so no extra options are needed. The send transaction must
include LayerZero's address lookup table for the cluster, listed in their
Solana docs; without it the transaction exceeds the size limit.
Delivery on the destination usually takes one to a few minutes. Into
Solana it waits for the source chain's confirmations first, about five
minutes from Polygon; a Solana devnet credit often lands in under a minute. Track the
source transaction hash on LayerZero Scan
([layerzeroscan.com](https://layerzeroscan.com) for mainnets,
[testnet.layerzeroscan.com](https://testnet.layerzeroscan.com) for
testnets), or poll `balanceOf` on the destination. The message id (`guid`)
is in the `OFTSent` event of the source receipt, and the `OFTReceived`
event on the destination carries the same `guid`.
## Rules that still apply
- **Burning through an intent on the destination needs a grant there.** A
bridge-in credits any address, on Solana as on the EVM chains, but
`POST /v2/intents/offramp` burns only
from a wallet authorized on that chain's whitelister. Register the wallet
with the destination `chainId` in the [Wallets API](/integrate/api-reference/wallets)
before you rely on offramping bridged balance.
- **Freeze.** A frozen holder cannot bridge out. A freeze on the
destination does not stop an inbound credit: the BRS lands on the frozen
address and stays there until it is unfrozen.
- **Pauses, on either side.** Nora can pause the token (`pause()`) or one
pathway (a LayerZero configuration change) during an incident. On the
**source** side, `send` reverts and nothing is burned; a pathway pause
also makes `quoteSend` revert, a token pause does not, so a successful
quote is not proof the send will go through. On the **destination** side, your `send` succeeds and
the burn is final; the message stays verified and undelivered until the
pause is lifted, then the LayerZero executor, or anyone calling the
endpoint's `lzReceive` for it, delivers the credit. Nothing is lost, but
the balance is out of reach in between.
## See also
- [Addresses](/integrate/addresses) — BRS addresses per network and environment.
- [Wallet whitelisting](/integrate/flows/wallet-whitelisting) — the grant a wallet needs before it can burn on a chain.
- [Offramp intent](/integrate/flows/offramp-intent) — turning bridged BRS back into BRL.
- [LayerZero OFT docs](https://docs.layerzero.network/v2) — the standard behind `quoteSend` and `send`.
---
## Source: integrate/flows/burn-signing.mdx
---
title: Burn signing
description: Ask Nora to prepare the burn, have the token holder's wallet sign and broadcast it on Solana, Ethereum, Base or Polygon, and submit the proof back via /v2/intents/:id/approve-burn.
---
Creating an [offramp intent](/integrate/flows/offramp-intent) leaves it in
`status: awaiting_burn_approval`. To complete the offramp, your user signs the
**burn itself** — there is no longer a standing delegate allowance.
The flow is a two-call handshake. You ask Nora to **prepare** the burn; Nora
issues an attested on-chain burn grant for this exact intent, amount and
holder. The holder's wallet signs and broadcasts the burn, and you submit the
resulting proof back so Nora can verify the burn on-chain before paying out.
The two `/v2` endpoints are:
```
POST /v2/intents/:id/prepare-burn # issue the burn authorization
POST /v2/intents/:id/approve-burn # submit the broadcast proof
```
The chain named by the intent's `chainId` decides what you sign and what
you send back:
| | Solana | EVM (Ethereum, Base, Polygon) |
|---|---|---|
| `tokenHolder` | base58 wallet address | `0x` address |
| What Nora prepares | an unsigned `user_burn` transaction at `metadata.userBurnTransaction` | a `burn(...)` call returned by `prepare-burn` itself (`status: "ready"`) |
| Who broadcasts | the user's wallet, after signing the staged transaction | the holder, sending the call as-is |
| `approve-burn` proof | `txSignature` | `txHash` |
The sections through [Gotchas](#gotchas) describe Solana, except
[Request schemas](#request-schemas), which covers both families. The EVM
chains are covered in [Ethereum](#ethereum) below.
## Flow
```mermaid
sequenceDiagram
actor User
participant App as Your app
participant Nora as Nora API
participant Chain as Solana
App->>Nora: POST /v2/intents/:id/prepare-burn
body: { tokenHolder }
Nora-->>App: { status: "preparing" }
Note over Nora,Chain: Nora issues an attested grant_burn and
stages an unsigned user_burn transaction
loop until staged (≈1.5s interval, ~30s budget)
App->>Nora: GET /v2/intents/:id
Nora-->>App: { metadata: { userBurnTransaction? } }
end
App->>App: decode base64 → refresh blockhash → set feePayer
App->>User: signTransaction(user_burn)
User-->>App: signed
App->>Chain: sendRawTransaction(serialized)
Chain-->>App: txSignature
App->>Nora: POST /v2/intents/:id/approve-burn
body: { txSignature, tokenHolder }
Nora-->>App: { status: "burn_approved" }
Note over Nora,Chain: Nora verifies the user_burn on-chain
(intent, holder, amount) before payout
```
## Steps
1. **Offramp intent has been created.** You have an `intentId` and the intent's
status is `awaiting_burn_approval`. See
[Offramp intent](/integrate/flows/offramp-intent).
2. **Prepare the burn.** `POST /v2/intents/:id/prepare-burn` with
`{ tokenHolder }`, where `tokenHolder` is the user's **wallet (owner)
address** in base58 — the BRS holder who will sign. Nora issues an attested
`grant_burn` on-chain and begins staging the unsigned `user_burn`
transaction. The response is `{ status: "preparing" }`. The grant has its
own expiry, earlier than the intent's, exposed on the intent as
`metadata.burnGrantExpiresAt` (Unix seconds); the staged transaction must
be signed and land before it. An intent too close to its own `expiresAt`
is refused with `400 Intent expires too soon to prepare a burn. Create a
new intent and prepare the burn on it.` Calling `prepare-burn` again with
a **different** `tokenHolder` while a grant is live is not rejected: it
answers `preparing` and the first holder stays bound. Read
`metadata.burnTokenHolder` and hand the staged transaction only to that
wallet.
3. **Poll for the staged transaction.** `GET /v2/intents/:id` until
`metadata.userBurnTransaction` is present — a **base64-encoded** unsigned
`user_burn` transaction. (The reference client polls every ~1.5s for ~30s.)
4. **Client-side: sign + broadcast `user_burn`.**
- Decode the base64 into a Solana `Transaction`.
- Refresh the blockhash (`getLatestBlockhash('confirmed')`) — the staged one
may be stale by signing time — and set `feePayer` to the user's wallet.
Refreshing only `recentBlockhash` and `feePayer` is safe: these are envelope
fields, so the on-chain grant binding (bound to the transaction's
instructions) stays valid. Don't reconstruct or reorder the instructions —
see the Gotchas below.
- Sign with the user's Solana wallet. **This signs the burn itself**, not a
delegate approval.
- Serialize and broadcast (`sendRawTransaction`); collect the `txSignature`,
and wait for `confirmed`.
5. **Submit the signature.** `POST /v2/intents/:id/approve-burn` with
`{ txSignature, tokenHolder }`. The call checks only that the signature is
well formed and moves the intent to `burn_approved`; the on-chain
verification (correct intent, holder, and amount) runs in the background
before the payout. A signature that never lands, or a burn by another
holder, fails the intent later with `failureCode: "burn_failed"` and a
`statusReason` explaining why. Handle `failed` after a `200` here; do
not treat the `200` as "payout guaranteed".
> **Idempotency note.** `approve-burn` accepts one proof per intent. After
> it succeeds the intent is `burn_approved`, and any further call answers
> `400 Intent is not awaiting burn approval`; treat that as "already
> submitted". There is **no** separate `idempotency-key` header here — see
> [Idempotency](/integrate/core-concepts/idempotency).
## Where each call runs
`X-API-Key` is a server-side credential bound to your organization, never
to a user, so the flow is split: your **server** calls `prepare-burn`,
reads the intent and calls `approve-burn`; the user's **browser or app**
only receives the staged transaction, signs it with the wallet and
broadcasts it. Expose your own authenticated endpoints for the two
hand-offs (staged transaction out, `txSignature` in) and check that the
caller owns that intent. The outline below marks which side runs each
step; the key-less `fetch` calls stand for calls to your own server.
## Client outline
The library-agnostic shape is:
```ts
// 1. [server] Ask Nora to stage the burn.
await fetch(`/v2/intents/${intentId}/prepare-burn`, {
method: 'POST',
body: JSON.stringify({ tokenHolder: walletAddress }),
})
// 2. [server] Poll the intent until the unsigned user_burn tx is staged.
let userBurnBase64: string | undefined
const deadline = Date.now() + 30_000
while (Date.now() < deadline && !userBurnBase64) {
const intent = await getIntent(intentId)
userBurnBase64 = intent.metadata?.userBurnTransaction
if (!userBurnBase64) await sleep(1500)
}
// 3. [browser] Decode, refresh the blockhash, set the fee payer, and sign the burn.
const tx = Transaction.from(Buffer.from(userBurnBase64, 'base64'))
const { blockhash, lastValidBlockHeight } =
await connection.getLatestBlockhash('confirmed')
tx.recentBlockhash = blockhash
tx.lastValidBlockHeight = lastValidBlockHeight
tx.feePayer = walletPublicKey
const signed = await wallet.signTransaction(tx)
// 4. [browser] Broadcast and confirm; hand txSignature to your server.
const txSignature = await connection.sendRawTransaction(
signed.serialize({ requireAllSignatures: false, verifySignatures: false }),
)
await connection.confirmTransaction(
{ blockhash, lastValidBlockHeight, signature: txSignature },
'confirmed',
)
// 5. [server] Submit the signature back to Nora.
await fetch(`/v2/intents/${intentId}/approve-burn`, {
method: 'POST',
body: JSON.stringify({ txSignature, tokenHolder: walletAddress }),
})
```
The same calls with `curl`:
```bash
# Prepare
curl -X POST "https://sandbox.api.nora.finance/v2/intents/$INTENT_ID/prepare-burn" \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tokenHolder": "Fg6P..." }'
# → { "status": "preparing" }
# ...poll GET /v2/intents/$INTENT_ID for metadata.userBurnTransaction, then
# sign + broadcast client-side to obtain $TX_SIGNATURE...
# Approve
curl -X POST "https://sandbox.api.nora.finance/v2/intents/$INTENT_ID/approve-burn" \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "txSignature": "5h2...", "tokenHolder": "Fg6P..." }'
# → { "status": "burn_approved" }
```
Each response body is the single `status` field — no `id`, no echo of the
intent. Re-fetch `GET /v2/intents/:id` to observe subsequent state transitions.
## Request schemas
### `POST /v2/intents/:id/prepare-burn`
Path parameter: `id` (uuid). Body:
| Field | Type | Required | Notes |
|---|---|---|---|
| `tokenHolder` | string | Yes | The user's wallet (owner) address that holds BRS and will sign the burn. Base58 on Solana, `0x` on Ethereum; an address of the wrong family is a `400`. |
Response on Solana: `{ status: "preparing" }`. The unsigned transaction
appears asynchronously at `metadata.userBurnTransaction` (base64) — poll
for it. On Ethereum the same call answers `{ status: "ready", burn }` once
the authorization exists — see [Ethereum](#ethereum).
### `POST /v2/intents/:id/approve-burn`
Path parameter: `id` (uuid). Body:
| Field | Type | Required | Notes |
|---|---|---|---|
| `txSignature` | string | Solana | Base58 signature of the broadcast `user_burn` transaction. |
| `txHash` | string | Ethereum | `0x` plus 64 hex characters: the hash of the transaction that carried the burn. |
| `tokenHolder` | string | Yes | The same wallet (owner) address passed to `prepare-burn`. |
Use the proof field of the intent's chain. The other chain's field name is
tolerated and means the same thing, but the value must be well-formed for
the intent's chain: a base58 signature on Solana, a `0x` 32-byte hash on
Ethereum. Anything else is a `400` such as
`txHash is not a valid transaction hash for chain family "evm"`.
Response: `{ status: "burn_approved" }`. Errors follow the intents-family
envelope `{ code, message, details? }` (structural validation uses the
validator shape, see [Errors](/integrate/getting-started/errors)):
- `400` — body validation, a proof that is not well formed for the intent's
chain, or the intent is no longer `awaiting_burn_approval`. Nothing
about the burn itself is checked here; that happens in the background
after the `200` and surfaces as `failed` with a `statusReason`.
- `404` — intent not found.
## Recovery if the user reloads
The risky gap is between **broadcast** and **submit**: the burn may already be
on-chain. Persist `{ intentId, tokenHolder, txSignature }` in durable client
storage as soon as `sendRawTransaction` returns. On resume, re-run
`POST /v2/intents/:id/approve-burn` with the stored values; the user does not
sign again. A `400 Intent is not awaiting burn approval` means the earlier
call had already succeeded: poll the intent. (The reference web client does
exactly this via a small `pendingCuiabaApproval` record.)
## Failure modes
- **Burned but not submitted.** If the `user_burn` lands on Solana but the
`approve-burn` call never succeeds, the BRS is *already burned*. Submitting
the same `txSignature` is the recovery path — Nora verifies the burn on-chain
and continues the payout. There is **no** standing delegate allowance left on
the user's account to clean up (unlike the legacy approve-delegate flow).
- **Stale staged transaction.** Always refresh the blockhash before signing; the
blockhash staged by Nora can expire if the user takes a while to sign.
- **Burned, then the intent expired.** If the `user_burn` landed but
`approve-burn` was not accepted before the intent's `expiresAt`, the intent
is `expired` and the BRS is gone. Do **not** create a new intent (that burns
a second time); contact Nora with the intent id and the `txSignature` for
manual reconciliation.
## Gotchas
- **The transaction is staged for you.** You do **not** build the burn
instruction client-side anymore — decode and sign what Nora stages at
`metadata.userBurnTransaction`. Do not reconstruct or reorder its instructions
(the on-chain grant verification is bound to the staged transaction).
- **`tokenHolder` is the wallet owner, not the ATA.** Pass the user's base58
wallet address — the same value used to sign.
- **User-rejected signatures should be treated distinctly.** Wallet adapters
throw with messages containing "rejected", "declined", "cancelled", or
"user denied". Surface "try again" copy, not a generic error.
- **No `idempotency-key` header.** `approve-burn` takes one proof per
intent. Sending a header is not an error, but it is not used.
## Ethereum
This section covers every EVM chain — Ethereum, Base and Polygon run the
same calls, and only `burn.chainRef` differs.
On EVM nothing is staged on the intent. `prepare-burn` returns the
`burn(...)` call itself, the holder sends it unchanged, and `approve-burn`
takes the transaction hash.
```mermaid
sequenceDiagram
actor Holder
participant App as Your app
participant Nora as Nora API
participant Chain as Ethereum
App->>Nora: POST /v2/intents/:id/prepare-burn
body: { tokenHolder: "0x…" }
Nora-->>App: { status: "preparing" }
Note over Nora: signs a burn authorization for
this intent, amount and holder
App->>Nora: POST /v2/intents/:id/prepare-burn (same body)
Nora-->>App: { status: "ready", burn: { from, to, data, expiresAt, … } }
App->>Holder: send { to, data, value: 0 } from `from`
Holder->>Chain: transaction
Chain-->>App: txHash
App->>Nora: POST /v2/intents/:id/approve-burn
body: { txHash, tokenHolder }
Nora-->>App: { status: "burn_approved" }
Note over Nora,Chain: Nora reads the receipt, waits for
confirmations, then pays out
```
### Steps
1. **Prepare.** `POST /v2/intents/:id/prepare-burn` with
`{ tokenHolder: "0x…" }`. The first answer is `{ "status": "preparing" }`.
Call it again a few seconds later with the same body:
```json
{
"status": "ready",
"burn": {
"chainRef": "eip155:11155111",
"from": "0xYourWallet000000000000000000000000000000",
"to": "0x0000884179F857221EFC49C21BCb94af93CEB125",
"data": "0xd03c72eb000000000000000000000000…",
"amountMinor": "5000000",
"expiresAt": 1788842399
}
}
```
| Field | Meaning |
|---|---|
| `chainRef` | CAIP-2 ref of the chain to send on: `eip155:11155111` (Sepolia, sandbox) / `eip155:1` (mainnet, production) for Ethereum; `eip155:84532` (Base Sepolia, sandbox) / `eip155:8453` (Base mainnet, production) for Base; `eip155:80002` (Polygon Amoy, sandbox) / `eip155:137` (Polygon mainnet, production) for Polygon. The `chainId` on the intent names the chain but not the network, so read this field. |
| `from` | The only address that may send it. The authorization binds the sender. `tokenHolder` must be all lower-case or a valid EIP-55 checksum; a wrong checksum is rejected as "not a valid address". |
| `to` | The BRS token contract. |
| `data` | ABI-encoded `burn(...)` with Nora's attestation inside. Send it unchanged. |
| `amountMinor` | Token units burned, as a decimal string. `"5000000"` is 5 BRS. |
| `expiresAt` | Unix seconds. The contract rejects the call at or after this instant. It falls before the intent's own `expiresAt`, so the later you call `prepare-burn`, the less time the holder has. |
While an authorization is live, `prepare-burn` returns the same one and
rejects a different `tokenHolder` with `400`. A live authorization is
never replaced before it expires, so the way out of a wrong holder is a
new offramp intent. The same authorization also appears at
`metadata.evmBurnGrant` on the intent.
2. **Send the call.** From `burn.from`, send a transaction with
`to: burn.to`, `data: burn.data`, `value: 0`. The BRS contract burns from
the sender: the sender must be the holder you named, must be authorized on
your whitelister contract, and must hold at least `amountMinor`. Nora does
not check this before issuing; an unmet condition reverts on-chain. The
holder pays the gas. A smart account or an EIP-7702
wrapper may wrap the call; Nora verifies the burn by the events the BRS
contract emits, not by the outer transaction's `to`.
3. **Submit the hash.** `POST /v2/intents/:id/approve-burn` with
`{ txHash, tokenHolder }`. The response is `{ "status": "burn_approved" }`.
The value must be the `0x` 32-byte hash of the transaction; a base58
signature or a short value is a `400`:
`txHash is not a valid transaction hash for chain family "evm"`.
4. **Track.** `GET /v2/intents/:id` moves through `burning` and `paying_out`
to `completed`. Verification waits for the chain's confirmation depth.
`metadata.burnTxSignature` holds the hash once the burn is confirmed.
```ts
import {
base,
baseSepolia,
mainnet,
polygon,
polygonAmoy,
sepolia,
} from 'viem/chains'
// 1. [server] Prepare, then re-read until the authorization is ready.
// The same server/browser split as on Solana applies: X-API-Key never
// reaches the holder's wallet software.
const prepare = async () => {
const res = await fetch(`${BASE_URL}/v2/intents/${intentId}/prepare-burn`, {
method: 'POST',
headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' },
body: JSON.stringify({ tokenHolder }),
})
const body = await res.json()
if (!res.ok) throw new Error(body.message)
return body
}
let prepared = await prepare()
for (let attempt = 0; prepared.status !== 'ready'; attempt++) {
// Issuance takes seconds. Still `preparing` after a handful of calls means
// the intent is too close to its expiry to authorize: create a new one. If a
// fresh intent behaves the same way, stop and contact Nora with the intent id.
if (attempt >= 15) throw new Error('burn authorization not issued')
await sleep(2000)
prepared = await prepare()
}
const { from, to, data, chainRef } = prepared.burn
// 2. [holder's wallet / browser] Send the call unchanged (viem shown; any signer works).
// `chain` makes viem refuse to broadcast if the wallet is connected to a
// different network than the one `chainRef` names.
const CHAIN_BY_REF = {
'eip155:1': mainnet,
'eip155:11155111': sepolia,
'eip155:8453': base,
'eip155:84532': baseSepolia,
'eip155:137': polygon,
'eip155:80002': polygonAmoy,
} as const
const chain = CHAIN_BY_REF[chainRef as keyof typeof CHAIN_BY_REF]
if (!chain) throw new Error(`unsupported chainRef ${chainRef}`)
const txHash = await holderWalletClient.sendTransaction({
account: from,
to,
data,
value: 0n,
chain,
})
// 3. [server] Hand the hash back. Persist { intentId, tokenHolder, txHash } first.
await fetch(`${BASE_URL}/v2/intents/${intentId}/approve-burn`, {
method: 'POST',
headers: { 'X-API-Key': apiKey, 'Content-Type': 'application/json' },
body: JSON.stringify({ txHash, tokenHolder }),
})
```
### Ethereum gotchas
- **Burned, then the intent expired.** If the burn landed but `approve-burn`
was not accepted before the intent's `expiresAt`, the intent is `expired`
and the BRS is gone. Do **not** create a new intent (that burns a second
time); contact Nora with the intent id and the `txHash`.
- **Submit only the hash you actually broadcast.** `approve-burn` checks
the format and accepts the hash at once; verification runs in the
background. Once the intent is `burn_approved` the endpoint rejects any
other hash (`Intent is not awaiting burn approval`). A reverted burn fails
the intent, and a failed intent cannot be re-approved through the API. A
hash that never mines leaves the intent at `burn_approved` for Nora to
reconcile by hand: contact Nora with the intent id.
- **Persist before you submit.** Store `{ intentId, tokenHolder, txHash }`
as soon as the wallet returns the hash. If your app restarts before
`approve-burn` succeeds, resend the same body. If `approve-burn` had
already succeeded, the retry answers `400` and the intent is already
progressing.
- **The authorization expires before the intent does, and is not
replaced.** By the time it lapses the intent is too close to its own
expiry for a new one, so `prepare-burn` keeps answering `preparing`. If
no burn was broadcast, create a new offramp intent; if one was, submit
its hash with `approve-burn` (accepted until the intent expires) and,
past that, contact Nora rather than burning again.
- **Do not edit `data`.** The attestation covers the whitelister, the
amount, a reference id and the expiry. Any change makes the contract
reject it.
## See also
- [Ethereum end-to-end](/integrate/flows/ethereum-end-to-end) — the same calls inside the full Ethereum flow
- [Offramp intent](/integrate/flows/offramp-intent) — the prerequisite
- [API Reference: Intents](/integrate/api-reference/intents) — endpoint spec for `prepare-burn` and `approve-burn`
- [Idempotency](/integrate/core-concepts/idempotency) — one proof per intent, and how to retry
---
## Source: integrate/flows/ethereum-end-to-end.mdx
---
title: Ethereum end-to-end
description: Whitelist a wallet, mint BRS by PIX, and burn it back to BRL on Ethereum. Every request and response below is what the sandbox returns today.
---
This guide runs the whole Ethereum integration once, in the sandbox, in
the order you will implement it. Each step shows the call, the response,
and the value to keep for the next step. The same calls work in
production with a production key and the production base URL.
| | Sandbox | Production |
|---|---|---|
| Base URL | `https://sandbox.api.nora.finance` | `https://api.nora.finance` |
| PIX deposit | Simulated for the amount this guide uses: the intent moves to `fiat_received` on its own shortly after creation. Other amounts wait on a PIX nobody pays in sandbox. | Your user pays the PIX code. |
Addresses, `chainRef` values and explorers per network: see the
[Addresses](/integrate/addresses) page. Per-mint and
daily limits: [Wallet whitelisting → Reference](/integrate/flows/wallet-whitelisting#reference-addresses-limits-and-owners).
In both environments Nora waits for the chain's confirmation depth before
acting on a transaction. You never size that wait yourself: `submit` answers
`409 RECEIPT_PENDING` with a `Retry-After` header until then, `sync` answers
`outcome: "not_on_chain"`, and intents move on their own.
BRS has 6 decimals on both chains. Amounts on the API are always BRL
cents (`amountCents: 500` = R$5,00 = 5 BRS); token units appear only in
`amountMinor` fields (`"5000000"` = 5 BRS).
> **Base.** This same flow applies unchanged with `chainId: "base"` — sandbox
> is Base Sepolia (`eip155:84532`, explorer `sepolia.basescan.org`),
> production is Base mainnet (`eip155:8453`, explorer `basescan.org`), and
> the BRS token address on Base matches the one above for each stage.
## Before you start
1. A **sandbox API key**. See the [Quickstart](/integrate/getting-started/quickstart).
2. A **whitelister contract** provisioned by Nora for your organization,
whose `owner()` is a wallet you control (an EOA or a Safe). Ask your Nora
onboarding contact for this once per environment. Until it exists, step 1 returns `409` with
`details.code: "WHITELISTER_NOT_PROVISIONED"`.
3. A **wallet to whitelist**: the address that will receive mints and send
burns. An EOA or a smart account, with Sepolia ETH for the burn's gas.
4. A **PIX key on your Pix-key list** for the environment, added on the
dashboard under **Pix Keys** ([how](/dashboard/pix-keys)). Offramp
payouts go only to keys on that list, your own CNPJ included.
Placeholder values below (`0xYourWhitelister…`, `0xYourOwner…`,
`0xYourWallet…`, `YOUR_CNPJ_DIGITS`) stand for your organization's own
addresses and keys. Every other value is copied from a
real sandbox run; `…` marks fields shortened for the page.
## 1. Whitelist the wallet
Register the wallet. Nora answers with the calldata your whitelister's
owner must send.
```bash
WALLET_KEY=$(uuidgen) # one per registration, reused on retries
curl -X POST https://sandbox.api.nora.finance/v2/wallets \
-H "X-API-Key: $NORA_API_KEY" \
-H "Idempotency-Key: $WALLET_KEY" \
-H "Content-Type: application/json" \
-d '{
"chainId": "ethereum",
"address": "0xYourWallet000000000000000000000000000000",
"limitMinor": 100000,
"label": "treasury"
}'
```
`limitMinor` is the wallet's daily limit in BRL cents (`100000` =
R$1.000,00).
```json
{
"wallet": {
"id": "630b4aea-63c1-41ce-9509-090b71ed9692",
"chainId": "ethereum",
"address": "0xyourwallet000000000000000000000000000000",
"whitelisterWallet": "0xYourOwner0000000000000000000000000000000",
"role": "minter",
"state": "pending",
"statusReason": null,
"reconciliationStatus": "missing_onchain",
"label": "treasury",
"limitMinor": null,
"calldata": {
"to": "0xYourWhitelister000000000000000000000000",
"data": "0x059ef5bf000000000000000000000000…",
"chainRef": "eip155:11155111",
"signerWallet": "0xYourOwner0000000000000000000000000000000",
"limitMinor": 100000,
"expiresAt": "2026-09-09T04:19:31.124Z"
},
"createdAt": "2026-09-08T04:19:31.035Z",
"updatedAt": "2026-09-08T04:19:31.035Z"
},
"operation": { "id": "09a44c93-…", "operationType": "grant", "status": "prepared", "txSignature": null, "errorMessage": null, "createdAt": "…", "updatedAt": "…" },
"transaction": null,
"linkedExisting": false,
"replayed": false
}
```
`whitelisterWallet` in the response is your whitelister contract's owner,
echoed by Nora; it is never sent in the request. `wallet.limitMinor` stays
`null` until the grant is confirmed on-chain; the requested value is in
`calldata.limitMinor`.
Keep `wallet.id`. Then, from `calldata.signerWallet`, send a transaction
with `to: calldata.to`, `data: calldata.data`, `value: 0` before
`calldata.expiresAt`. Any wallet software works: a script with
viem or ethers, MetaMask, or a Safe. Take the transaction hash and submit it:
```bash
SUBMIT_KEY=$(uuidgen) # keep it: retries of this submit reuse the same key
curl -X POST https://sandbox.api.nora.finance/v2/wallets/630b4aea-63c1-41ce-9509-090b71ed9692/submit \
-H "X-API-Key: $NORA_API_KEY" \
-H "Idempotency-Key: $SUBMIT_KEY" \
-H "Content-Type: application/json" \
-d '{ "txHash": "0x…" }'
```
While the transaction is not yet confirmed, `submit` returns `409` with
`details.code: "RECEIPT_PENDING"` and a `Retry-After` header. Retry with
the same `txHash` and the same `Idempotency-Key` (`$SUBMIT_KEY` above). On
success the wallet is `active`:
```json
{
"wallet": {
"id": "630b4aea-63c1-41ce-9509-090b71ed9692",
"state": "active",
"reconciliationStatus": "synced",
"limitMinor": 100000,
"calldata": null,
"…": "…"
},
"operation": { "operationType": "grant", "status": "confirmed", "txSignature": "0x…", "…": "…" },
"linkedExisting": false,
"replayed": false
}
```
If the owner is a Safe or another contract wallet and you executed the
grant from its UI without keeping the hash, sync instead. Nora reads the
authorization from your whitelister and activates the wallet:
```bash
curl -X POST https://sandbox.api.nora.finance/v2/wallets/630b4aea-63c1-41ce-9509-090b71ed9692/sync \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
```
The response's `outcome` is `activated` when the grant was found and
`already_synced` when the wallet was active already. `not_on_chain` means
the grant is not visible yet (retry after the confirmation depth), was
never sent, or was zeroed since; in the last case `wallet.state` flips to
`revoked` once the zero is confirmed.
The full wallet surface, including limits, clamping, revoke and repair, is
in [Wallet whitelisting, Path C](/integrate/flows/wallet-whitelisting#path-c--evm-calldata-ethereum-base-polygon).
## 2. Mint: BRL in, BRS out
Create an onramp intent to the whitelisted wallet.
```bash
ORDER_KEY=$(uuidgen) # one per user order, reused on retries; without a clientReference a new key is a new charge
curl -X POST https://sandbox.api.nora.finance/v2/intents/onramp \
-H "X-API-Key: $NORA_API_KEY" \
-H "Idempotency-Key: $ORDER_KEY" \
-H "Content-Type: application/json" \
-d '{
"amountCents": 500,
"destinationWallet": "0xYourWallet000000000000000000000000000000",
"chainId": "ethereum",
"clientReference": "order-1001"
}'
```
```json
{
"id": "e29fa7ce-c600-45d7-a54d-f5a3ac39d989",
"instanceId": "…",
"partyId": "…",
"intentType": "onramp",
"flowVersion": 1,
"status": "awaiting_fiat_payment",
"statusReason": null,
"failureCode": null,
"providerFailureCode": null,
"originalFailureCode": null,
"originalProviderFailureCode": null,
"clientReference": "order-1001",
"metadata": { "chainId": "ethereum", "amountCents": 500, "environment": "sandbox", "destinationAddress": "0xYourWallet000000000000000000000000000000", "…": "…" },
"expiresAt": "2026-09-08T04:46:58.035Z",
"createdAt": "2026-09-08T04:16:58.036Z",
"updatedAt": "2026-09-08T04:16:58.036Z",
"pixPayment": {
"brcode": "00020101021126580014br.gov.bcb.pix0136xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx520400005303986540…",
"txid": "e29fa7cec60045d7a54df5a3a",
"amountCents": 500,
"expiresAt": "2026-09-08T04:46:58.035Z"
},
"depositInstructions": null,
"party": { "displayName": "Your Company", "documentMasked": "64***65", "solanaWallet": null },
"chainId": "ethereum"
}
```
Keep `id`. Show `pixPayment.brcode` to your user as a QR code and a
copy-and-paste string. In the sandbox, for the amount this guide uses,
nobody has to pay: the intent moves to `fiat_received` on its own
shortly after, then to `minting`, then to `completed`. Other amounts
wait on a PIX nobody pays in sandbox.
Poll `GET /v2/intents/e29fa7ce-c600-45d7-a54d-f5a3ac39d989` or wait for
the `payin.completed` webhook. A completed Ethereum mint looks like this:
```json
{
"id": "e29fa7ce-c600-45d7-a54d-f5a3ac39d989",
"status": "completed",
"statusReason": "EVM mint confirmed on-chain.",
"metadata": {
"chainId": "ethereum",
"mintChain": "eip155:11155111",
"amountCents": 500,
"mintAmountMinor": "5000000",
"mintTxSignature": "0xcce195a3f5b81f5e78f697b90f4dde9955c7666c2569e64a400e342e56245cd9",
"destinationAddress": "0xYourWallet000000000000000000000000000000",
"…": "…"
},
"chainId": "ethereum",
"…": "…"
}
```
`metadata.mintTxSignature` is the Ethereum transaction hash of the mint.
`metadata` keys are informational and not part of the versioned response
contract; key off `status`. The wallet now holds 5 BRS. Minting costs your
wallet nothing on-chain; Nora pays that gas.
Before charging the PIX, Nora reads your whitelister and the BRS token
on-chain — see the `evm_*` rows in [What can go wrong](#what-can-go-wrong)
below for the rejection reasons and how to recover.
## 3. Burn: BRS in, BRL out
Create an offramp intent. `destinationAddress` is the PIX key that
receives the BRL. It must be on your organization's Pix-key list for this
environment, managed on the dashboard under **Pix Keys** (see
[Offramp Pix keys](/dashboard/pix-keys)); that applies to every key,
including your own CNPJ. Accepted types: your organization's CNPJ (digits
only), an email, a `+55` phone or a random (EVP) key. CPF keys and other
companies' CNPJs are rejected.
```bash
PAYOUT_KEY=$(uuidgen) # one per user payout, reused on retries (see the 409 row below)
curl -X POST https://sandbox.api.nora.finance/v2/intents/offramp \
-H "X-API-Key: $NORA_API_KEY" \
-H "Idempotency-Key: $PAYOUT_KEY" \
-H "Content-Type: application/json" \
-d '{
"amountCents": 500,
"destinationAddress": "YOUR_CNPJ_DIGITS",
"chainId": "ethereum",
"clientReference": "payout-2001"
}'
```
```json
{
"id": "cb353457-227a-43a7-83d5-bec8f616c9fd",
"intentType": "offramp",
"flowVersion": 2,
"status": "awaiting_burn_approval",
"clientReference": "payout-2001",
"metadata": { "chainId": "ethereum", "amountCents": 500, "environment": "sandbox", "destinationAddress": "YOUR_CNPJ_DIGITS", "…": "…" },
"expiresAt": "2026-09-08T04:44:59.817Z",
"pixPayment": null,
"depositInstructions": null,
"chainId": "ethereum",
"…": "…"
}
```
Keep `id`. Ask Nora to prepare the burn for the wallet that holds the
BRS:
```bash
curl -X POST https://sandbox.api.nora.finance/v2/intents/cb353457-227a-43a7-83d5-bec8f616c9fd/prepare-burn \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tokenHolder": "0xYourWallet000000000000000000000000000000" }'
```
The first answer is `{ "status": "preparing" }`. Nora signs a burn
authorization for this exact intent, amount and holder. Call the same
endpoint again a few seconds later, with the same body, and you get the
call to send. If it keeps answering `preparing` on repeated calls, the
intent is too close to its `expiresAt` to be authorized, or an earlier
authorization lapsed. Create a new intent only if no burn was broadcast;
if one was, submit its hash with `approve-burn`. If a fresh intent
behaves the same way, stop and contact Nora with the intent id.
```json
{
"status": "ready",
"burn": {
"chainRef": "eip155:11155111",
"from": "0xYourWallet000000000000000000000000000000",
"to": "0x0000884179F857221EFC49C21BCb94af93CEB125",
"data": "0xd03c72eb000000000000000000000000…",
"amountMinor": "5000000",
"expiresAt": 1788842399
}
}
```
Send a transaction with `to: burn.to`, `data: burn.data`, `value: 0`
from `burn.from`, before `burn.expiresAt`. See
[Burn signing → Ethereum](/integrate/flows/burn-signing#ethereum)
for the full contract: who must send it, what reverts it on-chain, and
what happens if the authorization lapses before you broadcast.
Then hand the hash back:
```bash
curl -X POST https://sandbox.api.nora.finance/v2/intents/cb353457-227a-43a7-83d5-bec8f616c9fd/approve-burn \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"txHash": "0xad833de78479734b737d69d000c58e37e19fc53ce354435d7e74d6493d31a276",
"tokenHolder": "0xYourWallet000000000000000000000000000000"
}'
```
```json
{ "status": "burn_approved" }
```
Send only the hash of the transaction you actually broadcast. Nora
accepts the hash immediately and verifies it in the background; once the
intent is `burn_approved`, the endpoint rejects any other hash. A reverted
burn fails the intent. A hash that never mines (dropped or replaced
transaction, or a typo) leaves the intent at `burn_approved` for Nora's
operations team to reconcile: contact Nora with the intent id.
Poll `GET /v2/intents/:id` or wait for webhooks. The intent goes
`burn_approved` → `burning` → `paying_out` → `completed`. A completed
Ethereum burn:
```json
{
"id": "05cf40a4-ba7e-408b-8dc0-2b69ff27716e",
"intentType": "offramp",
"status": "completed",
"statusReason": "EFI Pix payout completed via webhook.",
"metadata": {
"chainId": "ethereum",
"burnChain": "eip155:11155111",
"amountCents": 500,
"burnTxSignature": "0xad833de78479734b737d69d000c58e37e19fc53ce354435d7e74d6493d31a276",
"burnCompletedAt": "2026-09-07T20:05:39.178Z",
"payoutCompletedAt": "2026-09-07T20:06:10.588Z",
"…": "…"
},
"chainId": "ethereum",
"…": "…"
}
```
The full signing contract, including recovery when your app restarts
between broadcast and `approve-burn`, is in
[Burn signing, Ethereum](/integrate/flows/burn-signing#ethereum).
## 4. Replace polling with webhooks
Register an endpoint on the dashboard and handle `payin.*` for mints and
`payout.*` for burns. `data.chainId` is `"ethereum"` on every event for
these intents. See [Webhooks](/integrate/api-reference/webhooks).
## What can go wrong
| You see | Where | Meaning | Do this |
|---|---|---|---|
| `409`, `details.code: "WHITELISTER_NOT_PROVISIONED"` | `POST /v2/wallets` | No whitelister contract for your organization in this environment. | Contact Nora. |
| `400` validation error whose `error[]` includes `Unrecognized key: "whitelisterWallet"` (nested in an `invalid_union` entry, next to red-herring "Invalid Solana wallet address" messages) | `POST /v2/wallets` | The Ethereum body has no `whitelisterWallet`. | Remove the field. |
| `400`, `tokenHolder is not a valid address for chain family "evm"` on a real `0x` address | `prepare-burn`, `approve-burn` | Mixed-case addresses must carry a valid EIP-55 checksum. | Send the address all lower-case, or correctly checksummed. |
| `409`, `details.code: "RECEIPT_PENDING"` | `submit` | The grant transaction is not confirmed yet. | Retry after `Retry-After` with the same `txHash` and `Idempotency-Key`. |
| `state: "active"` with `statusReason: "limit_clamped: …"` | `submit` | Your limit was reduced to your organization's ceiling. | Nothing. This is success. |
| `400`, `destinationAddress must equal the organization CNPJ for CNPJ-typed Pix keys.` | `POST /v2/intents/offramp` | A CNPJ key that is not your organization's. | Use your own CNPJ, or an email, phone or EVP key from your Pix-key list. |
| `400`, `The Pix key attempting to receive the offramp is not whitelisted by the organization.` | `POST /v2/intents/offramp` | The key is not on your organization's Pix-key list for this environment. | Add it on the dashboard under **Pix Keys**, then retry. |
| `409`, `Intent with clientReference 'order-1001' already exists` | `POST /v2/intents/onramp`, `POST /v2/intents/offramp` | `clientReference` values are unique per environment, forever: an intent with that reference already exists, even if it has expired. An onramp retry with the same `Idempotency-Key` and body is replayed instead; an offramp retry that carries a `clientReference` always gets this 409. | To find the existing intent, page through `GET /v2/intents?intentType=onramp` (or `offramp`) and match `clientReference`; there is no filter for it. For a new order or payout, send a new `clientReference`. |
| `400`, `evm_destination_wallet_not_authorized` | `POST /v2/intents/onramp` | Your whitelister has no authorization for `destinationWallet` on-chain (never granted, or zeroed). | Finish step 1. If the wallet shows `active` but was zeroed on-chain, call `sync` again after the confirmation depth (not in a loop; it is rate-limited) until `wallet.state` is `revoked`, then `prepare` + `submit`. |
| `400`, `evm_destination_wallet_rate_limit_exceeded` | `POST /v2/intents/onramp` | The wallet's on-chain daily limit is below `amountCents`. | Lower the amount, or ask Nora about the limit. |
| `400`, `evm_mint_amount_below_minimum` / `evm_mint_amount_above_maximum` | `POST /v2/intents/onramp` | `amountCents` is outside the BRS token's per-mint bounds. | Adjust the amount; the bounds are agreed at onboarding. |
| `400`, `tokenHolder is not a valid address for chain family "evm"` | `prepare-burn` | A non-Ethereum address on an Ethereum intent. | Send a `0x` address. |
| `400`, `A burn grant is already outstanding for 0x… on this intent` | `prepare-burn` | You named a different holder while an authorization is live. | Use the first holder, or create a new offramp intent. |
| `{ "status": "preparing" }` that never becomes `ready` | `prepare-burn` | The intent is too close to its `expiresAt`, so no authorization is issued, or an earlier one lapsed. | If no burn was broadcast, create a new offramp intent and call `prepare-burn` right away. If one was, submit its hash with `approve-burn`. If a fresh intent behaves the same way, stop and contact Nora with the intent id. |
| `400`, `Intent is not awaiting burn approval (current status: expired)` | `prepare-burn`, `approve-burn` | The intent passed its `expiresAt`. | If no burn was broadcast, create a new offramp intent. If one was, do not: the BRS is gone; contact Nora with the intent id and the `txHash`. |
| `400`, `txHash is not a valid transaction hash for chain family "evm"` (the message names whichever field you sent) | `approve-burn` | The value is not a `0x` 32-byte transaction hash (a base58 signature, or truncated). | Send the hash of the burn transaction as `txHash`. |
| `400`, `Intent is not awaiting burn approval (current status: burn_approved)` | `approve-burn` | A hash was already accepted. | Nothing. Poll the intent. |
| Burn transaction reverts | On-chain | Sender is not the holder, is not whitelisted, lacks balance, or the authorization expired. | Fix the cause and create a new offramp intent; a lapsed authorization is not replaced. |
| Intent stays `burn_approved` | Polling | The submitted hash never mined. | Contact Nora with the intent id. |
## Going to production
1. Get your organization's KYB approved on the dashboard; production
offramps are refused (`400`) until it is.
2. Create a production API key on the dashboard, with your production
servers' IPs on its allowlist.
3. Ask your Nora onboarding contact to provision your mainnet whitelister
with the owner you will use.
4. Point the calls above at `https://api.nora.finance`. Nothing else in the
bodies changes: `chainId` stays `"ethereum"`, `chainRef` values become
`eip155:1`, and the BRS token is
`0x0000006238e3C7797Ae71827da303560bae1B125`.
5. Add your production PIX keys on the dashboard: the Pix-key list is
per environment, so the sandbox list does not carry over.
6. Fund the burning wallets with ETH. Mints still cost you no gas.
7. Register a production webhook endpoint; endpoints are per environment
too.
Per-mint limits, your whitelister's daily cap and the network-wide daily
cap: see [Wallet whitelisting → Reference](/integrate/flows/wallet-whitelisting#reference-addresses-limits-and-owners).
---
## Source: integrate/flows/index.mdx
---
title: Flow walkthroughs
description: End-to-end /v2 integration arcs.
---
End-to-end arcs, in the order most integrators implement them:
- [Wallet whitelisting](/integrate/flows/wallet-whitelisting) — register a minter wallet and activate its on-chain grant. The wallet must be active before you start a mint or burn flow.
- [Onramp intent](/integrate/flows/onramp-intent) — fiat → crypto. Creates an intent, returns payment instructions.
- [Offramp intent](/integrate/flows/offramp-intent) — crypto → fiat. Creates an intent, returns burn instructions.
- [Burn signing](/integrate/flows/burn-signing) — sign the burn in the user's wallet (Solana, Ethereum, Base or Polygon) and submit the proof back to Nora.
- [Ethereum end-to-end](/integrate/flows/ethereum-end-to-end) — the whole Ethereum integration in one pass: whitelist, mint, burn, with real sandbox responses.
- [Bridging BRS between chains](/integrate/flows/bridging) — move BRS between Solana, Ethereum, Base and Polygon from the token contract or the Solana OFT program, no API call.
Start with [Core concepts](/integrate/core-concepts) if you haven't
already — every flow relies on the same `X-API-Key` auth and
`idempotency-key` conventions.
---
## Source: integrate/flows/offramp-intent.mdx
---
title: Offramp intent
description: Redeem BRS tokens for a BRL payout via PIX. Your backend creates the intent, the token holder burns on Solana, Ethereum, Base or Polygon, and the payout settles.
---
An **offramp intent** (labelled **Burn** in the Nora dashboard) redeems
BRS for a BRL payout. Unlike [onramp](/integrate/flows/onramp-intent), offramp requires
an **on-chain burn** signed by the token holder's wallet after the intent
is created — see [Burn signing](/integrate/flows/burn-signing) for the
hand-off on each chain.
## Flow
```mermaid
sequenceDiagram
actor User
participant App as Your app
participant Nora as Nora API
participant Chain as Solana / Ethereum / Base
participant PIX as PIX rail
User->>App: amount + PIX destination
App->>Nora: POST /v2/intents/offramp
header: idempotency-key
body: { amountCents, destinationAddress, chainId, clientReference? }
Nora-->>App: Intent
status: awaiting_burn_approval
Note over App,Chain: Signing step — see Burn signing
App->>Nora: POST /v2/intents/:id/prepare-burn
body: { tokenHolder }
App->>Chain: sign + broadcast the burn
App->>Nora: POST /v2/intents/:id/approve-burn
body: { txSignature (solana) | txHash (ethereum), tokenHolder }
loop until terminal
App->>Nora: GET /v2/intents/:id
Nora-->>App: intent (status advances)
end
Nora->>PIX: payout
PIX-->>Nora: settlement
Nora-->>App: status: completed
```
## Create the intent
`POST /v2/intents/offramp`
`chainId` accepts `"solana"`, `"ethereum"`, or `"base"`. Base is live in both environments (sandbox = Base Sepolia, production = Base mainnet). It also accepts `"polygon"`, live in both environments (sandbox = Polygon Amoy, production = Polygon mainnet).
| Field | Type | Required | Notes |
|---|---|---|---|
| `amountCents` | integer | Yes | BRL payout amount in **cents**. Must be at least 500 (R$5.00 = 5 BRS minimum). |
| `destinationAddress` | string | Yes | The PIX key that receives the BRL. **Not a wallet** — this is the fiat destination, named differently from onramp's `destinationWallet`. Must be on your organization's Pix-key list for the environment ([dashboard → Pix Keys](/dashboard/pix-keys)); accepted types are your own CNPJ, an email, a `+55` phone or an EVP key. CPF keys and other companies' CNPJs are rejected. |
| `chainId` | string | Yes | `"solana"`, `"ethereum"`, `"base"`, or `"polygon"`: the chain the BRS is burned on. The token holder must be a whitelisted wallet on it. |
| `clientReference` | string | No | Your correlation ID, up to 255 chars. Unique per environment, forever, across onramp and offramp; when omitted, the `idempotency-key` is stored and echoed as the reference. |
Headers:
| Header | Value |
|---|---|
| `X-API-Key` | Your API key. |
| `idempotency-key` | Recommended. UUID format-validated. See [Idempotency](/integrate/core-concepts/idempotency). |
Example:
```bash
PAYOUT_KEY=$(uuidgen) # one per user payout, reused on retries
curl -X POST https://sandbox.api.nora.finance/v2/intents/offramp \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-H "idempotency-key: $PAYOUT_KEY" \
-d '{
"amountCents": 10000,
"destinationAddress": "user@example.com",
"chainId": "solana",
"clientReference": "payout_xyz_42"
}'
```
Response:
```json
{
"id": "8f2a...",
"instanceId": "4e0b...",
"intentType": "offramp",
"flowVersion": 2,
"status": "awaiting_burn_approval",
"statusReason": null,
"failureCode": null,
"providerFailureCode": null,
"originalFailureCode": null,
"originalProviderFailureCode": null,
"clientReference": "payout_xyz_42",
"metadata": { "chainId": "solana", "amountCents": 10000, "…": "…" },
"expiresAt": "2026-04-22T12:30:00Z",
"createdAt": "2026-04-22T12:00:00Z",
"updatedAt": "2026-04-22T12:00:00Z",
"pixPayment": null,
"depositInstructions": null,
"party": { "displayName": "Your Company", "documentMasked": "64***65", "solanaWallet": null },
"chainId": "solana"
}
```
`pixPayment` and `depositInstructions` are always `null` on offramps.
## The burn step
The intent response carries nothing to sign. You call `prepare-burn` with
the token holder's address; Nora issues an attested burn authorization for
this intent, amount and holder. On Solana that becomes an unsigned
`user_burn` transaction the user signs; on Ethereum it is a `burn(...)`
call the holder sends. See
[Burn signing](/integrate/flows/burn-signing) for both.
## Track completion
After the burn proof is submitted (via
`POST /v2/intents/:id/approve-burn` — see
[Burn signing](/integrate/flows/burn-signing)), poll the intent until it reaches a
terminal status.
| Status | Terminal? | Notes |
|---|---|---|
| `created` | no | Accepted server-side. |
| `requires_compliance` | no | Held for compliance review. |
| `awaiting_burn_approval` | no | The holder must burn — see [Burn signing](/integrate/flows/burn-signing). |
| `burn_approved` | no | Burn proof accepted; Nora is verifying it on-chain. |
| `burning` | no | Token burn in flight. |
| `scheduled` | no | Payout processing will not start before `scheduledFor`, when present. This is not a completion guarantee. |
| `paying_out` | no | PIX payout initiated. |
| `completed` | yes | Payout settled. |
| `failed` | no | Not terminal, but no automatic recovery: a refund is started by Nora's operators after review, never by an API call, and it may not start. Check `failureCode`; it can be `null` (for example when the burn authorization was denied), and then `statusReason` carries the cause. Contact Nora with the intent id. |
| `refunding` | no | Nora is processing a refund. |
| `refunded` | yes | Refund completed. |
| `expired` / `canceled` | yes | Terminal error states. |
(Full status enum includes onramp-only values like
`awaiting_fiat_payment` and `minting`; you won't see those on offramp.)
## Resuming an interrupted intent
If your app crashes between `POST /v2/intents/offramp` and the
`approve-burn` call, the intent is still in whatever state it was left
in. Reopen your signing UI using the persisted intent ID;
`GET /v2/intents/:id` returns the current intent shape. See
[Burn signing](/integrate/flows/burn-signing) for the recovery
pattern on each chain. No new intent is created.
## Gotchas
- **Minimum R$5.00 (5 BRS).** `amountCents` below `500` is rejected at
creation with a `400` — the floor mirrors the on-chain `MintConfig.min_amount`.
- **The intent expires at `expiresAt`.** The burn must be prepared, sent
and approved inside that window. Afterwards create a new intent, unless
a burn was already broadcast: then the BRS is gone and a new intent
would burn again; contact Nora with the intent id and the proof.
- **Production needs an approved KYB.** In production, creation fails with
`400 Production offramp requires an approved KYB case matching the
organization CNPJ` until your organization's KYB is approved on the
dashboard.
- **`destinationAddress`, not `destinationWallet`.** Onramp and offramp
diverge on this field name because the offramp destination is fiat,
not crypto. Using `destinationWallet` on offramp is a validation
error.
- **The key must be on your Pix-key list.** Otherwise creation fails with
`400 The Pix key attempting to receive the offramp is not whitelisted by
the organization.`; a CNPJ key that is not your own fails with
`400 destinationAddress must equal the organization CNPJ for CNPJ-typed Pix keys.`
- **Retries with a `clientReference` are not replayed.** The same
`idempotency-key` and body replay the intent only when no
`clientReference` was sent. With one, every retry answers
`409 Intent with clientReference 'payout_xyz_42' already exists`: the
intent exists (references are unique per environment, forever), so page
through `GET /v2/intents?intentType=offramp` and match `clientReference`
(there is no filter for it). A new payout
needs a new `clientReference`.
- **BRS balance is a prerequisite.** The wallet must hold enough BRS to
cover the intent. If it doesn't, the signing step will refuse on Solana,
and the burn call reverts on Ethereum.
- **On Ethereum the holder must be a whitelisted wallet** of your
organization, registered through the
[Wallets API](/integrate/api-reference/wallets). The burn call
reverts otherwise.
- **Compliance holds don't render differently.** `requires_compliance`
and normal in-flight states share most of the API surface. Key off
`status`, not derived UI state.
## See also
- [Burn signing](/integrate/flows/burn-signing) — the next step: burn from the holder's wallet and submit the proof
- [Ethereum end-to-end](/integrate/flows/ethereum-end-to-end) — the Ethereum offramp inside the full flow, with real responses
- [Onramp intent](/integrate/flows/onramp-intent) — the reverse direction
- [Idempotency](/integrate/core-concepts/idempotency) — why the key lives on your user-intent, not each retry
- [API Reference: Intents](/integrate/api-reference/intents) — full endpoint spec
---
## Source: integrate/flows/onramp-intent.mdx
---
title: Onramp intent
description: Move BRL into BRS tokens minted to a whitelisted wallet on Solana, Ethereum, Base or Polygon. Your backend creates the intent, Nora returns PIX deposit info, your user pays by PIX, and the tokens land.
---
An **onramp intent** is a single BRL → BRS mint. Your backend posts
the amount, the destination wallet, and the chain; Nora returns
PIX deposit info you surface to your user. Once the PIX lands, Nora
mints BRS to the wallet and the intent reaches `completed`.
## Flow
```mermaid
sequenceDiagram
actor User
participant App as Your app
participant Nora as Nora API
participant PIX as PIX rail
User->>App: enters amount + destination wallet
App->>Nora: POST /v2/intents/onramp
header: idempotency-key
body: { amountCents, destinationWallet, chainId, clientReference? }
Nora-->>App: Intent
status: awaiting_fiat_payment
pixPayment: { ... }
App-->>User: show PIX QR / complete copy-and-paste BR Code
User->>PIX: pay PIX
PIX->>Nora: payment confirmation
loop until terminal
App->>Nora: GET /v2/intents/:id
Nora-->>App: intent (status advances)
end
Nora-->>App: status: completed
```
## Create the intent
`POST /v2/intents/onramp`
`chainId` accepts `"solana"`, `"ethereum"`, or `"base"`. Base is live in both environments (sandbox = Base Sepolia, production = Base mainnet). It also accepts `"polygon"`, live in both environments (sandbox = Polygon Amoy, production = Polygon mainnet).
| Field | Type | Required | Notes |
|---|---|---|---|
| `amountCents` | integer | Yes | BRL amount in **cents**, not decimals. `100.00 BRL → 10000`. Must be at least 500 (R$5.00 = 5 BRS minimum). |
| `destinationWallet` | string | Yes | Wallet that receives the minted BRS: a Solana address, or an Ethereum address (`0x…`) registered through the [Wallets API](/integrate/api-reference/wallets). 1–255 chars. |
| `chainId` | string | Yes | `"solana"`, `"ethereum"`, `"base"`, or `"polygon"`. The intent is minted on that chain; `destinationWallet` must be a whitelisted wallet on it. |
| `clientReference` | string | No | Your own correlation ID, up to 255 chars. Echoed on the intent. Unique per environment, forever, across onramp and offramp; when omitted, the `idempotency-key` is stored and echoed as the reference. |
Headers:
| Header | Value |
|---|---|
| `X-API-Key` | Your API key. See [Authentication](/integrate/core-concepts/authentication). |
| `idempotency-key` | Recommended. A UUID you pick (format-validated). Reuse on retries, regenerate on new user intents. See [Idempotency](/integrate/core-concepts/idempotency). |
Generate and persist one key per user order. In Bash or Zsh:
```bash
ORDER_KEY=$(uuidgen)
```
For fish, use this key-generation command instead:
```fish
set -l ORDER_KEY (uuidgen)
```
Use the stored key for creation and every retry. Do not regenerate it when
retrying the same order. The request below works in Bash, Zsh and fish.
```bash
curl -X POST https://sandbox.api.nora.finance/v2/intents/onramp \
-H "X-API-Key: $NORA_API_KEY" \
-H "Content-Type: application/json" \
-H "idempotency-key: $ORDER_KEY" \
-d '{
"amountCents": 10000,
"destinationWallet": "So11111111111111111111111111111111111111112",
"chainId": "solana",
"clientReference": "ord_123"
}'
```
Example response with static/manual payment instructions (BR Code abbreviated):
```json
{
"id": "8f2a...",
"instanceId": "4e0b...",
"intentType": "onramp",
"flowVersion": 1,
"status": "awaiting_fiat_payment",
"statusReason": null,
"failureCode": null,
"providerFailureCode": null,
"originalFailureCode": null,
"originalProviderFailureCode": null,
"clientReference": "ord_123",
"metadata": { "chainId": "solana", "amountCents": 10000, "…": "…" },
"expiresAt": "2026-04-22T12:30:00Z",
"createdAt": "2026-04-22T12:00:00Z",
"updatedAt": "2026-04-22T12:00:00Z",
"pixPayment": {
"brcode": "00020101021126580014BR.GOV.BCB.PIX...",
"txid": "abc123",
"amountCents": 10000,
"expiresAt": "2026-04-22T12:30:00Z"
},
"depositInstructions": null,
"party": { "displayName": "Your Company", "documentMasked": "64***65", "solanaWallet": null },
"chainId": "solana"
}
```
Notable response fields:
- `intentType` — `"onramp"` here.
- `flowVersion` — integer; pin on at least the version your code was written against.
- `status` — see the lifecycle table below for the full enum.
## Render the PIX instructions
Use the complete returned `pixPayment.brcode` for both the scannable QR code
and the copy-and-paste field. Preserve its contents when sending it to your
payment service provider (PSP).
| Settlement mode | Payment instructions | Required payment capability |
|---|---|---|
| Manual | Static BR Code for Nora's receiving account. Nora's operators confirm receipt. | Your PSP must accept the complete static BR Code. |
| Automatic | Provider-generated charge code returned by Nora. Receipt processing follows bank evidence. | Your PSP must support payment of the returned charge instrument. Validate actual provider samples before activation. |
An unchanged JSON response shape does not establish payment compatibility.
Do not extract a receiving key or rebuild the code. An embedded key,
amount tag `54`, and a fixed BR Code layout are not guaranteed across modes.
Confirm real provider samples before classifying their exact format.
Use `pixPayment.amountCents` for the payment amount and
`pixPayment.expiresAt` for the instruction deadline when non-null. Do not
derive either value from an assumed code layout. Provider instructions can
expire before the intent itself. Stop presenting expired instructions;
retrieve the original intent to check its state before starting another
operation. Once the unpaid intent is `expired`, a new user operation needs
a fresh `idempotency-key` and, if supplied, a fresh `clientReference`.
Successful creation of a payable onramp includes `pixPayment` in that same
response. A creation timeout can return `503` while the original operation
continues. Follow [creation recovery](/integrate/api-reference/intents#onramp-creation-recovery)
with the original key and body. QR availability does not emit a webhook.
Fetched intents and replays can have `pixPayment: null`: payment may already
be recorded, the intent may be closed, or automatic instructions may be
unavailable or expired. Rarely, a new creation also returns `201` with
`pixPayment: null` when the automatic charge is paid before the response.
A recorded automatic payment under review also hides the QR. Use the
intent's state and the recovery guidance; a missing QR is not permission
to create another charge.
Automatic production admission requires explicit organization opt-in for
the target environment. Opt-in defaults off: missing or disabled permission
keeps new production intents manual. It must combine with every other
eligibility check. Production automatic activation remains on standby;
coordinate validation and activation with Nora.
Each intent retains the settlement decision made at creation; changing
admission permission does not convert existing intents or their replays.
In the **sandbox** nobody pays: the deposit is simulated and the intent
moves to `fiat_received` on its own shortly after creation, then mints.
This simulation does not validate real GOWD bank execution or your PSP's
support for its charge instrument. Coordinate validation with Nora before
production activation. Activation requires agreement on migration scope,
validation arrangements, the versioning policy, and an effective date.
The [published versioning policy](/integrate/api-reference#versioning) and
existing customer notice commitments continue to apply.
## Track completion
Poll `GET /v2/intents/:id` or subscribe to webhooks. The full intent
status enum:
| Status | Terminal? | Notes |
|---|---|---|
| `created` | no | Accepted server-side, not yet routed. |
| `requires_compliance` | no | Held for compliance review. |
| `awaiting_fiat_payment` | no | Waiting for the user's PIX. |
| `fiat_received` | no | PIX confirmed by the rail. |
| `minting` | no | BRS being minted on-chain. |
| `awaiting_onchain_transfer` | no | |
| `awaiting_burn_approval` | no | (offramp) — not seen on onramp. |
| `burn_approved` | no | (offramp). |
| `onchain_received` | no | |
| `burning` | no | (offramp). |
| `scheduled` | no | (offramp). |
| `paying_out` | no | (offramp). |
| `completed` | yes | Terminal success. |
| `expired` | yes | PIX window closed before payment. |
| `canceled` | yes | |
| `failed` | no | Recovery depends on the settlement mode and failure. This is an expected intermediate step in the automatic payer-mismatch refund below. Check `failureCode`; it can be `null` (for example when the destination was denied after the PIX was charged, see `metadata.destinationAuthDenialCode`), and then `statusReason` or `metadata` carries the cause. Contact Nora with the intent ID when recovery requires review. |
| `refunding` | no | Nora is processing a refund. |
| `refunded` | yes | Refund completed. |
For an automatic onramp still awaiting payment, a single receipt with the
correct amount, within the payment deadline, can trigger an automatic refund
when bank evidence proves a payer CNPJ mismatch. Nora requests the full
return to the original payer and does not mint from that receipt. The
rejection passes through `failed` before `refunding` and `refunded`.
This `failed` step is expected in the automatic refund lifecycle and does
not itself require operator intervention. Continue tracking the original
intent; a refund request alone does not prove that funds were returned.
Late payments, incorrect amounts and additional receipts require review.
An additional receipt after mint does not move the completed intent into
`refunding` or `refunded`; its return requires manual reconciliation.
Manual refunds require operator review, external execution and confirmation.
Other failures do not guarantee an automatic refund. Partners have no public
refund-start endpoint; contact Nora with the intent ID when recovery needs
review.
## Gotchas
- **`amountCents`, not `amount`.** Integer cents, not decimal BRL.
- **Minimum R$5.00 (5 BRS).** `amountCents` below `500` is rejected at
creation with a `400` — the floor mirrors the on-chain `MintConfig.min_amount`.
- **Idempotency keys scope to "this user intent," not "this retry."**
Regenerate on a new form submission, reuse across network-level
retries. See [Idempotency](/integrate/core-concepts/idempotency).
- **Response `chainId` echoes the request** (`"solana"`, `"ethereum"`, `"base"`, or `"polygon"`).
- **`clientReference` is unique per environment, forever.** Reusing one
answers `409 Intent with clientReference 'ord_123' already exists`, even
when that intent expired. A retry with the same `idempotency-key` and
body is replayed instead.
- **On Ethereum, Nora reads your whitelister and the BRS token on-chain
before charging.** A `destinationWallet` with no authorization fails with
`400` and `message: "evm_destination_wallet_not_authorized"`; one whose
daily limit is below `amountCents` gets
`evm_destination_wallet_rate_limit_exceeded`; an amount outside the
per-mint bounds gets `evm_mint_amount_below_minimum` or
`evm_mint_amount_above_maximum`.
Register the wallet through the [Wallets API](/integrate/api-reference/wallets) first.
A completed Ethereum mint reports `statusReason: "EVM mint confirmed
on-chain."` and the transaction hash at `metadata.mintTxSignature`;
`metadata` keys are informational, not part of the versioned contract.
## See also
- [Offramp intent](/integrate/flows/offramp-intent) — the reverse direction (BRS → BRL)
- [Ethereum end-to-end](/integrate/flows/ethereum-end-to-end) — the Ethereum mint inside the full flow, with real responses
- [Idempotency](/integrate/core-concepts/idempotency) — key lifecycle
- [API Reference: Intents](/integrate/api-reference/intents) — full endpoint spec
- [Intents in the dashboard](/dashboard/intents) — operator-side view
---
## Source: integrate/flows/wallet-whitelisting.mdx
---
title: Wallet whitelisting
description: Register a minter wallet via /v2/wallets, sign the grant yourself, and activate it. Three paths - prepared, self-built, or EVM calldata.
---
A wallet needs an on-chain whitelist grant before an intent can mint to it
or burn from it. This flow registers a **minter** wallet and activates it.
You sign the grant and pay the fee. Nora does not sign routine grants.
Paths **A** and **B** are Solana. Path **C** is the EVM path — jump
straight there if `chainId` is `"ethereum"`, `"base"` or `"polygon"`;
nothing in A or B applies.
## Prerequisites (solana)
BRS on Solana is an SPL token with 6 decimals:
| Environment | Cluster | Mint |
|---|---|---|
| Sandbox | devnet | `BRS2CELW6Cueo2mrMUVvAr5GDT7Pw8TeostC2JLMpBk4` |
| Production | mainnet | `BRSxQRUaGswjLs7ewcH7uXj3r7SgmfKSSLLXyCKHZtUo` |
Explorer links and the EVM addresses are on the
[Addresses](/integrate/addresses) page.
1. An active whitelister wallet registered for your organization on the
[dashboard](/dashboard/wallets). The API does not register
whitelisters.
2. The whitelister keypair available to your server, with SOL for rent and
fees (~0.002 SOL per wallet).
3. An API key. See [Authentication](/integrate/getting-started/authentication).
## Path A — prepared transaction (solana)
```mermaid
sequenceDiagram
participant App as Your app
participant Nora as Nora API
participant Chain as Solana
App->>Nora: POST /v2/wallets
{ address, whitelisterWallet }
Nora-->>App: { wallet: pending, transaction: { unsignedTransaction, expiresAt } }
App->>App: sign with whitelister keypair
App->>Nora: POST /v2/wallets/:id/submit
{ signedTransaction }
Nora->>Chain: broadcast + confirm
Nora-->>App: { wallet: active }
App->>Nora: GET /v2/wallets/:id
Nora-->>App: { wallet: active }
```
1. **Register.** `POST /v2/wallets` with `{ address, whitelisterWallet }` and
an `Idempotency-Key`. The response stages a base64 unsigned grant
transaction. Its `feePayer` is your whitelister.
2. **Sign.** Decode the base64. Sign with the whitelister keypair. Do not
change the fee payer, the blockhash, or the instructions. Nora verifies
the bytes against the preparation before it broadcasts.
3. **Submit.** `POST /v2/wallets/:id/submit` with `{ signedTransaction }` and
a new `Idempotency-Key`. Nora broadcasts, confirms, and activates.
4. **Confirm.** `GET /v2/wallets/:id` returns `state: "active"`.
**Expiry.** The preparation expires with its blockhash (`expiresAt`,
`lastValidBlockHeight`). When `details.code` is `TRANSACTION_EXPIRED`, call
`POST /v2/wallets/:id/prepare`, re-sign the fresh transaction, and submit
again. While the current preparation is valid, `prepare` returns the same
one.
## Path B — compose your own transaction (solana)
The `POST /v2/wallets` response gives you the grant instruction, decomposed.
You compose it into your own transaction and broadcast it. You do not
assemble the byte layout by hand.
Use this path to add your own ComputeBudget, use a durable nonce, or batch
the grant with other instructions.
### Steps
1. **Register.** Call `POST /v2/wallets`. For a new registration, the response
holds the pending wallet and `transaction.instruction` — the grant as
`programId`, `keys`, and base64 `data`.
2. **Rebuild the instruction** from that field.
3. **Compose the transaction.** Add the instruction. Set the fee payer to
your whitelister wallet. Set a recent blockhash or a durable nonce.
4. **Sign** with your whitelister keypair and **broadcast** the transaction.
5. **Sync with proof.** Call `POST /v2/wallets/:id/sync` with the
`txSignature`. Nora reads the on-chain `WhitelistUpdatedEvent`. The grant
must come from one of your active whitelisters. The response is
`{ outcome: "activated" }`.
```ts
import {
Connection,
PublicKey,
Transaction,
TransactionInstruction,
} from "@solana/web3.js";
// 1. Register — the response carries the decomposed instruction.
const created = await fetch(`${BASE_URL}/v2/wallets`, {
method: "POST",
headers: {
"X-API-Key": apiKey,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
address,
whitelisterWallet: whitelister.publicKey.toBase58(),
}),
}).then((r) => r.json());
// 2. A new registration returns a composable instruction. A wallet that is
// already granted can return null instead; sync it with the original signature.
const instruction = created.transaction?.instruction;
if (!instruction) {
throw new Error(
"No composable instruction was returned. If the grant already exists, call sync with its txSignature.",
);
}
const ix = new TransactionInstruction({
programId: new PublicKey(instruction.programId),
keys: instruction.keys.map((k) => ({
pubkey: new PublicKey(k.pubkey),
isSigner: k.isSigner,
isWritable: k.isWritable,
})),
data: Buffer.from(instruction.data, "base64"),
});
// 3. Compose the transaction. The whitelister is the fee payer and the signer.
const { blockhash } = await connection.getLatestBlockhash("confirmed");
const tx = new Transaction({
feePayer: whitelister.publicKey,
recentBlockhash: blockhash,
}).add(ix);
// Add your own ComputeBudget instructions here if you need them.
// 4. Sign and broadcast.
tx.sign(whitelister);
const txSignature = await connection.sendRawTransaction(tx.serialize());
await connection.confirmTransaction(txSignature, "confirmed");
// 5. Sync with proof.
const synced = await fetch(`${BASE_URL}/v2/wallets/${created.wallet.id}/sync`, {
method: "POST",
headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
body: JSON.stringify({ txSignature }),
}).then((r) => r.json());
// synced.outcome === "activated"
```
`sync` with `txSignature` is required for this self-built path. Without it,
`sync` cannot attribute a grant it sees on-chain: it returns `422` with
`details.code` of `SYNC_PROOF_REQUIRED` and the wallet stays `pending` with
`statusReason: "awaiting_sync_proof"`. Before your transaction lands, the
same call is a `200` with `outcome: "not_on_chain"`.
Path A's preparation is valid only for the lifetime of its blockhash: well
under the time a human wallet prompt or a multisig round-trip takes. Call
`prepare` immediately before signing, and expect `TRANSACTION_EXPIRED` (or a
`400` saying there is no pending preparation) if you did not.
The background reconciler can activate a transaction that structurally matches
Nora's full staged transaction. A self-built transaction normally does not
match, because it can use another blockhash, a durable nonce, or extra
instructions.
### Reference: raw instruction layout
Prefer `transaction.instruction` from the API (Path B above) — it is always
current. The layout below serves audits and clients that construct the
instruction with no API call. Nora's E2E suite builds the instruction from
these values and verifies them against both the API response and the
program on every run.
**Program IDs**
| Environment | Cluster | Program ID |
|---|---|---|
| Sandbox | devnet | `9fBSeVHUCaHHUzkktiRp5Yn35emxx3S1ERzn7oHsi8je` |
| Production | mainnet | `noRAkuzHAdMjsbj2P9gNPMm94hui54NLkBDXe6uasVt` |
**Accounts** (in this order)
| # | Account | Signer | Writable | Derivation |
|---|---|---|---|---|
| 1 | `whitelister` | Yes | Yes | Your whitelister wallet. Also the fee payer. |
| 2 | `whitelister_pda` | No | No | PDA: seeds `["whitelist", whitelister]` |
| 3 | `user` | No | No | The wallet to whitelist. |
| 4 | `whitelist_pda` | No | Yes | PDA: seeds `["whitelist", user]` |
| 5 | `system_program` | No | No | `11111111111111111111111111111111` |
**Instruction data**: 9 bytes. The 8-byte Anchor discriminator
`[0, 143, 193, 93, 69, 29, 183, 140]`, then 1 byte for the
`WhitelistStatus` enum. Use `2` (`Minter`) — the API activates no other
value.
```ts
import {
Connection, PublicKey, SystemProgram,
Transaction, TransactionInstruction,
} from "@solana/web3.js";
const PROGRAM_ID = new PublicKey("..."); // see the table above
const DISCRIMINATOR = Buffer.from([0, 143, 193, 93, 69, 29, 183, 140]);
const MINTER = 2;
const [whitelisterPda] = PublicKey.findProgramAddressSync(
[Buffer.from("whitelist"), whitelister.publicKey.toBuffer()], PROGRAM_ID);
const [whitelistPda] = PublicKey.findProgramAddressSync(
[Buffer.from("whitelist"), user.toBuffer()], PROGRAM_ID);
const ix = new TransactionInstruction({
programId: PROGRAM_ID,
keys: [
{ pubkey: whitelister.publicKey, isSigner: true, isWritable: true },
{ pubkey: whitelisterPda, isSigner: false, isWritable: false },
{ pubkey: user, isSigner: false, isWritable: false },
{ pubkey: whitelistPda, isSigner: false, isWritable: true },
{ pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
],
data: Buffer.concat([DISCRIMINATOR, Buffer.from([MINTER])]),
});
const { blockhash, lastValidBlockHeight } =
await connection.getLatestBlockhash("confirmed");
const tx = new Transaction({
feePayer: whitelister.publicKey, blockhash, lastValidBlockHeight,
}).add(ix);
tx.sign(whitelister);
const txSignature = await connection.sendRawTransaction(tx.serialize());
```
**On-chain constraints.** The signer must hold `Whitelister` status. The
target wallet must have no prior grant (`None`); the program rejects
re-grants from a whitelister. The transaction pays rent for the new PDA
(~0.001 SOL) plus the fee.
## Path C — EVM calldata (Ethereum, Base, Polygon)
On an EVM chain there is no unsigned transaction and no `whitelisterWallet`.
Nora returns **calldata** for your organization's own BRSWhitelister contract;
the contract's owner wallet sends it, and you hand back the resulting
`txHash`.
Everything below applies unchanged to `"ethereum"`, `"base"` and `"polygon"`
— the same BRSWhitelister flow runs on each, and Nora resolves that chain's
BRS token and your whitelister contract from `chainId`. `chainId` names the
chain, not the network: the calldata is valid only on `calldata.chainRef`, so
resolve the network you broadcast on from that field and never from the
`chainId` you sent.
### Prerequisites (evm)
1. A BRSWhitelister contract provisioned by Nora for your organization. Until
it exists, `POST /v2/wallets` returns `409` with `details.code` of
`WHITELISTER_NOT_PROVISIONED`.
2. The contract's **owner** wallet available to your server, funded for gas.
Nora never holds that key.
3. An API key.
```mermaid
sequenceDiagram
participant App as Your app
participant Nora as Nora API
participant Chain as EVM chain
App->>Nora: POST /v2/wallets
{ chainId, address, limitMinor }
alt recipient already authorized on the whitelister
Nora-->>App: { wallet: active, calldata: null }
nothing to sign or submit
else grant needed
Nora-->>App: { wallet: pending, calldata: { to, data, chainRef, signerWallet, expiresAt } }
transaction: null
App->>Chain: send { to, data } from signerWallet, on chainRef
Chain-->>App: txHash
App->>Nora: POST /v2/wallets/:id/submit
{ txHash }
Nora->>Chain: read the receipt
Nora-->>App: { wallet: active, limitMinor: }
end
```
### Steps
1. **Register.** `POST /v2/wallets` with
`{ chainId: "ethereum", address, limitMinor }` and an `Idempotency-Key`.
`limitMinor` is the requested daily limit in **BRL cents** — `100000` is
R$1.000,00, not token units. Do **not** send `whitelisterWallet`: the body
is strict on this arm and the field is a `400`.
2. **Send the calldata.** The response carries `wallet.calldata`
(`to`, `data`, `chainRef`, `signerWallet`, `limitMinor`, `expiresAt`) and
`transaction: null`. Send `{ to, data, value: 0 }` from `signerWallet` on
the chain named by `chainRef` — not on whatever network your wallet happens
to be connected to. The window is 24 hours.
`calldata` is `null` when the whitelister already authorizes the address:
the wallet comes back `active` at its on-chain limit, and steps 2–5 do not
run. Branch on `wallet.calldata`, not on `state`.
3. **Submit the hash.** `POST /v2/wallets/:id/submit` with `{ txHash }` and a
new `Idempotency-Key`. The field is `txHash` — **not** `signedTransaction`
and **not** `txSignature`. Nora reads the receipt and verifies the emitted
grant against the prepared recipient and limit.
4. **Handle `RECEIPT_PENDING`.** While the receipt is unconfirmed, submit
returns `409` with `details.code: RECEIPT_PENDING` and a `Retry-After`
header. Retry with the **same** `txHash` and the **same** `Idempotency-Key`.
Respect `Retry-After` — this route has a tighter per-key budget than the
global limit.
5. **Confirm.** `GET /v2/wallets/:id` returns `state: "active"` with the
effective `limitMinor`.
```ts
import {
base,
baseSepolia,
mainnet,
polygon,
polygonAmoy,
sepolia,
} from "viem/chains";
// 1. Register.
const chainId: "ethereum" | "base" | "polygon" = "ethereum";
const created = await fetch(`${BASE_URL}/v2/wallets`, {
method: "POST",
headers: {
"X-API-Key": apiKey,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
chainId,
address, // 0x… the wallet to whitelist as minter
limitMinor: 100000, // R$1.000,00 per day, in BRL cents
}),
}).then((r) => r.json());
// 2. Send the calldata from the whitelister contract's owner, on the network
// `chainRef` names — `chainId` does not identify it. A `null` calldata
// means the address is already authorized: the wallet is `active`, stop.
const { to, data, chainRef, signerWallet } = created.wallet.calldata;
const CHAIN_BY_REF = {
"eip155:1": mainnet,
"eip155:11155111": sepolia,
"eip155:8453": base,
"eip155:84532": baseSepolia,
"eip155:137": polygon,
"eip155:80002": polygonAmoy,
} as const;
const chain = CHAIN_BY_REF[chainRef as keyof typeof CHAIN_BY_REF];
if (!chain) throw new Error(`unsupported chainRef ${chainRef}`);
const txHash = await ownerWalletClient.sendTransaction({
account: signerWallet,
to,
data,
value: 0n,
chain, // switches/pins the wallet to the calldata's network
});
// 3. Submit the hash; retry the SAME hash + key on RECEIPT_PENDING.
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const submitKey = crypto.randomUUID();
for (;;) {
const res = await fetch(`${BASE_URL}/v2/wallets/${created.wallet.id}/submit`, {
method: "POST",
headers: {
"X-API-Key": apiKey,
"Idempotency-Key": submitKey,
"Content-Type": "application/json",
},
body: JSON.stringify({ txHash }),
});
if (res.ok) break;
const body = await res.json();
const code = body.details?.code;
if (code === "OPERATION_UNBOUND") {
// Re-prepare, then submit against the fresh calldata.
throw new Error("re-prepare: " + body.message);
}
if (code !== "RECEIPT_PENDING") throw new Error(body.message);
await sleep(Number(res.headers.get("Retry-After") ?? 3) * 1000);
}
```
### The limit is clamped, and that is success
The contract clamps your requested limit to your organization's on-chain
ceiling. The wallet still becomes `active`; it just reports the lower,
effective value plus a reason:
```json
{
"state": "active",
"limitMinor": 100000000,
"statusReason": "limit_clamped: requested 200000000, effective 100000000 (the whitelister's on-chain ceiling)"
}
```
Do not treat a clamp as a failure and do not retry it. If you need a higher
ceiling, contact Nora.
**An active wallet's limit is fixed.** No `/v2` endpoint can change it.
`prepare` on an active wallet returns `200` with `calldata: null` — a silent
no-op, not an error. Raising an active wallet's limit requires Nora support.
### Cancel, revoke, repair
- **Cancel a pending registration.** `DELETE /v2/wallets/:id` hard-deletes the
row and **frees the address**: `GET` afterwards is `404`, and you can
register the same address again from scratch. On an active wallet this is a
`409`.
- **A revoke is not instant.** If the authorization is zeroed out-of-band, the
first `POST /v2/wallets/:id/sync` reports `outcome: "not_on_chain"` while the
state stays `active`. The row flips to `revoked` only once the zero is
confirmed at the chain's confirmation depth.
- **Repair a revoked wallet.** `POST /v2/wallets/:id/prepare` issues fresh
**positive** calldata for the last limit the wallet requested. Send it, call
`submit` with the new `txHash`, and the wallet returns to `active`. There is
no need to re-register.
### Reference: addresses, limits and owners
Ethereum, Base and Polygon are live in both environments. The BRS contract
address, `chainRef` and explorer for each network are on the
[Addresses](/integrate/addresses) page; each chain's own
`chainRef` also comes back on `wallet.calldata`. Your organization gets a
**BRSWhitelister** contract provisioned by Nora; its `owner()` is the address
you give us (an EOA or a Safe). Only that owner can authorize recipients, and
only authorized recipients can receive mints or submit burns.
BRS has **6 decimals** on every EVM chain, the same as on Solana. Per-mint limits,
your whitelister's daily cap (agreed at onboarding) and a network-wide daily
cap shared by all partners are on-chain settings that can change. The API
rejects before charging, with a `400`, an amount outside the per-mint
bounds (`evm_mint_amount_below_minimum`, `evm_mint_amount_above_maximum`)
or above the wallet's configured daily limit
(`evm_destination_wallet_rate_limit_exceeded`), and reports a clamped
wallet limit in `statusReason`. It cannot check how much of a daily cap is
already used today; a mint over the remaining budget fails after the
charge and goes to manual reconciliation.
**How a grant works.** `POST /v2/wallets` returns calldata for
`setAuthorizedRecipient(recipient, limit)` on your whitelister. The owner
signs and broadcasts it, then you call `submit` with the transaction hash.
Nora verifies the receipt by the event your whitelister emitted, so the
transaction may be wrapped by a smart-account wallet or a relayer.
**If your owner is a contract wallet (a Safe, a smart account):** both paths
work. `submit` accepts the wrapped transaction's hash, because Nora verifies
the event your whitelister emitted, not who sent the transaction. If you do
not have the hash at hand (for example the grant was executed from the Safe
UI), call `POST /v2/wallets/:id/sync`: it reads the authorization straight
from your whitelister and activates the wallet.
**Gas.** The owner pays gas for each grant, and each recipient pays gas for
its own burns. Mints cost you nothing on-chain: Nora's minter pays.
## Failure modes
| Symptom | Chain | Cause | Recovery |
|---|---|---|---|
| `details.code: TRANSACTION_EXPIRED` on submit | solana | The blockhash expired before signing | `prepare` → re-sign → submit |
| `details.code: TRANSACTION_MISMATCH` on submit | solana | The bytes differ from the preparation | Re-sign the staged transaction without changes |
| `details.code: SYNC_PROOF_REQUIRED` | solana | Grant observed, authorship unproven | `sync` with the grant's `txSignature` |
| `details.code: WHITELISTER_NOT_ACTIVE` | solana | The whitelister is revoked or pending | Fix the whitelister on the dashboard first |
| `details.code: WHITELISTER_NOT_PROVISIONED` | evm | No whitelister contract exists for your org | Contact Nora |
| `400` naming `whitelisterWallet` | evm | The field was sent on the EVM arm | Drop it — Nora resolves the contract server-side |
| `details.code: RECEIPT_PENDING` on submit | evm | The receipt is not confirmed yet | Retry the same `txHash` + `Idempotency-Key` after `Retry-After` |
| `details.code: PREPARATION_EXPIRED` (`410`) on submit | evm | The calldata is past its 24-hour window | `prepare` → send the new calldata → submit |
| `details.code: VERIFICATION_FAILED` (`422`) on submit | evm | Reverted, wrong contract, wrong recipient, or a limit that does not match the clamped value | Check `chainRef`, `to`, and the sender, then `prepare` again |
| `details.code: LIMIT_REQUIRED` on prepare | evm | The wallet has no recorded limit to re-prepare from | Re-register the address with a `limitMinor` |
| `details.code: OPERATION_IN_FLIGHT` (`409`) on prepare | both | A prepared or submitted grant is still awaiting its receipt | Submit it, or let it expire, before preparing another |
| `details.code: OPERATION_UNBOUND` (`409`) on submit | evm | The preparation is not bound to a chain height | `prepare` again, submit against the new calldata |
| `details.code: TX_HASH_MISMATCH` (`409`) on submit | evm | A different `txHash` than the one already recorded | Resend the original hash |
| `details.code: RECIPIENT_STATE_MISMATCH` (`422`) on submit | evm | The receipt verified, but another transaction changed the authorization since | Read the wallet; `prepare` again if you still want the grant |
Full endpoint reference: [Wallets API](/integrate/api-reference/wallets).
---
## Source: integrate/getting-started/authentication.mdx
---
title: Authentication
description: API keys, sandbox vs production, and rotation.
---
Every Nora `/v2/*` request authenticates with a single header:
```
X-API-Key: sk_test_...
```
There are no bearer tokens, no OAuth, no cookie flow for the public
API. The key is the only credential.
## What a key binds to
Each key is scoped to one **Organization × Instance** pair. The key
itself encodes which org and which environment (sandbox / production)
the call applies to — you never send `X-Organization-ID` or similar
headers.
| Environment | Base URL | Key prefix |
|--------------|---------------------------------------|--------------|
| Sandbox | `https://sandbox.api.nora.finance` | `sk_test_` |
| Production | `https://api.nora.finance` | `sk_live_` |
A sandbox key cannot call production and vice versa — you'll get a
`403` (`API key targets sandbox but this runtime serves production`).
## IP allowlist and expiry
Every key carries an IP allowlist. Add your servers' egress IPs or CIDR
ranges when you create the key, and again when your infrastructure
moves. See [Core concepts → Authentication](/integrate/core-concepts/authentication#sandbox-vs-production)
for the exact fail-closed `403` behavior.
Every key has a mandatory expiry date; the dashboard caps how far out it
can be and shows the date on the key list. An expired key answers `401`.
Create the replacement before that date, deploy it, then revoke the old
one — see Rotation below.
## Creating a key
Create, list, and revoke keys via the dashboard at **Settings → API
Keys**. See [Dashboard → API keys](/dashboard/api-keys) for the
UI walkthrough.
## Rotation
There is no in-place rotate. Rotation is:
1. Create a new key with a descriptive name (e.g. `backend-2026-04`).
2. Swap the secret into your config.
3. Deploy, verify traffic flows.
4. Revoke the old key.
Revoked keys immediately return `401`. Every `401` except expiry carries
`code: "INVALID_API_KEY"`; the `message` tells them apart: `Missing
X-API-Key header`, `Invalid API key format`, `Invalid API key`, `API key
is not active` (revoked). An expired key answers `code: "API_KEY_EXPIRED"`.
## Gotchas
- **Plaintext is shown once.** Store it in your secret manager the
moment you create the key.
- **Keys are scoped.** Do not try to use a sandbox key against
production or vice versa — it is always a `403`.
## See also
- [Errors](/integrate/getting-started/errors) — auth-related error codes
- [Dashboard → API keys](/dashboard/api-keys)
---
## Source: integrate/getting-started/errors.mdx
---
title: Errors
description: A quick tour of how Nora reports failures; see Core Concepts for the full reference.
---
Nora uses conventional HTTP status codes and returns JSON error bodies
on every non-2xx response. A minimal example:
```http
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"code": "BAD_REQUEST",
"message": "evm_destination_wallet_not_authorized"
}
```
The envelope is flat. Two fields are present on every non-2xx response:
- `code` — an upper-case machine string, usually the HTTP class
(`BAD_REQUEST`, `FORBIDDEN`, `NOT_FOUND`, `CONFLICT`,
`VERIFICATION_FAILED`, `TOO_MANY_REQUESTS`, `INTERNAL_ERROR`, …) and
`INVALID_API_KEY` on a `401`.
- `message` — the specific reason. For business rules it is a stable
snake_case slug (as above); branch on it. For validation it is prose.
One optional field: `details` (endpoint-specific; wallet endpoints put
their machine code in `details.code`).
A structural `400` uses a different, validator-generated shape:
`success: false` and an `error[]` with a `path` per problem. Do not log
`data`, it echoes your request body.
A body that is not valid JSON at all currently answers `500`, not `400`.
Do not retry a `500` from a create endpoint blindly: check that the body
you sent parses before retrying.
Status codes follow convention: `400` for malformed requests and rejected
business rules, `401` for missing, invalid, revoked or expired API keys,
`403` for a valid key that is not allowed here (other environment, IP not
on the allowlist), `404` for missing resources, `409`
for conflicts, `422` for on-chain verification failures, `429` for rate
limits, `5xx` for server issues.
For the full breakdown — which codes are retry-safe, common `message`
slugs, and the envelope's edge cases — see
[Error handling](/integrate/core-concepts/error-handling).
---
## Source: integrate/getting-started/index.mdx
---
title: Overview
description: What Nora is and what you'll integrate with the API.
---
Nora is a BRL ↔ crypto rail. Partners integrate the API to move money
in both directions:
- **Onramp** — user pays BRL via PIX; Nora mints **BRS** (a BRL-pegged
token: SPL on Solana, ERC-20 on Ethereum) to a whitelisted wallet.
- **Offramp** — user signs on-chain to burn BRS; Nora pays out BRL via
PIX to a designated fiat destination.
Most integrations also exercise a small set of supporting flows —
whitelisting the wallets that participate in onramp mints and offramp
burns, and monitoring intent status as it moves through compliance,
rail, and on-chain stages.
## Start here
- [Quickstart](/integrate/getting-started/quickstart) — make your first authenticated request in under five minutes.
- [Authentication](/integrate/getting-started/authentication) — API keys and the sandbox vs production split.
- [Core Concepts](/integrate/core-concepts) — the primitives every flow uses.
- [Flows](/integrate/flows) — end-to-end walkthroughs for every integration journey.
- [API Reference](/integrate/api-reference) — every endpoint with request/response shapes and curl examples.
## Two environments
Every org gets a **sandbox** and a **production** instance. They are
fully isolated — separate API keys, separate wallets, separate intent
state. Sandbox calls go to `https://sandbox.api.nora.finance`;
production calls go to `https://api.nora.finance`. Each API key binds
to one instance, so swapping from sandbox to production means swapping
both the base URL and the key.
---
## Source: integrate/getting-started/quickstart.mdx
---
title: Quickstart
description: Make your first Nora API call in under five minutes.
---
## 1. Get an API key
Sign in to the Nora dashboard, switch to the **Sandbox** environment
in the top bar, and open **Settings → API Keys**. Click **New API
key**, copy the secret — it is shown exactly once.
See [Dashboard → API keys](/dashboard/api-keys) for the full UI
walkthrough. Two things the form asks for matter from the first call:
- **Allowed IPs.** Every key has an IP allowlist. Add your server's
egress IP or CIDR before you call anything — see
[Core concepts → Authentication](/integrate/core-concepts/authentication#sandbox-vs-production)
for the fail-closed `403` behavior.
- **Expiry.** Every key has a mandatory expiry date and the dashboard caps
how far out it can be; plan the rotation from day one
([Authentication](/integrate/getting-started/authentication)).
## 2. Make a request
Every call uses the `X-API-Key` header. Let's hit the hello endpoint
to confirm your key works:
```bash
curl https://sandbox.api.nora.finance/v2/hello \
-H "X-API-Key: $NORA_API_KEY"
```
Expected response (`text/plain`):
```
Hello Hono!
```
A `401` means the header is missing, wrong, revoked or expired. A `403`
means the key is valid but not allowed here: it belongs to the other
environment, or your IP is not on its allowlist.
## 3. Fetch your workspace info
```bash
curl https://sandbox.api.nora.finance/v2/info \
-H "X-API-Key: $NORA_API_KEY"
```
The response carries `engine` (always `"v2"`), `legacy` (always `false`),
`capabilities` (`onramp`, `offramp`, `approve-burn`), `flows` (the
version of each flow you will get) and `chains` (the chains your key can
use). It does not name your organization or environment; the key prefix and
the host you called do. Every intent names its chain with `chainId` — see
[BRS token](/integrate/core-concepts/brs-token) for the chains and the
[Intents reference](/integrate/api-reference/intents) for the request.
## Next steps
- [Authentication](/integrate/getting-started/authentication) — key lifecycle, sandbox vs prod
- [Flows → Wallet whitelisting](/integrate/flows/wallet-whitelisting) — the first call every integration makes
- [Flows → Ethereum end-to-end](/integrate/flows/ethereum-end-to-end) — whitelist, mint and burn on Ethereum in one pass
---
## Source: integrate/getting-started/rate-limits.mdx
---
title: Rate limits
description: How Nora throttles excess traffic and how to back off cleanly.
---
Rate limits are enforced per API key. Exceeding a limit returns
`429 Too Many Requests` with a `Retry-After` response header that tells
you how long to wait before retrying.
## Response shape
```http
HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json
{
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests"
}
```
Every response also carries `x-ratelimit-limit`, `x-ratelimit-remaining`
and `x-ratelimit-reset` (a Unix epoch in seconds, not a delay), so you
can slow down before the `429`.
`Retry-After` is in **seconds**. Wait at least that long before
retrying. A client that ignores `Retry-After` and keeps hammering will
simply continue to see `429`s.
## Best practices
- **Respect `Retry-After`.** Don't retry on a `429` without waiting for
the specified delay.
- **Add jitter on backoff.** For high-concurrency callers, jitter on
the retry delay prevents thundering-herd behaviour when many clients
see `429` at once.
- **Use separate keys for separate callers.** Quotas are per-key, so
one noisy caller can't starve another if they're on different keys.
- **Poll at the slowest cadence you can tolerate.** For intent status
polling, 5–10 seconds is typically fine while an intent is in
flight; back off to 30+ seconds once it enters a long-running state
(`requires_compliance`, `scheduled`, `paying_out`).
## Gotchas
- **`429` is transient.** Unlike `401` / `403`, a `429` does not mean
the credentials are wrong — just that too many recent requests used
them. Retry with backoff.
- **`Retry-After` applies to the single failed call, not the account.**
After waiting, you can retry that request; other requests may succeed
sooner depending on the specific quota that tripped.
## See also
- [Error handling](/integrate/core-concepts/error-handling) — other status codes and when to retry
- [Authentication](/integrate/getting-started/authentication) — quotas are per-key
---
## Source: integrate/index.mdx
---
title: Integrate with Nora
description: Everything a backend engineer needs to call the Nora /v2 API.
---
The Integrate track is for partners calling the Nora `/v2` REST API
from a server. It assumes you can make HTTP requests with an
`X-API-Key` header and parse JSON — no SDK required.
Start with:
- [Getting Started → Quickstart](/integrate/getting-started/quickstart) — first
request in under five minutes.
- [Core Concepts → Authentication](/integrate/core-concepts/authentication) —
how `X-API-Key` binds to org + instance.
- [Flows](/integrate/flows) — full integration arcs with curl + sequence
diagrams.
- [API Reference](/integrate/api-reference) — hand-written endpoint reference.
Using the Nora dashboard UI alongside your integration? See the
[Dashboard docs](/dashboard).