Order (V2)

Available since API version 2

An order represents a request to buy (BUY) or sell (SELL) a foreign currency or crypto asset. Orders created via the API are registered and must be processed and grouped by the operations team into a settlement.

Each order contains all the necessary information to ensure the operation is properly processed, including amounts involved and counterparty data.

Main Properties

counterpartyId

ID of the counterparty that will receive the funds (in BUY operations), or make the payment (in SELL operations).

settlementId

ID of the settlement where the order will be processed.

referenceRate

Reference rate, expressed in BRL, representing the value of one unit of the foreign currency or crypto asset being traded.
Used to calculate both paymentAmount and receivingAmount.

customerRate

Customer rate, representing the referenceRate plus the spread contracted with the client.

operation

Type of the operation: purchase or sale of a foreign (fiat) currency or crypto asset.

currencyPair

Represents the currency pair being traded:

  • source: the currency used for payment.
  • target: the currency in which the operation will be settled.

paymentAmount

Amount the client must pay to complete the settlement:

  • For BUY operations: expressed in BRL.
  • For SELL operations: expressed in the foreign currency or crypto asset being sold.

receivingAmount

Amount the client will receive:

  • For BUY operations: expressed in the foreign currency or crypto asset being purchased.
  • For SELL operations: expressed in BRL.

currentState

Indicates the current state of the order. Each state has specific allowed transitions, as shown below:

Order Status

StatusDescriptionPossible Transitions
CREATEDOrder created and awaiting review by the operations teamCANCELLED, PROCESSED
PROCESSEDSettlement process started, waiting for completionCANCELLED, COMPLETED
CANCELLEDOrder has been cancelled
COMPLETEDOrder has been successfully settled

Simulation

This functionality allows users to input the same parameters used for creating a new buy or sell order to simulate the operation. The simulation provides users with detailed estimates of payment and receipt amounts that would result if the transaction were executed with those parameters. This feature enables users to make informed decisions by previewing the financial outcomes before committing to an actual order.