4. Create a Quote
Payout Methods
A quote is an estimate that locks the exchange rate and associated fees for a currency conversion or fund transfer transaction. It is a crucial value to determine how much the recipient will receive in the target currency and secures these conditions for a set period, protecting both the sender and the platform from market fluctuations.
Key Functions of a Quote
- Exchange Rate Lock: The quote sets the exchange rate for the transaction and keeps it fixed for a specific period.
- Fee Calculation: It includes all commissions and fees applied to the transaction, both visible and those embedded in the exchange rate.
- Condition Locking: Ensures that the conditions of the quote remain stable even if the market fluctuates.
- Reference for Future Orders: It is used as a reference when creating an order so that the transaction conditions match those specified in the quote.
Creating a Quote
The process of creating a quote requires sending a request to the appropriate endpoint with the necessary information to calculate the exchange rate and fees. Below is the body request and response structure.
Body Request to Create a Quote
To create a quote, the following data must be sent:
{
"sourceCurrency": "USDT",
"targetCountry": "VE",
"targetCurrency": "VES",
"amount": 1000,
"payoutType": "P2P_PHONE_TRANSFER",
"amountType": "SOURCE"
}
Field Descriptions
- sourceCurrency: The currency from which the amount will be converted.
- targetCountry: The destination country of the transaction.
- targetCurrency: The currency into which the amount will be converted.
- amount: The amount of money to convert.
- payoutType: The name of the payout platform, obtained from the
platformName
of the payout method. - amountType: Specifies whether the amount is in the source currency (
SOURCE
) or in the target currency (TARGET
).
Endpoint Response
The quotation endpoint will return a JSON object with the following structure:
{
"id": "84",
"quotationBackendId": "0b3d6f36-3f75-4bf7-8b0e-b452499a7fec",
"sourceAmount": 1000,
"targetAmount": 38148.216,
"convertAmount": 1000,
"value": 39.2,
"createdTime": "2024-09-24T02:29:25.780Z",
"updatedTime": "2024-09-24T02:29:25.780Z"
}
Field Descriptions in the Response
- id: Unique identifier of the quote.
- sourceAmount and targetAmount: The source and target amounts of the transaction.
- value: The applied exchange rate.
- convertAmount: Amount to convert after fees and commissions.
- createdTime and updatedTime: The times when the quote was created and updated.
Payout Methods
Once a quote is generated, its id
is used as a reference to create an actual order, ensuring that the transaction conditions remain as agreed in the initial quote.
You can retrieve the status and details of an existing quote using the endpoint Get Quotation by ID. This process will allow you to track and obtain updated information about the transaction as it progresses through different states.