Update Customer
curl --request PATCH \
--url https://api.hit-pay.com/v1/customers/{customer_id} \
--header 'Content-Type: application/json' \
--header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
--data '
{
"name": "John Doe",
"email": "<string>",
"phone_number": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
'import requests
url = "https://api.hit-pay.com/v1/customers/{customer_id}"
payload = {
"name": "John Doe",
"email": "<string>",
"phone_number": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
headers = {
"X-BUSINESS-API-KEY": "<x-business-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-BUSINESS-API-KEY': '<x-business-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: '<string>',
phone_number: '<string>',
phone_number_country_code: '<string>',
remark: '<string>',
birth_date: '2023-12-25',
gender: '<string>'
})
};
fetch('https://api.hit-pay.com/v1/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.hit-pay.com/v1/customers/{customer_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([
'name' => 'John Doe',
'email' => '<string>',
'phone_number' => '<string>',
'phone_number_country_code' => '<string>',
'remark' => '<string>',
'birth_date' => '2023-12-25',
'gender' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BUSINESS-API-KEY: <x-business-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.hit-pay.com/v1/customers/{customer_id}"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"email\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-BUSINESS-API-KEY", "<x-business-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.hit-pay.com/v1/customers/{customer_id}")
.header("X-BUSINESS-API-KEY", "<x-business-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"email\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hit-pay.com/v1/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-BUSINESS-API-KEY"] = '<x-business-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"email\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9b2ada28-be3c-47ab-883f-ba72e5d8305d",
"name": "John Doe",
"birth_date": "<string>",
"email": "<string>",
"phone_number": "<string>",
"address": {
"city": "<string>",
"state": "<string>",
"street": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"gender": "<string>",
"remark": "<string>",
"phone_number_country_code": "<string>",
"created_at": "2024-01-24T16:05:10+08:00",
"updated_at": "2024-01-24T16:05:10+08:00"
}"{\n \"message\": \"No query results for model [App\\\\Business\\\\Customer] 973ee456-d28f-4418-93c5-d37e4b311685\"\n}"Customers
Update Customer
Update an existing customer’s name, email, or phone
PATCH
/
v1
/
customers
/
{customer_id}
Update Customer
curl --request PATCH \
--url https://api.hit-pay.com/v1/customers/{customer_id} \
--header 'Content-Type: application/json' \
--header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
--data '
{
"name": "John Doe",
"email": "<string>",
"phone_number": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
'import requests
url = "https://api.hit-pay.com/v1/customers/{customer_id}"
payload = {
"name": "John Doe",
"email": "<string>",
"phone_number": "<string>",
"phone_number_country_code": "<string>",
"remark": "<string>",
"birth_date": "2023-12-25",
"gender": "<string>"
}
headers = {
"X-BUSINESS-API-KEY": "<x-business-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-BUSINESS-API-KEY': '<x-business-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: '<string>',
phone_number: '<string>',
phone_number_country_code: '<string>',
remark: '<string>',
birth_date: '2023-12-25',
gender: '<string>'
})
};
fetch('https://api.hit-pay.com/v1/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.hit-pay.com/v1/customers/{customer_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([
'name' => 'John Doe',
'email' => '<string>',
'phone_number' => '<string>',
'phone_number_country_code' => '<string>',
'remark' => '<string>',
'birth_date' => '2023-12-25',
'gender' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BUSINESS-API-KEY: <x-business-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.hit-pay.com/v1/customers/{customer_id}"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"email\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-BUSINESS-API-KEY", "<x-business-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.hit-pay.com/v1/customers/{customer_id}")
.header("X-BUSINESS-API-KEY", "<x-business-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"email\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hit-pay.com/v1/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-BUSINESS-API-KEY"] = '<x-business-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"email\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"phone_number_country_code\": \"<string>\",\n \"remark\": \"<string>\",\n \"birth_date\": \"2023-12-25\",\n \"gender\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9b2ada28-be3c-47ab-883f-ba72e5d8305d",
"name": "John Doe",
"birth_date": "<string>",
"email": "<string>",
"phone_number": "<string>",
"address": {
"city": "<string>",
"state": "<string>",
"street": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"gender": "<string>",
"remark": "<string>",
"phone_number_country_code": "<string>",
"created_at": "2024-01-24T16:05:10+08:00",
"updated_at": "2024-01-24T16:05:10+08:00"
}"{\n \"message\": \"No query results for model [App\\\\Business\\\\Customer] 973ee456-d28f-4418-93c5-d37e4b311685\"\n}"Headers
Example:
"b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d"
Path Parameters
The Customer id
Body
application/json
The name of the customer
Example:
"John Doe"
The email of the customer
The phone number of the customer
The country code of the phone number
The remark of the customer
The birth date of the customer
The gender of the customer
Show child attributes
Show child attributes
Last modified on February 25, 2026
Was this page helpful?
⌘I