Get Postal Code Format
curl --request GET \
--url https://kyc.yativo.com/api/postal-codes/{countryCode}import requests
url = "https://kyc.yativo.com/api/postal-codes/{countryCode}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://kyc.yativo.com/api/postal-codes/{countryCode}', 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://kyc.yativo.com/api/postal-codes/{countryCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://kyc.yativo.com/api/postal-codes/{countryCode}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://kyc.yativo.com/api/postal-codes/{countryCode}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kyc.yativo.com/api/postal-codes/{countryCode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"country_code": "US",
"country_name": "United States",
"uses_postal_codes": true,
"validation": {
"rule_regex": "/^\\d{5}(?:-\\d{4})?$/",
"rule_samples": [
"12345",
"12345-6789"
],
"addressing_pattern": "<string>"
}
}KYC Lookups
Get Postal Code Format
The postal code pattern and samples for a country
GET
/
postal-codes
/
{countryCode}
Get Postal Code Format
curl --request GET \
--url https://kyc.yativo.com/api/postal-codes/{countryCode}import requests
url = "https://kyc.yativo.com/api/postal-codes/{countryCode}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://kyc.yativo.com/api/postal-codes/{countryCode}', 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://kyc.yativo.com/api/postal-codes/{countryCode}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://kyc.yativo.com/api/postal-codes/{countryCode}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://kyc.yativo.com/api/postal-codes/{countryCode}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kyc.yativo.com/api/postal-codes/{countryCode}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"country_code": "US",
"country_name": "United States",
"uses_postal_codes": true,
"validation": {
"rule_regex": "/^\\d{5}(?:-\\d{4})?$/",
"rule_samples": [
"12345",
"12345-6789"
],
"addressing_pattern": "<string>"
}
}Check
postal_code against validation.rule_regex before you submit. If uses_postal_codes is false, the country has no postal codes.
