API Reference
Counterparties and FX payments

Create FX payment order

POST/api/v1/customer/{customerId}/orders/fx-payment
Base URL: https://bloquo.mimicr.dev · provider: https://api.bloquo.io

Creates an FX payment order, currency exchange with bank delivery, or a direct same-currency transfer, to a registered counterparty or internal account. Same-currency transfers skip the trade step; cross-currency transfers require a quote from POST /api/v1/trade/customer/{customerId}/quote (valid ~30s, single-use).

Ciclo de vida do pedido

Campos-chave

CampoTipoDescrição
quoteIduuidID da cotação de /trade/quote. Obrigatório para cross-currency.
fundingTypeint1=Balance (saldo existente) / 2=Deposit (cria ordem de depósito)
fundingAmountnumberValor de funding. Para same-currency sem quoteId.
fundingCurrencystringMoeda de origem dos fundos.
targetCurrencystringMoeda de destino para o beneficiário.
targetAmountnumberValor recebido pelo beneficiário (calculado pela cotação).
bankInformationIdint64ID das informações bancárias do contraparte. Obrigatório se noWithdrawal=false.
noWithdrawalbooltrue = credita internamente sem transferência externa ao banco.
trueSenderTypeint1=Customer / 2=Counterparty. Remetente econômico real (compliance).
trueReceiverTypeint1=Customer / 2=Counterparty. Beneficiário econômico real (compliance).
counterpartyIdint64ID do contraparte registrado para este customer.
customerStatusstringStatus legível para exibição na UI.
statusstringStatus técnico para lógica de negócio.

Padrões de uso

  1. Subaccount → Counterparty (pagamento externo cross-currency): fundingType:1, trueSenderType:1, trueReceiverType:2, counterpartyId definido, bankInformationId definido, noWithdrawal:false. Inclua quoteId para cross-currency.
  1. Payin interno (subaccount → master, noWithdrawal=true, fundingType=2): fundingType:2, trueReceiverType:1, noWithdrawal:true. Sem bankInformationId. Lifecycle: WAITING_FUNDS → PENDING_APPROVAL → COMPLETED.
  1. Payout externo (master → beneficiário, bankInformationId obrigatório): trueReceiverType:2, bankInformationId definido (BankAccount ou Wallet), noWithdrawal:false. Modele o titular da sub-account como Counterparty com suas próprias informações bancárias.
  1. Onramp/Offramp interno (sem counterparty externo): noWithdrawal:true, trueReceiverType:1. Sem counterparty necessário. Liquida em PENDING_APPROVAL → COMPLETED após execução do trade.
  1. Trade isolado + saque separado (operações em nome próprio): Ignore este endpoint, use POST /trade/quote → POST /trade/execute → POST /orders/withdrawal separadamente.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

customerIdinteger<int64>required

Body

application/json
objectrequired

Responses

201FX payment order created.
idinteger<int64>
Example: 400
customerIdinteger<int64>
Example: 42
counterpartyIdinteger<int64>
Example: 5
fundingTypestring

How the FX payment is funded. - Balance, deducted from existing account balance (requires compliance approval). - DepositOrder, a new deposit order is created to fund the FX payment.

BalanceDepositOrder
fundingOwnerTypestring

Whether the funding source belongs to a Customer or a Counterparty.

CustomerCounterparty
fundingOwnerIdinteger<int64>
Example: 42
fundingCurrencystring
Example: "BRL"
fundingAmountnumber
Example: 10000
targetCurrencystring
Example: "USD"
targetAmountnumber | null
Example: 1950
quoteIdstring<uuid> | null
Example: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
quoteRatenumber | null
Example: 5.1282
quoteExpiresAtstring<date-time> | null
quoteAcceptedAtstring<date-time> | null
tradeIdstring | null
depositOrderIdinteger<int64> | null

Deposit order created to fund this FX payment (only when fundingType = DepositOrder).

bankInformationIdinteger<int64> | null
withdrawalOrderIdinteger<int64> | null

Withdrawal order delivering funds to the counterparty.

Example: 301
trueSenderTypestring

Who owns the funding source or is the true sender/receiver.

CustomerCounterparty
trueSenderIdinteger<int64>
Example: 42
trueReceiverTypestring

Who owns the funding source or is the true sender/receiver.

CustomerCounterparty
trueReceiverIdinteger<int64>
Example: 5
noWithdrawalboolean

When true, the outgoing withdrawal step was skipped.

Example: false
attachmentsApprovedboolean
Example: false
attachmentsUrlsstring[]

URLs of compliance documents attached to this order.

statusstring

Lifecycle status of an order. Key statuses: - PENDING_DEPOSIT, awaiting payment confirmation from the bank (FIAT deposits with auto-execute). - PENDING_TREASURY, manually reviewed or crypto orders waiting for treasury action. - WAITING_FUNDS, FX payment waiting for the funding deposit to be confirmed. - PENDING_APPROVAL, FX payment awaiting compliance review. - COMPLETED, order fully settled. - FAILED / REJECTED / EXPIRED: terminal failure states.

18 values
CREATEDACCEPTEDPENDING_DEPOSITPENDING_APPROVALPENDING_TREASURYSENT_TO_CONNECTORPENDING_IN_BANKPROCESSINGCOMPLETEDFAILEDCANCELLEDPROCESSING_REFUNDRETURNEDEXPIREDBLOCKEDREJECTEDWAITING_FUNDSWAITING_WITHDRAWAL
customerStatusstring | null

Human-readable status label for display.

Example: "COMPLETED"
statusDescriptionstring | null
orderHistoryobject[]

Status change history for this order, oldest first.

Show child attributes
statusNamestring
Example: "COMPLETED"
descriptionstring | null
Example: "Approved by compliance"
createdAtstring<date-time>
Example: "2024-01-15T10:31:00Z"
createdBystring
Example: "user@acme.com"
lastUpdatedBystring
Example: "System"
createdAtstring<date-time>
Example: "2024-01-15T10:30:00Z"
lastUpdatedAtstring<date-time>
Example: "2024-01-15T10:32:00Z"
400Business validation failed. Common reasons: - Quote expired or already used - Counterparty not registered for this customer - Missing or invalid request fields
statusboolean
resultany | null
messagestring