Guides
Payments

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 Approved and it must have a bankInformation in the target currency. See Counterparties and whitelist.
  • If the currencies differ, request a quote first (see Trade) and send its orderId as quoteId. Currencies and amounts then come from the quote.
  • The customer needs an account in each currency involved.

Fields

FieldValues
fundingType1 / Balance (debits the balance) or 2 / Deposit / DepositOrder (creates a deposit)
fundingCurrency, targetCurrency, fundingAmountRequired when there is no quoteId (and the currencies must match)
quoteIdRequired when the currencies differ
counterpartyId, bankInformationIdWho receives and on which account; bankInformationId is required with noWithdrawal: false
noWithdrawaltrue credits the final amount to one of the customer's own accounts, with no withdrawal
trueSenderType, trueReceiverType1 (Customer) or 2 (Counterparty)

Pay a counterparty from balance

bash
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:

json
{
  "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:

bash
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

FromEventTo
(creation)Balance funding: the amount is heldPENDING_APPROVAL
(creation)DepositOrder funding: a deposit is created (depositOrderId)WAITING_FUNDS
WAITING_FUNDSthe deposit is paidPENDING_APPROVAL
PENDING_APPROVALcompliance approves; the trade runs if the currencies differWAITING_WITHDRAWAL (withdrawal created)
PENDING_APPROVALapproved with noWithdrawal: trueCOMPLETED
WAITING_WITHDRAWALthe withdrawal settlesCOMPLETED
WAITING_WITHDRAWALthe withdrawal failsFAILED
PENDING_APPROVALcompliance rejectsREJECTED

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

HTTPmessage
400QuoteId is required.
400Failed to accept trade quote. (quote expired, used or from another customer)
400Counterparty '<id>' not found for customer '<id>'.
400Bank information currency 'X' does not match target currency 'Y'.
400BankInformationId is required when noWithdrawal is false.
400Insufficient balance to process order.
422Counterparty is not in Approved status.
404FxPaymentOrder 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:

bash
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:

bash
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.