Retrieve pincodes
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes \
--header 'X-Api-Key: <api-key>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes', 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://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"pincodes": [
{
"pincode": "<string>",
"city": "<string>",
"state_name": "<string>",
"country_name": "<string>",
"country_iso_code": "<string>"
}
]
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"error": {}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>"
}Common
Retrieve pincodes
Retrieve pincodes
GET
/
common
/
countries
/
{country_iso_code}
/
pincodes
Retrieve pincodes
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes \
--header 'X-Api-Key: <api-key>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes', 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://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$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://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/common/countries/{country_iso_code}/pincodes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"pincodes": [
{
"pincode": "<string>",
"city": "<string>",
"state_name": "<string>",
"country_name": "<string>",
"country_iso_code": "<string>"
}
]
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"error": {}
}{
"message": "<string>",
"success": false,
"code": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>"
}Authorizations
API key for your store
Path Parameters
ISO 3166-1 alpha-2 country code (e.g., IN for India).
Required string length:
2Pattern:
^[A-Z]{2}$Query Parameters
no of rows per page
page number of pagination list
pincode. atleast 3 initial chars require to use this param
Was this page helpful?
โI