Skip to main content

Customer Payouts

Customer Payouts let you send outgoing IBAN transfers to your customers in batches of up to 100 transactions. This feature is designed for merchants in Costa Rica that need to issue mass payments to their customers efficiently and securely.

Available endpoints​

Every endpoint requires your Secret API Key (Authorization: Bearer onvo_..._secret_key_...).

MethodPathUse
POST/v1/customer-payouts/batchCreates a batch of transfers.
GET/v1/customer-payouts/batch/{batchId}Returns the status of the batch and of each transaction.
GET/v1/customer-payouts/accountLists your account's batches in the key's mode, with pagination.
GET/v1/customer-payouts/configReturns your account's Customer Payouts configuration.
GET/v1/customer-payouts/statisticsReturns counts and amounts grouped by batch status.
GET/v1/customer-payouts/balanceReturns the balance of each origin account, what is in progress, and what you can still send.

Prerequisites​

Requirementtest modelive mode
Costa Rica account: the feature is only available for accounts registered in Costa Rica.YesYes
Secret API Key: every operation is authenticated with your Secret API Key for that mode.YesYes
Feature enabled: activated by the ONVO team. Contact support to request it.NoYes
Origin account configured per currency: for every currency you will use (USD and/or CRC), ONVO configures the origin IBAN and its holder's identification. If either is missing for the batch currency, the batch is rejected.NoYes

You can start integrating in test mode without any prior setup from ONVO. Activation and origin accounts are only needed to go live, and you can check them with GET /v1/customer-payouts/config.

GET /v1/customer-payouts/config returns the same configuration with the test key and the live key, and it always describes the live state. If your account has no configuration yet, your first test batch creates a default one with enabled: false and no origin accounts. That does not enable live mode.

Supported currencies​

  • USD: US dollars.
  • CRC: Costa Rican colones.

In live mode, each currency needs its own origin account configured. Not every destination account accepts USD: if the recipient's account does not support the currency, the transaction fails individually with the code returned by the banking network.

Limits and restrictions​

Batch limits​

  • Minimum 1 and maximum 100 transactions per batch.
  • All transactions in a batch must use the same currency.

Transaction limits​

Amounts are sent in cents, as a numeric string (for example, "10000").

USD (US dollars):

  • Minimum: $1.00 USD (100 cents).
  • Maximum: $500,000.00 USD (50000000 cents).

CRC (Costa Rican colones):

  • Minimum: ₡500.00 CRC (50000 cents).
  • Maximum: ₡250,000,000.00 CRC (25000000000 cents).

IBAN format​

  • Only Costa Rican IBANs are accepted.
  • Format: CR[0-9]{2}[0-9]{15,22}.
  • Example: CR05015202001026284066.

Transaction fields​

FieldRequiredDescription
recipientIbanYesRecipient's Costa Rican IBAN.
recipientIdTypeYesRecipient's identification type, from 0 to 6. See identification types.
recipientIdNumberYesIdentification number, in the format that matches recipientIdType.
recipientNameNoName of the destination account holder, 8 to 150 characters. Recommended: if you omit it, a generic name derived from the identification is sent.
amountYesAmount in cents, as a numeric string.
currencyYesUSD or CRC.
referenceNoTransfer description, 15 to 200 characters. If you omit it, Customer payout - {transactionId} is used.

The body does not accept extra fields: any property not listed in this table returns a 400 error.

Identification types​

The recipientIdType field sets the format recipientIdNumber must have:

ValueTypeFormatExample
0National ID0#-####-####01-1393-1919
1Resident (DIMEX)1 followed by 11 digits129381746112
2State entity2-###-######2-100-000001
3Legal entity3-###-######3-101-212393
4Autonomous institution4-000-######4-000-042141
5Diplomat5 followed by 11 digits512345678901
6Foreigner9 followed by up to 17 characters9CA9381461127

Fees and balance​

