Update Customer
Partial update of an existing customer projection. Only fields present in the request are applied; omitted fields are left untouched.
URL
POST /api/c2a/customer/update
Request Parameters
Body: UpdateCustomerRequest. Same shape as StoreCustomerRequest plus the target CustomerUrn (or ExternalIdentifier). Server accepts whichever identifier is supplied and resolves to the canonical record.
| Name | Type | Description |
|---|---|---|
customer | object (CustomerDto) | Required. Must include customerUrn or externalIdentifier. Other fields are optional and overwrite the projection. |
claimedRegion | object (ClaimedRegion) | Optional region override. |
Request Example
{
"customer": {
"customerUrn": "cu.00.482",
"email": "jane.new@example.com",
"phoneNumber": "+49 170 9999999"
}
}
Response Parameters
UpdateCustomerResponse. Same envelope as StoreCustomerResponse. The returned result reflects the post-update customer record.
| Name | Type | Description |
|---|---|---|
result | object (AzotteCustomer) | Updated customer record. |
status | object (AzotteStatus) | Operation status envelope. |
Sample Response
{
"result": {
"customerUrn": "cu.00.482",
"externalIdentifier": "crm-9981273",
"email": "jane.new@example.com",
"status": "Active"
},
"status": { "messageCode": "SUCCESS" }
}
Sample Codes
- cURL
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
curl --location 'https://acme.sandbox.azotte.com/api/v1/c2a/customer/update' \
--header 'Content-Type: application/json' \
--header 'x-tn: e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f' \
--header 'x-api-key: sk_dev_acme_sample_123456789' \
--data '{
"customer": {
"customerUrn": "cu.00.482",
"email": "jane.new@example.com",
"phoneNumber": "+49 170 9999999"
}
}'
const res = await fetch('https://acme.sandbox.azotte.com/api/v1/c2a/customer/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-tn': 'e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key': 'sk_dev_acme_sample_123456789'
},
body: JSON.stringify({
customer: {
customerUrn: 'cu.00.482',
email: 'jane.new@example.com',
phoneNumber: '+49 170 9999999'
}
})
});
console.log(await res.json());
import { request } from 'undici';
const { body } = await request('https://acme.sandbox.azotte.com/api/v1/c2a/customer/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-tn': 'e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key': 'sk_dev_acme_sample_123456789'
},
body: JSON.stringify({
customer: {
customerUrn: 'cu.00.482',
email: 'jane.new@example.com',
phoneNumber: '+49 170 9999999'
}
})
});
console.log(await body.json());
import requests
res = requests.post(
'https://acme.sandbox.azotte.com/api/v1/c2a/customer/update',
headers={
'Content-Type': 'application/json',
'x-tn': 'e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key': 'sk_dev_acme_sample_123456789',
},
json={
'customer': {
'customerUrn': 'cu.00.482',
'email': 'jane.new@example.com',
'phoneNumber': '+49 170 9999999',
}
},
)
print(res.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String json = """
{
"customer": {
"customerUrn": "cu.00.482",
"email": "jane.new@example.com",
"phoneNumber": "+49 170 9999999"
}
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://acme.sandbox.azotte.com/api/v1/c2a/customer/update"))
.header("Content-Type", "application/json")
.header("x-tn", "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f")
.header("x-api-key", "sk_dev_acme_sample_123456789")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
using System.Net.Http.Json;
var payload = new {
customer = new {
customerUrn = "cu.00.482",
email = "jane.new@example.com",
phoneNumber = "+49 170 9999999"
}
};
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-tn", "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f");
http.DefaultRequestHeaders.Add("x-api-key", "sk_dev_acme_sample_123456789");
var res = await http.PostAsJsonAsync(
"https://acme.sandbox.azotte.com/api/v1/c2a/customer/update",
payload);
Console.WriteLine(await res.Content.ReadAsStringAsync());
<?php
$payload = [
'customer' => [
'customerUrn' => 'cu.00.482',
'email' => 'jane.new@example.com',
'phoneNumber' => '+49 170 9999999',
],
];
$ch = curl_init('https://acme.sandbox.azotte.com/api/v1/c2a/customer/update');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'x-tn: e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f',
'x-api-key: sk_dev_acme_sample_123456789',
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
echo curl_exec($ch);
curl_close($ch);
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]any{
"customer": map[string]string{
"customerUrn": "cu.00.482",
"email": "jane.new@example.com",
"phoneNumber": "+49 170 9999999",
},
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST",
"https://acme.sandbox.azotte.com/api/v1/c2a/customer/update",
bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-tn", "e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f")
req.Header.Set("x-api-key", "sk_dev_acme_sample_123456789")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}