Return the user’s geo-location by IP address
curl --request POST \
--url https://{globale_api_domain}/Browsing/LocationByIPimport requests
url = "https://{globale_api_domain}/Browsing/LocationByIP"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{globale_api_domain}/Browsing/LocationByIP', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{globale_api_domain}/Browsing/LocationByIP",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{globale_api_domain}/Browsing/LocationByIP"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{globale_api_domain}/Browsing/LocationByIP")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/Browsing/LocationByIP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"City": {
"Code": "<string>",
"Name": "<string>"
},
"Country": {
"Code": "<string>",
"DefaultCurrencyCode": "<string>",
"DefaultVATRateType": {
"Name": "<string>",
"Rate": 123,
"VATRateTypeCode": "<string>"
},
"IsOperatedByGlobalE": true,
"IsStateMandatory": true,
"Name": "<string>",
"SiteURL": "<string>",
"SupportsFixedPrices": true,
"UseCountryVAT": true
},
"IPRange": {
"From": 123,
"To": 123,
"Type": "<string>"
},
"Region": {
"Code": "<string>",
"CountryCode": "<string>",
"Name": "<string>"
}
}Location by IP (Merchant to Global-e)
Returns the shopper’s geo-location by IP address, falling back to the merchant’s default location when the IP cannot be resolved.
POST
/
Browsing
/
LocationByIP
Return the user’s geo-location by IP address
curl --request POST \
--url https://{globale_api_domain}/Browsing/LocationByIPimport requests
url = "https://{globale_api_domain}/Browsing/LocationByIP"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{globale_api_domain}/Browsing/LocationByIP', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{globale_api_domain}/Browsing/LocationByIP",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{globale_api_domain}/Browsing/LocationByIP"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{globale_api_domain}/Browsing/LocationByIP")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/Browsing/LocationByIP")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"City": {
"Code": "<string>",
"Name": "<string>"
},
"Country": {
"Code": "<string>",
"DefaultCurrencyCode": "<string>",
"DefaultVATRateType": {
"Name": "<string>",
"Rate": 123,
"VATRateTypeCode": "<string>"
},
"IsOperatedByGlobalE": true,
"IsStateMandatory": true,
"Name": "<string>",
"SiteURL": "<string>",
"SupportsFixedPrices": true,
"UseCountryVAT": true
},
"IPRange": {
"From": 123,
"To": 123,
"Type": "<string>"
},
"Region": {
"Code": "<string>",
"CountryCode": "<string>",
"Name": "<string>"
}
}Returns the user’s geo-location by IP address. The merchant’s default location is returned if an IP address cannot be found (for example if a private network IP address has been specified). The merchant-side caching policy defined by this method should be applied to the whole IP range returned for the IP address specified.
Query Parameters
The shopper's IP address
Response
200 - application/json
The shopper's geo-location.

