curl --request GET \
--url https://api.zenskar.com/customers/{customer_id}/addresses \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/customers/{customer_id}/addresses"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}};
fetch('https://api.zenskar.com/customers/{customer_id}/addresses', 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://api.zenskar.com/customers/{customer_id}/addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"organisation: <api-key>",
"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://api.zenskar.com/customers/{customer_id}/addresses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("organisation", "<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://api.zenskar.com/customers/{customer_id}/addresses")
.header("x-api-key", "<api-key>")
.header("organisation", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenskar.com/customers/{customer_id}/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["organisation"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "223e4567-e89b-12d3-a456-426614174001",
"line1": "123 Business Ave",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"zip_code": "94102",
"country": "United States",
"country_code": "US",
"is_default_billing": true,
"is_default_shipping": false,
"validation_status": "valid",
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-06-15T10:30:00"
}
]{
"error_code": "BAD_REQUEST",
"message": "Invalid address_type parameter"
}{
"error_code": "NOT_FOUND",
"message": "Customer not found"
}{
"status_code": 10422,
"message": "1 validation error for Query; customer_id: value is not a valid uuid"
}{
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Failed to retrieve customer addresses"
}List customer addresses
Retrieve all addresses associated with a customer, with optional filtering by address type.
Filtering:
billing: Returns only addresses marked as default billingshipping: Returns only addresses marked as default shipping- No filter: Returns all addresses for the customer
Address Types:
A single address can serve as both billing and shipping default simultaneously. This is determined by the is_default_billing and is_default_shipping flags.
Deduplication: Addresses are automatically deduplicated based on their content hash. If the same address data is used for both billing and shipping, only one record exists with both flags set.
curl --request GET \
--url https://api.zenskar.com/customers/{customer_id}/addresses \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/customers/{customer_id}/addresses"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}};
fetch('https://api.zenskar.com/customers/{customer_id}/addresses', 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://api.zenskar.com/customers/{customer_id}/addresses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"organisation: <api-key>",
"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://api.zenskar.com/customers/{customer_id}/addresses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("organisation", "<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://api.zenskar.com/customers/{customer_id}/addresses")
.header("x-api-key", "<api-key>")
.header("organisation", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenskar.com/customers/{customer_id}/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["organisation"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"customer_id": "223e4567-e89b-12d3-a456-426614174001",
"line1": "123 Business Ave",
"line2": "Suite 100",
"city": "San Francisco",
"state": "CA",
"zip_code": "94102",
"country": "United States",
"country_code": "US",
"is_default_billing": true,
"is_default_shipping": false,
"validation_status": "valid",
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-06-15T10:30:00"
}
]{
"error_code": "BAD_REQUEST",
"message": "Invalid address_type parameter"
}{
"error_code": "NOT_FOUND",
"message": "Customer not found"
}{
"status_code": 10422,
"message": "1 validation error for Query; customer_id: value is not a valid uuid"
}{
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Failed to retrieve customer addresses"
}Authorizations
Path Parameters
Query Parameters
Filter by type: billing or shipping
billing, shipping Response
Successfully retrieved customer addresses
Address ID
Customer ID
Whether this is the default billing address
Whether this is the default shipping address
Street address line 1 (e.g., building number and street name)
Street address line 2 (e.g., apartment, suite, unit number)
Street address line 3 (additional address information)
City or locality name
State, province, or region
Postal/ZIP code
Country name (e.g., 'United States')
Two-letter ISO country code (e.g., 'US', 'GB')
Address validation status
Validation data from external connector