Each transaction may carry a fee, according to the configuration ONVO set for your account (feeType, feeAmount, minFee, maxFee, and feeCurrency in GET /v1/customer-payouts/config):

  • fixed: feeAmount is a fixed amount in cents per transaction.
  • percentage: feeAmount is in basis points (150 = 1.50% of the amount), bounded by minFee and maxFee when they are set.

The fee is calculated and frozen when the batch is created. The create response includes totalCommissionAmount and commissionCurrency, and each transaction in the batch status includes commissionAmount and commissionCurrency.

When the batch is created, the amount of each transaction and its fee are debited from your balance. If a transaction fails, or the whole batch is rejected, the amount and the fee of those transactions are returned to your balance. A completed transaction keeps the debit.

Origin account balance​

GET /v1/customer-payouts/balance tells you how much you can send from each configured origin account before you create a batch.

curl https://api.onvopay.com/v1/customer-payouts/balance \
-H "Authorization: Bearer $ONVO_SECRET_KEY"

200 response:

{
"data": [
{
"currency": "CRC",
"iban": "CR05015202001026284066",
"status": "available",
"balance": "1500000",
"pendingAmount": "250000",
"availableAmount": "1250000"
},
{
"currency": "USD",
"iban": "CR05015202001026284077",
"status": "unavailable",
"balance": null,
"pendingAmount": "0",
"availableAmount": null
}
],
"retrievedAt": "2026-10-27T00:46:58.007Z"
}

Each entry is one currency with a configured origin account:

FieldDescription
currencyCurrency of the origin account (CRC or USD).
ibanIBAN of the origin account your transfers in that currency are sent from.
statusavailable, or unavailable when the balance could not be read right now.
balanceAvailable balance of the account, in cents. null when status is unavailable.
pendingAmountSum, in cents, of your transfers from that account that are still pending or processing. Fees are not included: they are charged to your ONVO balance.
availableAmountbalance minus pendingAmount: what you can still send. It can be negative when in-progress transfers exceed the balance. null when status is unavailable.
  • It is a read at request time and reserves no funds: creating a batch still runs its own checks.
  • If an account comes back unavailable, retry later. One currency failing does not affect the others.
  • Only currencies with a configured origin account are listed.
  • In test mode, each test origin account has a simulated balance of 10,000,000.00 and pendingAmount follows your test batches.
  • If your account has no Customer Payouts configuration, you get a 400 with code: "customer_payouts.not_configured". The feature does not need to be enabled.

Batch statuses​

A payout batch moves through the following statuses:

  • pending: batch created, waiting to be processed.
  • processing: the batch was submitted and its transactions are being processed.
  • completed: every transaction finished processing. This does not mean all of them succeeded: check the status of each transaction.
  • failed: the whole batch was rejected on submission or could not be processed. Its transactions end up failed.

Transaction statuses​

Each transaction within a batch can have the following statuses:

  • pending: transaction created or registered, waiting to be paid.
  • processing: the transaction is held in processing.
  • completed: transaction completed successfully.
  • failed: the transaction was rejected. Check errorCode and errorMessage.

completed and failed are final: a transaction that reached one of them never changes again.

Asynchronous processing​

Batches are processed asynchronously, in both live and test mode:

  1. When you create a batch, you get a 201 response with the batchId and status pending. The outcome is never in the create response.
  2. The batch is processed in the background.
  3. Query GET /v1/customer-payouts/batch/{batchId} until the batch reaches completed or failed. Each query of an in-flight batch also refreshes its status.
  4. Each transaction is resolved individually and has its own outcome.

Do not assume a fixed processing time: poll until the batch reaches a final status.

Test mode​

In test mode the payout is simulated end to end: no money moves and the destination account is never contacted. Even so, the batch goes through the same statuses as a real one, so the integration you build against test mode is the same one that works in production.

