curl --request PATCH \
--url https://dev.sbx.imprint.co/v2/customers/{customer_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"loyalty_id": "036000241457",
"membership_tier": "gold"
}
}
'import requests
url = "https://dev.sbx.imprint.co/v2/customers/{customer_id}"
payload = { "metadata": {
"loyalty_id": "036000241457",
"membership_tier": "gold"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {loyalty_id: '036000241457', membership_tier: 'gold'}})
};
fetch('https://dev.sbx.imprint.co/v2/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://dev.sbx.imprint.co/v2/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([
'metadata' => [
'loyalty_id' => '036000241457',
'membership_tier' => 'gold'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://dev.sbx.imprint.co/v2/customers/{customer_id}"
payload := strings.NewReader("{\n \"metadata\": {\n \"loyalty_id\": \"036000241457\",\n \"membership_tier\": \"gold\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://dev.sbx.imprint.co/v2/customers/{customer_id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"loyalty_id\": \"036000241457\",\n \"membership_tier\": \"gold\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.sbx.imprint.co/v2/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"loyalty_id\": \"036000241457\",\n \"membership_tier\": \"gold\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {}
}{
"path": "/v2/customers",
"details": [
"email: must be a well-formed email address"
],
"error": "Bad Request",
"status": 400,
"timestamp": "2025-01-20T18:18:22.923+00:00"
}{
"type": "CUSTOMER_NOT_FOUND_ERROR",
"message": "Customer not found for provided ID: CSMR-v1-123",
"param": "customer_id"
}Update a customer
Updates a customer. Currently only metadata updates are supported.
Adds or replaces the supplied metadata keys, preserving omitted keys.
Updates the metadata returned by customer reads and included in subsequent webhook payloads.
Requires a product-scoped API key, or a partner-scoped key with an x-imprint-merchant-key header.
The customer must have an account for that product. Customer linkage is unchanged.
Send at least one key. Values must be strings; null values and the reserved
partner_customer_id key are rejected. Product-specific metadata rules apply to supplied keys;
omitted required keys are allowed. An empty string is stored as a value, not a deletion,
unless the key is required by the product.
loyalty_id is read-only for products where Imprint generates the loyalty ID.
curl --request PATCH \
--url https://dev.sbx.imprint.co/v2/customers/{customer_id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"loyalty_id": "036000241457",
"membership_tier": "gold"
}
}
'import requests
url = "https://dev.sbx.imprint.co/v2/customers/{customer_id}"
payload = { "metadata": {
"loyalty_id": "036000241457",
"membership_tier": "gold"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {loyalty_id: '036000241457', membership_tier: 'gold'}})
};
fetch('https://dev.sbx.imprint.co/v2/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://dev.sbx.imprint.co/v2/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([
'metadata' => [
'loyalty_id' => '036000241457',
'membership_tier' => 'gold'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://dev.sbx.imprint.co/v2/customers/{customer_id}"
payload := strings.NewReader("{\n \"metadata\": {\n \"loyalty_id\": \"036000241457\",\n \"membership_tier\": \"gold\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://dev.sbx.imprint.co/v2/customers/{customer_id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"loyalty_id\": \"036000241457\",\n \"membership_tier\": \"gold\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.sbx.imprint.co/v2/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"loyalty_id\": \"036000241457\",\n \"membership_tier\": \"gold\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {}
}{
"path": "/v2/customers",
"details": [
"email: must be a well-formed email address"
],
"error": "Bad Request",
"status": 400,
"timestamp": "2025-01-20T18:18:22.923+00:00"
}{
"type": "CUSTOMER_NOT_FOUND_ERROR",
"message": "Customer not found for provided ID: CSMR-v1-123",
"param": "customer_id"
}