Update a customer
curl --request PATCH \
--url https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jane.roe.updated@example.com",
"name": "Johnathan Doe",
"metadata": {
"source": "sdk_import",
"priority": "very_high",
"status": "active"
},
"billingAddress": {
"country": "IN",
"line1": "123 Main Street",
"line2": "Apt 4B",
"postalCode": "560001",
"city": "Bangalore",
"state": "Karnataka"
}
}
'import requests
url = "https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/"
payload = {
"email": "jane.roe.updated@example.com",
"name": "Johnathan Doe",
"metadata": {
"source": "sdk_import",
"priority": "very_high",
"status": "active"
},
"billingAddress": {
"country": "IN",
"line1": "123 Main Street",
"line2": "Apt 4B",
"postalCode": "560001",
"city": "Bangalore",
"state": "Karnataka"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jane.roe.updated@example.com',
name: 'Johnathan Doe',
metadata: {source: 'sdk_import', priority: 'very_high', status: 'active'},
billingAddress: {
country: 'IN',
line1: '123 Main Street',
line2: 'Apt 4B',
postalCode: '560001',
city: 'Bangalore',
state: 'Karnataka'
}
})
};
fetch('https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/', 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://sandboxapi.kelviq.com/api/v1/customers/{customerId}/",
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([
'email' => 'jane.roe.updated@example.com',
'name' => 'Johnathan Doe',
'metadata' => [
'source' => 'sdk_import',
'priority' => 'very_high',
'status' => 'active'
],
'billingAddress' => [
'country' => 'IN',
'line1' => '123 Main Street',
'line2' => 'Apt 4B',
'postalCode' => '560001',
'city' => 'Bangalore',
'state' => 'Karnataka'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://sandboxapi.kelviq.com/api/v1/customers/{customerId}/"
payload := strings.NewReader("{\n \"email\": \"jane.roe.updated@example.com\",\n \"name\": \"Johnathan Doe\",\n \"metadata\": {\n \"source\": \"sdk_import\",\n \"priority\": \"very_high\",\n \"status\": \"active\"\n },\n \"billingAddress\": {\n \"country\": \"IN\",\n \"line1\": \"123 Main Street\",\n \"line2\": \"Apt 4B\",\n \"postalCode\": \"560001\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://sandboxapi.kelviq.com/api/v1/customers/{customerId}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jane.roe.updated@example.com\",\n \"name\": \"Johnathan Doe\",\n \"metadata\": {\n \"source\": \"sdk_import\",\n \"priority\": \"very_high\",\n \"status\": \"active\"\n },\n \"billingAddress\": {\n \"country\": \"IN\",\n \"line1\": \"123 Main Street\",\n \"line2\": \"Apt 4B\",\n \"postalCode\": \"560001\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jane.roe.updated@example.com\",\n \"name\": \"Johnathan Doe\",\n \"metadata\": {\n \"source\": \"sdk_import\",\n \"priority\": \"very_high\",\n \"status\": \"active\"\n },\n \"billingAddress\": {\n \"country\": \"IN\",\n \"line1\": \"123 Main Street\",\n \"line2\": \"Apt 4B\",\n \"postalCode\": \"560001\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
"customerId": "unique-customer-id-123",
"name": "Johnathan Doe",
"email": "new.customer@example.com",
"details": {},
"metadata": {
"source": "sdk_import",
"priority": "high",
"status": "active"
},
"billingAddress": {
"country": "IN",
"line1": "123 Main Street",
"line2": "Apt 4B",
"postalCode": "560001",
"city": "Bangalore",
"state": "Karnataka"
},
"createdOn": "2025-06-04T06:03:30.195790Z",
"modifiedOn": "2025-06-04T06:03:30.195831Z"
}Customers
Update a customer
Performs a partial update on an existing customer using their client-defined customerId.
PATCH
/
customers
/
{customerId}
/
Update a customer
curl --request PATCH \
--url https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jane.roe.updated@example.com",
"name": "Johnathan Doe",
"metadata": {
"source": "sdk_import",
"priority": "very_high",
"status": "active"
},
"billingAddress": {
"country": "IN",
"line1": "123 Main Street",
"line2": "Apt 4B",
"postalCode": "560001",
"city": "Bangalore",
"state": "Karnataka"
}
}
'import requests
url = "https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/"
payload = {
"email": "jane.roe.updated@example.com",
"name": "Johnathan Doe",
"metadata": {
"source": "sdk_import",
"priority": "very_high",
"status": "active"
},
"billingAddress": {
"country": "IN",
"line1": "123 Main Street",
"line2": "Apt 4B",
"postalCode": "560001",
"city": "Bangalore",
"state": "Karnataka"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jane.roe.updated@example.com',
name: 'Johnathan Doe',
metadata: {source: 'sdk_import', priority: 'very_high', status: 'active'},
billingAddress: {
country: 'IN',
line1: '123 Main Street',
line2: 'Apt 4B',
postalCode: '560001',
city: 'Bangalore',
state: 'Karnataka'
}
})
};
fetch('https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/', 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://sandboxapi.kelviq.com/api/v1/customers/{customerId}/",
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([
'email' => 'jane.roe.updated@example.com',
'name' => 'Johnathan Doe',
'metadata' => [
'source' => 'sdk_import',
'priority' => 'very_high',
'status' => 'active'
],
'billingAddress' => [
'country' => 'IN',
'line1' => '123 Main Street',
'line2' => 'Apt 4B',
'postalCode' => '560001',
'city' => 'Bangalore',
'state' => 'Karnataka'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://sandboxapi.kelviq.com/api/v1/customers/{customerId}/"
payload := strings.NewReader("{\n \"email\": \"jane.roe.updated@example.com\",\n \"name\": \"Johnathan Doe\",\n \"metadata\": {\n \"source\": \"sdk_import\",\n \"priority\": \"very_high\",\n \"status\": \"active\"\n },\n \"billingAddress\": {\n \"country\": \"IN\",\n \"line1\": \"123 Main Street\",\n \"line2\": \"Apt 4B\",\n \"postalCode\": \"560001\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://sandboxapi.kelviq.com/api/v1/customers/{customerId}/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jane.roe.updated@example.com\",\n \"name\": \"Johnathan Doe\",\n \"metadata\": {\n \"source\": \"sdk_import\",\n \"priority\": \"very_high\",\n \"status\": \"active\"\n },\n \"billingAddress\": {\n \"country\": \"IN\",\n \"line1\": \"123 Main Street\",\n \"line2\": \"Apt 4B\",\n \"postalCode\": \"560001\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.kelviq.com/api/v1/customers/{customerId}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jane.roe.updated@example.com\",\n \"name\": \"Johnathan Doe\",\n \"metadata\": {\n \"source\": \"sdk_import\",\n \"priority\": \"very_high\",\n \"status\": \"active\"\n },\n \"billingAddress\": {\n \"country\": \"IN\",\n \"line1\": \"123 Main Street\",\n \"line2\": \"Apt 4B\",\n \"postalCode\": \"560001\",\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
"customerId": "unique-customer-id-123",
"name": "Johnathan Doe",
"email": "new.customer@example.com",
"details": {},
"metadata": {
"source": "sdk_import",
"priority": "high",
"status": "active"
},
"billingAddress": {
"country": "IN",
"line1": "123 Main Street",
"line2": "Apt 4B",
"postalCode": "560001",
"city": "Bangalore",
"state": "Karnataka"
},
"createdOn": "2025-06-04T06:03:30.195790Z",
"modifiedOn": "2025-06-04T06:03:30.195831Z"
}Click the base URL in the API playground and select the Sandbox host for test data or the Production host for live data. Use credentials from the same environment.
Authorizations
Body
application/json
Fields for updating an existing customer. Only provided fields will be updated.
Response
200 - application/json
Customer Updated