API Reference
Create FX payment order
/api/v1/customer/{customerId}/orders/fx-paymenthttps://bloquo.mimicr.dev · provider: https://api.bloquo.ioCreates 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
| Campo | Tipo | Descrição |
|---|---|---|
quoteId | uuid | ID da cotação de /trade/quote. Obrigatório para cross-currency. |
fundingType | int | 1=Balance (saldo existente) / 2=Deposit (cria ordem de depósito) |
fundingAmount | number | Valor de funding. Para same-currency sem quoteId. |
fundingCurrency | string | Moeda de origem dos fundos. |
targetCurrency | string | Moeda de destino para o beneficiário. |
targetAmount | number | Valor recebido pelo beneficiário (calculado pela cotação). |
bankInformationId | int64 | ID das informações bancárias do contraparte. Obrigatório se noWithdrawal=false. |
noWithdrawal | bool | true = credita internamente sem transferência externa ao banco. |
trueSenderType | int | 1=Customer / 2=Counterparty. Remetente econômico real (compliance). |
trueReceiverType | int | 1=Customer / 2=Counterparty. Beneficiário econômico real (compliance). |
counterpartyId | int64 | ID do contraparte registrado para este customer. |
customerStatus | string | Status legível para exibição na UI. |
status | string | Status técnico para lógica de negócio. |
Padrões de uso
- Subaccount → Counterparty (pagamento externo cross-currency):
fundingType:1, trueSenderType:1, trueReceiverType:2, counterpartyIddefinido,bankInformationIddefinido,noWithdrawal:false. IncluaquoteIdpara cross-currency.
- Payin interno (subaccount → master, noWithdrawal=true, fundingType=2):
fundingType:2, trueReceiverType:1, noWithdrawal:true. SembankInformationId. Lifecycle:WAITING_FUNDS → PENDING_APPROVAL → COMPLETED.
- Payout externo (master → beneficiário, bankInformationId obrigatório):
trueReceiverType:2, bankInformationIddefinido (BankAccount ou Wallet),noWithdrawal:false. Modele o titular da sub-account como Counterparty com suas próprias informações bancárias.
- Onramp/Offramp interno (sem counterparty externo):
noWithdrawal:true, trueReceiverType:1. Sem counterparty necessário. Liquida emPENDING_APPROVAL → COMPLETEDapós execução do trade.
- Trade isolado + saque separado (operações em nome próprio): Ignore este endpoint, use
POST /trade/quote→POST /trade/execute→POST /orders/withdrawalseparadamente.
Authorization
Bearer token in the Authorization: Bearer <token> header. See Authentication.
Path parameters
Body
application/jsonResponses
201FX payment order created.
400425How 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.
BalanceDepositOrderWhether the funding source belongs to a Customer or a Counterparty.
CustomerCounterparty42"BRL"10000"USD"1950"3fa85f64-5717-4562-b3fc-2c963f66afa6"5.1282Deposit order created to fund this FX payment (only when fundingType = DepositOrder).
Withdrawal order delivering funds to the counterparty.
301Who owns the funding source or is the true sender/receiver.
CustomerCounterparty42Who owns the funding source or is the true sender/receiver.
CustomerCounterparty5When true, the outgoing withdrawal step was skipped.
falsefalseURLs of compliance documents attached to this order.
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_WITHDRAWALHuman-readable status label for display.
"COMPLETED"Status change history for this order, oldest first.
Show child attributes
"COMPLETED""Approved by compliance""2024-01-15T10:31:00Z""user@acme.com""System""2024-01-15T10:30:00Z""2024-01-15T10:32:00Z"