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
counterpartyId
ID of the counterparty that will receive the funds (in BUY
operations), or make the payment (in SELL
operations).
settlementId
settlementId
ID of the settlement where the order will be processed.
referenceRate
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
customerRate
Customer rate, representing the referenceRate
plus the spread contracted with the client.
operation
operation
Type of the operation: purchase or sale of a foreign (fiat) currency or crypto asset.
currencyPair
currencyPair
Represents the currency pair being traded:
source
: the currency used for payment.target
: the currency in which the operation will be settled.
paymentAmount
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
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
currentState
Indicates the current state of the order. Each state has specific allowed transitions, as shown below:
Order Status
Status | Description | Possible Transitions |
---|---|---|
CREATED | Order created and awaiting review by the operations team | CANCELLED , PROCESSED |
PROCESSED | Settlement process started, waiting for completion | CANCELLED , COMPLETED |
CANCELLED | Order has been cancelled | — |
COMPLETED | Order 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.
Updated about 2 hours ago