Delete customer address
curl --request DELETE \
--url https://api.zenskar.com/customers/{customer_id}/addresses/{address_id} \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/customers/{customer_id}/addresses/{address_id}"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}
};
fetch('https://api.zenskar.com/customers/{customer_id}/addresses/{address_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}/addresses/{address_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/{address_id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.zenskar.com/customers/{customer_id}/addresses/{address_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}/addresses/{address_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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",
"message": "Address deleted"
}{
"error_code": "CUSTOMER_ADDRESS_NOT_FOUND",
"message": "customer address not found"
}{
"status_code": 10422,
"message": "1 validation error for Path; address_id: value is not a valid uuid"
}{
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Failed to delete customer address"
}Customer Addresses
Delete customer address
Delete an address from the customer’s address book.
Soft Delete: This operation performs a soft delete - the address record is marked as deleted but retained in the database for audit purposes. Deleted addresses will not appear in list queries.
Considerations:
- Addresses referenced by existing invoices or contracts remain in those records
- Consider updating another address as default before deleting a default address
- Deleted addresses cannot be recovered through the API
Requirements:
- Address must exist and belong to the authenticated organization
- Valid UUID format required for both customer_id and address_id
DELETE
/
customers
/
{customer_id}
/
addresses
/
{address_id}
Delete customer address
curl --request DELETE \
--url https://api.zenskar.com/customers/{customer_id}/addresses/{address_id} \
--header 'organisation: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.zenskar.com/customers/{customer_id}/addresses/{address_id}"
headers = {
"x-api-key": "<api-key>",
"organisation": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', organisation: '<api-key>'}
};
fetch('https://api.zenskar.com/customers/{customer_id}/addresses/{address_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}/addresses/{address_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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/{address_id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.zenskar.com/customers/{customer_id}/addresses/{address_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}/addresses/{address_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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",
"message": "Address deleted"
}{
"error_code": "CUSTOMER_ADDRESS_NOT_FOUND",
"message": "customer address not found"
}{
"status_code": 10422,
"message": "1 validation error for Path; address_id: value is not a valid uuid"
}{
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Failed to delete customer address"
}