Use your test Secret API Key (onvo_test_secret_key_...). You do not need ONVO to enable the feature or configure origin accounts: test batches are always sent from these test origin accounts, even if your account already has real origin accounts configured.

CurrencyOrigin identificationOrigin IBAN
CRC3-101-000001CR00000000000000000001
USD3-101-000001CR00000000000000000002

Fees are still calculated with your account's configuration, so your tests show the fee you will be charged in production. If ONVO has not configured your account yet, the default fee applies.

The destination IBAN decides the outcome​

Test mode only accepts the IBANs in this table. Any other destination is rejected with customer_payouts.invalid_testing_iban, and the error's detail field lists the valid IBANs. The transaction currency must match the IBAN's; otherwise you get customer_payouts.invalid_testing_iban_currency.

Test IBANCurrencyWhat it simulates
CR46016111095130920101CRCThe transfer completes.
CR46016111095130920102USDThe transfer completes.
CR46016111095130920103CRCThe transfer is rejected for insufficient funds.
CR46016111095130920104USDThe transfer is rejected for insufficient funds.
CR46016111095130920105CRCThe transfer is held, then rejected for an invalid destination account.
CR46016111095130920106CRCThe transfer stays pending, then completes.
CR46016111095130920107CRCThe whole batch is rejected on submission.

Status sequence for each scenario​

IBANTransaction statusesFinal batch status
…0101, …0102pending → completedcompleted
…0103, …0104pending → failedcompleted
…0105pending → processing → failedcompleted
…0106pending → pending → completedcompleted
…0107pending → failedfailed
  • …0105 is the only scenario that shows processing on the transaction. Together with …0106 it covers both intermediate readings your integration has to handle.
  • The two-step scenarios (…0105 and …0106) take about twice as long as the rest. This is a fixed internal cadence, not a model of how long a real transfer takes.
  • If a batch includes a …0107 IBAN, the whole batch is rejected and every transaction ends up failed, including those that use other IBANs.
  • The …0103 and …0104 scenarios show that a completed batch can contain failed transactions.

What a failed transaction reports​

IBANerrorCodeerrorMessage
…0103, …010421Fondos Insuficientes
…01054Cuenta destino invalida
…0107-1Error en el envio del lote: simulacion de rechazo en modo prueba

The codes and messages are the ones the banking network returns, which is why they arrive in Spanish and unaccented in production too. Treat errorCode as an opaque string: this set is what test mode can produce, not the full list of rejections a real transfer can hit.

A failed transaction in test mode also returns the amount and the fee to your test balance, just like in production.

  1. Check configuration (live only): query GET /v1/customer-payouts/config to confirm enabled is true and the origin account for the currency is configured. In test mode you can skip this step.
  2. Check the balance (optional): query GET /v1/customer-payouts/balance and confirm the currency's availableAmount covers the batch total.
  3. Prepare the batch: gather between 1 and 100 transactions in the same currency.
  4. Create the batch: send it with POST /v1/customer-payouts/batch.
  5. Store the batchId: you need it to query the outcome.
  6. Check status: use GET /v1/customer-payouts/batch/{batchId} until the batch is completed or failed.
  7. Handle outcomes: process each transaction according to its status. Failed ones carry errorCode and errorMessage, and their amount and fee were already returned to your balance.

Create a batch​

curl https://api.onvopay.com/v1/customer-payouts/batch \
-X POST \
-H "Authorization: Bearer $ONVO_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"transactions": [
{
"recipientIban": "CR46016111095130920101",
"recipientIdType": 0,
"recipientIdNumber": "01-1393-1919",
"recipientName": "María Rodríguez Solano",
"amount": "100000",
"currency": "CRC",
"reference": "Monthly supplier payment"
}
]
}'

201 response:

{
"batchId": "batch_1727800000000_a1b2c3d4",
"status": "pending",
"transactionCount": 1,
"totalAmount": "100000",
"totalCommissionAmount": "300",
"commissionCurrency": "CRC",
"currency": "CRC",
"createdAt": "2026-10-01T16:00:00.000Z"
}

