Update Contact
curl --request PATCH \
--url https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": true,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
'import requests
url = "https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}"
payload = {
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": True,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_id: 'CUS123',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
phone: '+14155552671',
designation: 'Sales Manager',
is_default: true,
attributes: [{name: '1234567890', value: 'red'}]
})
};
fetch('https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_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.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reference_id' => 'CUS123',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+14155552671',
'designation' => 'Sales Manager',
'is_default' => true,
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}"
payload := strings.NewReader("{\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "0c05a9a7-84ed-46f0-819b-653545730920",
"customer_id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": false,
"attributes": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"value": "Red",
"created_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"updated_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"created_at": "2025-01-01T15:04:05Z",
"updated_at": "2025-01-01T15:04:05Z"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Contact
Update Contact
Update Contact
PATCH
/
v2
/
customers
/
{customer_id}
/
contacts
/
{contact_id}
Update Contact
curl --request PATCH \
--url https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": true,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
'import requests
url = "https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}"
payload = {
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": True,
"attributes": [
{
"name": "1234567890",
"value": "red"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference_id: 'CUS123',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
phone: '+14155552671',
designation: 'Sales Manager',
is_default: true,
attributes: [{name: '1234567890', value: 'red'}]
})
};
fetch('https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_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.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reference_id' => 'CUS123',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+14155552671',
'designation' => 'Sales Manager',
'is_default' => true,
'attributes' => [
[
'name' => '1234567890',
'value' => 'red'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}"
payload := strings.NewReader("{\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v2/customers/{customer_id}/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"CUS123\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"designation\": \"Sales Manager\",\n \"is_default\": true,\n \"attributes\": [\n {\n \"name\": \"1234567890\",\n \"value\": \"red\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "0c05a9a7-84ed-46f0-819b-653545730920",
"customer_id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "CUS123",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+14155552671",
"designation": "Sales Manager",
"is_default": false,
"attributes": [
{
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"name": "Color",
"value": "Red",
"created_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"updated_by": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"created_at": "2025-01-01T15:04:05Z",
"updated_at": "2025-01-01T15:04:05Z"
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}The
PATCH request is used to partially update an existing entity by the
given id. This means:- Only the fields provided in the request body will be updated.
- Fields not provided in the request body will remain unchanged.
- The request is idempotent, meaning multiple identical PATCH requests will always result in the same final state.
Authorizations
API Key for authentication
Body
application/json
request
Maximum string length:
255Example:
"CUS123"
Maximum string length:
50Example:
"John"
Maximum string length:
50Example:
"Doe"
Example:
"john.doe@example.com"
Phone number in E.164 format
Example:
"+14155552671"
Maximum string length:
50Example:
"Sales Manager"
When true, sets this as the primary contact. Omitted/false does not change the current primary contact.
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I
