๐ธ Get Price based on User Region
The quoteCountryCode
query parameter is introduced in the Get Price API to optimise fetching the quote for partners. It allows partners to obtain quotes based on the user's KYC region.
Only Alpha-2 Country Codes are supported for
quoteCountryCode
.
Benefits of quoteCountryCode
quoteCountryCode
This query parameter enables partners to request a quote based on the user's KYC region. Without this, quotes may differ due to regional variations in pricing.
Why is this Important?
- Ensures consistency between quotes from the Get Price API and the Transak Widget.
- Provides more accurate, region-specific pricing information.
How quoteCountryCode
works?
quoteCountryCode
works?By including the quoteCountryCode
in the query parameters, partners will receive a regionally adjusted and more precise quote.
Usage Scenarios
Scenario 1: When userData
query params are used to share the KYC information**
userData
query params are used to share the KYC information**When the user's KYC information is passed using the userData and the user's country is known, then the quoteCountryCode
query param can be passed to match the user's country code.
Example: If the user's KYC country is France, quoteCountryCode
can be set to FR.
Scenario 2: User KYC country is unknown or userData
query params are not used**
userData
query params are not used**If the partner does not have the user's KYC country information, then the quoteCountryCode
can be passed based on the user's IP address.
Example: If the user is located in Italy , then the quoteCountryCode
can be set to IT based on the user's IP.
Sample Request
curl --request GET \
--url 'https://api-stg.transak.com/api/v1/pricing/public/quotes?partnerApiKey=YOUR_API_KEY&fiatCurrency=USD&cryptoCurrency=ETH&isBuyOrSell=BUY&network=ethereum&paymentMethod=credit_debit_card&fiatAmount=100"eCountryCode=FR' \
--header 'accept: application/json'
Sample Response
{
"response": {
"quoteId": "5b42f946-47b4-4bea-9e7e-563488d03333",
"conversionPrice": 1.10475627488855,
"marketConversionPrice": 1.1161162939576061,
"slippage": 1.02,
"fiatCurrency": "EUR",
"cryptoCurrency": "USDC",
"paymentMethod": "credit_debit_card",
"fiatAmount": 100,
"cryptoAmount": 107.68,
"isBuyOrSell": "BUY",
"network": "arbitrum",
"feeDecimal": 0.0253,
"totalFee": 2.53,
"feeBreakdown": [
{
"name": "Transak fee",
"value": 2.51,
"id": "transak_fee",
"ids": [
"transak_fee"
]
},
{
"name": "Network/Exchange fee",
"value": 0.02,
"id": "network_fee",
"ids": [
"network_fee"
]
}
],
"nonce": 1727442044,
"cryptoLiquidityProvider": "transak",
"notes": []
}
}
Flow Usages
User flow | KYC Country Code | IP Country Code | quoteCountryCode | Quote Accuracy |
---|---|---|---|---|
When the KYC and IP Country are same (Scenario 1) | US | US | US | โ |
When the KYC and IP Country are not same (Scenario 1) | US | UK | US | โ |
When KYC Country is unknown (Scenario 2) Note: This might not produce the best result considering that KYC country is unknown and the user location might be different than the actual KYC Country. | N/A | UK | UK | ๐ฉ |
Updated 3 months ago