Get a batch status​

curl https://api.onvopay.com/v1/customer-payouts/batch/batch_1727800000000_a1b2c3d4 \
-H "Authorization: Bearer $ONVO_SECRET_KEY"

200 response:

{
"batchId": "batch_1727800000000_a1b2c3d4",
"status": "completed",
"totalAmount": "100000",
"currency": "CRC",
"createdAt": "2026-10-01T16:00:00.000Z",
"processedAt": "2026-10-01T16:00:01.000Z",
"completedAt": "2026-10-01T16:00:06.000Z",
"transactions": [
{
"transactionId": "txn_1727800000000_e5f6a7b8",
"recipientIban": "CR46016111095130920101",
"amount": "100000",
"currency": "CRC",
"commissionAmount": "300",
"commissionCurrency": "CRC",
"status": "completed",
"reference": "Monthly supplier payment",
"errorCode": null,
"errorMessage": null,
"createdAt": "2026-10-01T16:00:00.000Z",
"completedAt": "2026-10-01T16:00:06.000Z"
}
]
}

If the batch does not exist or belongs to another account, you get a 404.

Errors when creating a batch​

There are three shapes of 400 error, depending on where the problem is detected.

Body validation (IBAN format, identification, reference, recipientName, currency, or fields that are not allowed). message is a list with one entry per problem:

{
"statusCode": 400,
"message": ["transactions.0.Invalid IBAN format"],
"error": "Bad Request"
}

Batch or account rules. message is a string and there is no code. The activation and origin account errors only happen in live mode:

messageCause
Customer payouts not configured for this account. Please contact the support team.The feature is not configured for your account (live only).
Customer payouts feature is disabled for this account. Please contact the support team.The feature is disabled (live only).
Customer payouts are only available for Costa Rica accountsThe account is not from Costa Rica.
Origin ID for {currency} is not configured for this accountThe origin identification for the currency is missing (live only).
Origin IBAN for {currency} is not configured for this accountThe origin IBAN for the currency is missing (live only).
Maximum batch size is 100 transactionsThe batch exceeds 100 transactions.
All transactions in a batch must use the same currencyThe batch contains more than one currency.
Minimum amount is {min} cents for {currency}An amount is below the minimum.
Maximum amount is {max} cents for {currency}An amount is above the maximum.

Test mode. Includes a stable code:

codeCause
customer_payouts.invalid_testing_ibanAn IBAN is not one of the test IBANs. detail lists the valid ones.
customer_payouts.invalid_testing_iban_currencyThe currency does not match the test IBAN's.
{
"statusCode": 400,
"type": "OnvoAPIError",
"code": "customer_payouts.invalid_testing_iban_currency",
"message": "The provided transactions contain valid recipientIban number(s), but the currency does not match, make sure to use CRC or USD. Also check the currency is the right for the testing IBAN number provided.",
"detail": "CR46016111095130920102 simulates USD",
"path": "/v1/customer-payouts/batch",
"timestamp": "2026-10-01T16:00:00.000Z"
}

In test mode, the test IBAN check runs before the other batch rules.

Important considerations​

  1. One currency per batch: you cannot mix USD and CRC in the same batch.
  2. Outcome is always asynchronous: the create response always returns pending; you get the outcome by querying the batch.
  3. A completed batch does not mean full success: check the individual status of each transaction.
  4. Per-transaction rejections: errors such as an invalid destination account or a currency the destination account does not support are reported on the transaction (errorCode/errorMessage), not when the batch is created.
  5. Completed transfers cannot be reversed: a completed transfer cannot be reversed through the API.
  6. Statistics: GET /v1/customer-payouts/statistics groups all of the account's batches by status, without separating test and live mode. For per-mode reports, use GET /v1/customer-payouts/account.