Get customer by ID
curl --request GET \
--url https://api.zenskar.com/customers/{customer_id} \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/customers/{customer_id}"
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}', 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}",
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}"
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}")
.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}")
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_name": "Acme Corporation",
"email": "billing@acme.com",
"phone": "+1-555-0100",
"billing_address": {
"street": "123 Business Ave",
"city": "San Francisco",
"state": "CA",
"postal_code": "94102",
"country": "US"
},
"custom_data": {
"industry": "Technology",
"company_size": "50-200"
},
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-06-15T10:30:00"
}{
"error_code": "BAD_REQUEST",
"message": "Invalid customer ID format"
}{
"error_code": "NOT_FOUND",
"message": "Customer with id 123e4567-e89b-12d3-a456-426614174000 not found"
}{
"status_code": 10422,
"message": "1 validation error for Path; customer_id: value is not a valid uuid"
}{
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Failed to retrieve customer"
}Customers
Get customer by ID
Retrieve detailed information for a specific customer by their unique identifier.
Returns comprehensive customer data including:
- Basic information: name, email, phone
- Address details: billing and shipping addresses
- Custom data: organization-specific custom fields
- Metadata: creation and update timestamps
Requirements:
- Customer must belong to the authenticated organization
- Valid UUID format required for customer_id
- Returns 404 if customer doesn’t exist or is not accessible
GET
/
customers
/
{customer_id}
Get customer by ID
curl --request GET \
--url https://api.zenskar.com/customers/{customer_id} \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/customers/{customer_id}"
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}', 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}",
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}"
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}")
.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}")
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_name": "Acme Corporation",
"email": "billing@acme.com",
"phone": "+1-555-0100",
"billing_address": {
"street": "123 Business Ave",
"city": "San Francisco",
"state": "CA",
"postal_code": "94102",
"country": "US"
},
"custom_data": {
"industry": "Technology",
"company_size": "50-200"
},
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-06-15T10:30:00"
}{
"error_code": "BAD_REQUEST",
"message": "Invalid customer ID format"
}{
"error_code": "NOT_FOUND",
"message": "Customer with id 123e4567-e89b-12d3-a456-426614174000 not found"
}{
"status_code": 10422,
"message": "1 validation error for Path; customer_id: value is not a valid uuid"
}{
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Failed to retrieve customer"
}Authorizations
Path Parameters
Response
Successfully retrieved customer
Create Customer Response Schema
Customer ID
External Customer Id
Customer name
Customer Custom Data
Customer address
Show child attributes
Show child attributes
Customer Ship To address
Show child attributes
Show child attributes
Customer Tax Ids
Show child attributes
Show child attributes
Customer Phone Number
Customer primary email address
List of associated contacts
Show child attributes
Show child attributes
Customer Tags
To enable/disable communications
To enable/disable auto-charge
Invoice Details Object
Show child attributes
Show child attributes
Created At
Updated At
default_payment_method
Show child attributes
Show child attributes
Business Entity Id
Business Entity
Show child attributes
Show child attributes