Customers
Update a customer
PATCH
https://dashboard.perkstar.co.uk/api/v1
/
customers
/
{id}
Update a customer
curl --request PATCH \
--url https://dashboard.perkstar.co.uk/api/v1/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-11-07T05:31:56Z",
"consent_marketing": true,
"consent_ad_tracking": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
phone: '<string>',
first_name: '<string>',
last_name: '<string>',
date_of_birth: '2023-11-07T05:31:56Z',
consent_marketing: true,
consent_ad_tracking: true
})
};
fetch('https://dashboard.perkstar.co.uk/api/v1/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dashboard.perkstar.co.uk/api/v1/customers/{id}"
payload = {
"email": "jsmith@example.com",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-11-07T05:31:56Z",
"consent_marketing": True,
"consent_ad_tracking": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dashboard.perkstar.co.uk/api/v1/customers/{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([
'email' => 'jsmith@example.com',
'phone' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'date_of_birth' => '2023-11-07T05:31:56Z',
'consent_marketing' => true,
'consent_ad_tracking' => true
]),
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;
}{
"id": "<string>",
"customer_number": 123,
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-11-07T05:31:56Z",
"consent_marketing": true,
"consent_ad_tracking": true,
"external_ref": "<string>",
"anonymized_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
OK
Partner-supplied identifier (Shopify customer GID, Toast
guest UUID, Square customer id, …). Unique per org. POST
/customers upserts on this when supplied.
Was this page helpful?
⌘I
Update a customer
curl --request PATCH \
--url https://dashboard.perkstar.co.uk/api/v1/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-11-07T05:31:56Z",
"consent_marketing": true,
"consent_ad_tracking": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'jsmith@example.com',
phone: '<string>',
first_name: '<string>',
last_name: '<string>',
date_of_birth: '2023-11-07T05:31:56Z',
consent_marketing: true,
consent_ad_tracking: true
})
};
fetch('https://dashboard.perkstar.co.uk/api/v1/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dashboard.perkstar.co.uk/api/v1/customers/{id}"
payload = {
"email": "jsmith@example.com",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-11-07T05:31:56Z",
"consent_marketing": True,
"consent_ad_tracking": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dashboard.perkstar.co.uk/api/v1/customers/{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([
'email' => 'jsmith@example.com',
'phone' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'date_of_birth' => '2023-11-07T05:31:56Z',
'consent_marketing' => true,
'consent_ad_tracking' => true
]),
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;
}{
"id": "<string>",
"customer_number": 123,
"email": "<string>",
"phone": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"date_of_birth": "2023-11-07T05:31:56Z",
"consent_marketing": true,
"consent_ad_tracking": true,
"external_ref": "<string>",
"anonymized_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}
