Skip to main content

Gateway API — Flow Examples

All endpoints require authentication via API key and signature.
Migrating from a previous version? See the Migration Guide for a breakdown of what changed (rails/transaction-type vocabulary, renamed paths, response shapes) and the deadlines for deprecated endpoints.

Response structure

All endpoints return the same flat, client-friendly envelope:
  • On success: error_code and message are null; data holds the payload.
  • On error: error_code and message are populated; data is null (or contains field-level details when applicable).
List endpoints embed pagination inside data alongside results (or a custom wrapper key):
Cursor-paginated endpoints (see high-volume flows) return nc / pc instead of pagination:
nc = next cursor, pc = previous cursor. These are opaque base64 tokens — the client must pass them back verbatim via ?cursor=<token> without parsing them.

Flow 1: Crypto Send

To perform a crypto send you need the network and the network_fee for the currency being sent. Both are retrieved from the networks endpoint.

Step 1 — Fetch available networks for the currency

Required permission: general_data_read
Response:
Relevant fields to extract:
  • network.code → value to use in gateway_data.network of the send request
  • fee → value to use in network_fee of the send request
  • send: true → confirms that sending is enabled for that network
  • network.use_memo → indicates whether a memo_id must be included

Step 2 (optional) — Verify the crypto rail is enabled

Required permission: general_data_read
The legacy GET /transactions/gateways/ still works as a deprecated alias returning the same response. swap is now grouped under rail: "ripio".
Response:
Verify that enabled: true, account_enabled: true, and blocked: false.

Step 3 — Execute the send

Required permission: withdrawal_write
The legacy POST /transactions/crypto/send/ still works as a deprecated alias until August 15, 2026.
Body (using data from Step 1 — Tron network):
Note on OTP code: otp_code parameter is NOT needed for send to a whitelisted address. Addresses can be whitelisted from Ripio App. Public endpoint to whitelist addressess and bank accounts is coming soon.
Note on network fee: Although the backend validates network_fee, the client must send it explicitly (retrieved from the network endpoint). This allows knowing the total cost of the operation (amount + network_fee) upfront before confirming it. Without this value, the backend would deduct the fee from the sent amount and the recipient would receive less than expected. The network_fee value is honored as long as the transaction is accepted.
Response (201 Created):
transaction_hash is null until the withdrawal is broadcast on-chain; once broadcast it holds the on-chain hash.
Note on memo networks: For networks that use a memo such as XRP (use_memo: true), memo_id must be included in gateway_data.
Business rule errors:
When there are errors in multiple fields, error_code/message surface the first one (useful for a toast notification) and data preserves the full structure for mapping errors to each form input.

Flow 2: CVU Withdrawal (Argentina)

Only available for accounts with country: AR and an assigned CVU. Withdraws ARS to a previously verified CVU/CBU bank account.

Step 1 — Fetch gateway limits

Required permission: general_data_read
Response:
An unlimited period is returned as null (e.g. annual_amount above), never the internal -1. currency is never null: it is the user’s fiat (or USDT for swap).
Verify that the amount to withdraw is between min_amount and max_amount, and that remaining.daily_amount is sufficient.

Step 2 — Execute the CVU withdrawal

Required permission: withdrawal_write
The legacy POST /transactions/bank-transfer-cvu/withdrawal/ still works as a deprecated alias until August 15, 2026.
Body:
bank_account can be an alias, CBU, or external CVU as the destination.
Note on OTP code: otp_code parameter is only needed for transfers to third party accounts. Endpoint to whitelist (no need for OTP) bank accounts coming soon.
Response (201 Created):
extra_data only exposes operational keys (provider_reference, bank_account, bank_name). No personal data is included.
Business rule errors:

Flow 3: PIX Withdrawal (Brazil)

Only available for accounts with country: BR. Withdraws BRL using a destination PIX key.

Step 1 — Fetch gateway limits

Required permission: general_data_read
Response:

Step 2 — Execute the PIX withdrawal

Required permission: withdrawal_write
Body:
Note on OTP code: otp_code is only required for transfers to third-party PIX keys above the configured amount threshold. For PIX keys registered to the user’s own account, it can be omitted.
Valid pix_key examples:
  • CPF: "123.456.789-00" or "12345678900"
  • Email: "[email protected]"
  • Phone: "+5511999990000"
  • Random key (EVP): "e5f3b2a1-4c6d-11ed-bdc3-0242ac120002"
Response (201 Created):
Business rule errors:

Flow 4: Transaction queries

List transactions with filters

Required permission: general_data_read
Each item is the full transaction body (same shape as the create response and the detail endpoint). Fields are abbreviated below for readability.
Response (cursor pagination):
The nc and pc tokens are opaque (URL-safe base64). The client passes them back verbatim via ?cursor=<token>. Do not attempt to parse or modify them.
Next page:
Available query parameters:

Fetch a transaction detail

Response (same rich body as the create response):
When the transaction does not exist:

Possible transaction statuses


Flow 5: Balance check before operating

Before executing any operation, it is recommended to verify the available balance. Required permissions: general_data_read, balance_read
Response:
  • amount: available balance (the amount that can be used in operations)
  • locked_amount: funds reserved by open orders

Generic error codes

When the upstream service does not return a specific {code, detail} atom (e.g. authentication errors or DRF-level errors), the gateway falls back to generic codes mapped by HTTP status: Example response when no valid credentials are provided:
Domain-specific codes (TXN_0420, CURR_0002, CVU_1000, etc.) are passed through unchanged from the upstream microservice. ERR_XXXX codes only appear when no specific code is found.
For more information on error codes, refer to the Errors page.

Quick endpoint reference

Account state: write endpoints (and the banking/contacts resources) additionally require a fully operative account; country-restricted endpoints (CVU = AR, PIX = BR) enforce the account’s country.
Legacy paths (removed August 15, 2026): the write/quote paths and banking/deposit-accounts/ replace their legacy equivalents — crypto/send/, bank-transfer-cvu/withdrawal/, balance/send/, balance/swap/, promises/, transactions/gateways/, banking/cvu/, banking/pix/ — which keep working (with a Deprecation header) until that date.