Guides
FX payments
Convert and pay a counterparty in a single order, funded by balance or by a deposit.
An FX payment puts in one order the source of funds (balance or a new deposit), the currency conversion (when there is one) and the destination (a payout to a counterparty or a credit to one of the customer's own accounts). Compliance approves the order before any money leaves.
Before you create one
- To pay a counterparty, its relation must be
Approvedand it must have abankInformationin the target currency. See Counterparties and whitelist. - If the currencies differ, request a quote first (see Trade) and send its
orderIdasquoteId. Currencies and amounts then come from the quote. - The customer needs an account in each currency involved.
Fields
| Field | Values |
|---|---|
fundingType | 1 / Balance (debits the balance) or 2 / Deposit / DepositOrder (creates a deposit) |
fundingCurrency, targetCurrency, fundingAmount | Required when there is no quoteId (and the currencies must match) |
quoteId | Required when the currencies differ |
counterpartyId, bankInformationId | Who receives and on which account; bankInformationId is required with noWithdrawal: false |
noWithdrawal | true credits the final amount to one of the customer's own accounts, with no withdrawal |
trueSenderType, trueReceiverType | 1 (Customer) or 2 (Counterparty) |
Pay a counterparty from balance
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/orders/fx-payment \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"fundingType": 1,
"fundingCurrency": "BRL",
"targetCurrency": "BRL",
"fundingAmount": 1000,
"counterpartyId": 1084,
"bankInformationId": 1083,
"trueSenderType": 1,
"trueReceiverType": 2,
"noWithdrawal": false
}'The response (201) is the order, with no envelope:
{
"id": 1090,
"customerId": 1001,
"counterpartyId": 1084,
"fundingType": "Balance",
"fundingCurrency": "BRL",
"fundingAmount": 1000,
"targetCurrency": "BRL",
"targetAmount": 1000,
"quoteId": null,
"depositOrderId": null,
"bankInformationId": 1083,
"withdrawalOrderId": null,
"trueSenderType": "Customer",
"trueReceiverType": "Counterparty",
"noWithdrawal": false,
"status": "PENDING_APPROVAL",
"customerStatus": "PENDING_APPROVAL",
"statusDescription": "Awaiting compliance review.",
"orderHistory": [
{ "statusName": "PENDING_APPROVAL", "description": "Awaiting compliance review.", "createdAt": "2026-11-05T20:13:13.424Z" }
]
}The funding amount is held. After approval, Mimicr creates a withdrawal to the counterparty's account (withdrawalOrderId) and the FX payment ends COMPLETED when that withdrawal settles.
Convert into your own account
Request a Buy quote for 50 USD paid in BRL and use its orderId as quoteId, with noWithdrawal: true:
curl -X POST https://bloquo.mimicr.dev/api/v1/customer/1001/orders/fx-payment \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"fundingType": 1, "quoteId": "8512bd59-83c6-4b4c-8c51-7e4b315b70b8", "noWithdrawal": true, "trueReceiverType": 1}'The order comes out with fundingAmount: 261.3 (BRL), targetAmount: 50 (USD) and quoteRate: 5.226. On approval, the trade is executed and the customer's USD account is credited.
Lifecycle
| From | Event | To |
|---|---|---|
| (creation) | Balance funding: the amount is held | PENDING_APPROVAL |
| (creation) | DepositOrder funding: a deposit is created (depositOrderId) | WAITING_FUNDS |
WAITING_FUNDS | the deposit is paid | PENDING_APPROVAL |
PENDING_APPROVAL | compliance approves; the trade runs if the currencies differ | WAITING_WITHDRAWAL (withdrawal created) |
PENDING_APPROVAL | approved with noWithdrawal: true | COMPLETED |
WAITING_WITHDRAWAL | the withdrawal settles | COMPLETED |
WAITING_WITHDRAWAL | the withdrawal fails | FAILED |
PENDING_APPROVAL | compliance rejects | REJECTED |
GET .../orders/fx-payment/{orderId}/history returns this history as an array with no envelope. The FxPayment webhook goes out on every change, only to the FxPayment preference.
Bloquo doesn't document what happens if the funding deposit expires, nor when the FxPayment webhook fires. In Mimicr, an EXPIRED funding deposit takes the FX payment to REJECTED, and the webhook goes out on every status change.
Errors
| HTTP | message |
|---|---|
| 400 | QuoteId is required. |
| 400 | Failed to accept trade quote. (quote expired, used or from another customer) |
| 400 | Counterparty '<id>' not found for customer '<id>'. |
| 400 | Bank information currency 'X' does not match target currency 'Y'. |
| 400 | BankInformationId is required when noWithdrawal is false. |
| 400 | Insufficient balance to process order. |
| 422 | Counterparty is not in Approved status. |
| 404 | FxPaymentOrder not found. (on lookup) |
Test the scenarios
In Mimicr, compliance approves about 3 seconds later (autoApproveFxPayments). To decide yourself, turn the toggle off and use:
npx mimicr action bloquo fxpayment.approve fxPaymentId=1090 npx mimicr action bloquo fxpayment.reject fxPaymentId=1090 reason="Insufficient documentation"
With deposit funding, pay the created deposit (depositOrderId) with deposit.pay, or let the simulated payer pay on its own. To make the final payout fail, fail the generated withdrawal (withdrawalOrderId) with withdrawal.fail. And to wait for the end:
npx mimicr wait bloquo delivery order_type=FxPayment order_id=1090 event=COMPLETED
Reference: Create FX payment order, Get FX payment order, Get FX payment order history, List FX payment orders, List child FX payment orders.