Customer country
Using customer_country Query Parameter
In addition to the X-Forwarded-For, you can provide the customer’s country using the customer_country query parameter in the transaction and estimate requests.
This parameter is optional and can be enabled by request — please contact your account manager or [email protected] to activate this feature for your integration.
Why use customer_country?
By default, Guardarian detects the user’s country using their IP address (X-Forwarded-For header). However, if the customer_country query parameter is provided, it will take precedence over the IP-based detection.
This gives you more control over geolocation-sensitive flows such as compliance checks, offer availability, and user interface localization.
Requirements
- The
customer_countrymust be passed as a query parameter in the URL of the API request. - It should be provided as a 2-letter ISO 3166-1 alpha-2 country code (e.g.,
DE,FR,US).
Example: Creating a Transaction
POST /v1/transaction?customer_country=DE
Content-Type: application/json
{
"from_amount": 1200,
"from_currency": "EUR",
"to_currency": "BTC",
"from_network": "EUR",
"to_network": "BTC",
"customer": {
"contact_info": {
"email": "[email protected]"
}
}
}
Example: Getting an Estimate
GET /v1/estimate?from_currency=EUR&to_currency=BTC&from_amount=100&customer_country=US
Important Notes
- The
customer_countrymust be passed in the query string, not in the body or headers. - If both
X-Forwarded-Forandcustomer_countryare present,customer_countrywill override the IP-derived location. - This feature is only available if explicitly enabled for your account.
For more details on country-related configurations, please consult your Guardarian account manager.