curl --request POST \
--url https://dev.sbx.imprint.co/v2/customers/{customer_id}/link \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"partner_customer_id": "PARTNER_USER_456",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}
'import requests
url = "https://dev.sbx.imprint.co/v2/customers/{customer_id}/link"
payload = {
"partner_customer_id": "PARTNER_USER_456",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partner_customer_id: 'PARTNER_USER_456',
metadata: {store_id: 'store_789', platform_version: '2.1.0'}
})
};
fetch('https://dev.sbx.imprint.co/v2/customers/{customer_id}/link', 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}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner_customer_id' => 'PARTNER_USER_456',
'metadata' => [
'store_id' => 'store_789',
'platform_version' => '2.1.0'
]
]),
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}/link"
payload := strings.NewReader("{\n \"partner_customer_id\": \"PARTNER_USER_456\",\n \"metadata\": {\n \"store_id\": \"store_789\",\n \"platform_version\": \"2.1.0\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://dev.sbx.imprint.co/v2/customers/{customer_id}/link")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"partner_customer_id\": \"PARTNER_USER_456\",\n \"metadata\": {\n \"store_id\": \"store_789\",\n \"platform_version\": \"2.1.0\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.sbx.imprint.co/v2/customers/{customer_id}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_customer_id\": \"PARTNER_USER_456\",\n \"metadata\": {\n \"store_id\": \"store_789\",\n \"platform_version\": \"2.1.0\"\n }\n}"
response = http.request(request)
puts response.read_body{
"customer_id": "9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4",
"partner_customer_id": "PARTNER_USER_456",
"status": "ACTIVE",
"created_at": "2025-02-13T19:08:07.000Z",
"updated_at": "2025-02-13T19:08:07.000Z",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}{
"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"
}{
"error": {
"type": "<string>",
"message": "Customer already linked to a partner account",
"existing_link": {
"customer_id": "9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4",
"partner_customer_id": "PARTNER_USER_456",
"status": "ACTIVE",
"created_at": "2025-02-13T19:08:07.000Z",
"updated_at": "2025-02-13T19:08:07.000Z",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}
}
}Link an Imprint customer and partner customer accounts
Creates a link between an existing Imprint customer and a partner’s customer account. The API key provided with the request will be used to link the partner with the imprint customer.
Partner-scoped API keys can call this endpoint without an x-imprint-merchant-key header when the customer holds an account on exactly one of your products; the link is created for that product. Only products where the customer’s account is open count when the customer also holds closed accounts. If the customer holds accounts on more than one of your products, the request returns 400; send x-imprint-merchant-key to choose the product to link.
curl --request POST \
--url https://dev.sbx.imprint.co/v2/customers/{customer_id}/link \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"partner_customer_id": "PARTNER_USER_456",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}
'import requests
url = "https://dev.sbx.imprint.co/v2/customers/{customer_id}/link"
payload = {
"partner_customer_id": "PARTNER_USER_456",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partner_customer_id: 'PARTNER_USER_456',
metadata: {store_id: 'store_789', platform_version: '2.1.0'}
})
};
fetch('https://dev.sbx.imprint.co/v2/customers/{customer_id}/link', 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}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner_customer_id' => 'PARTNER_USER_456',
'metadata' => [
'store_id' => 'store_789',
'platform_version' => '2.1.0'
]
]),
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}/link"
payload := strings.NewReader("{\n \"partner_customer_id\": \"PARTNER_USER_456\",\n \"metadata\": {\n \"store_id\": \"store_789\",\n \"platform_version\": \"2.1.0\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://dev.sbx.imprint.co/v2/customers/{customer_id}/link")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"partner_customer_id\": \"PARTNER_USER_456\",\n \"metadata\": {\n \"store_id\": \"store_789\",\n \"platform_version\": \"2.1.0\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.sbx.imprint.co/v2/customers/{customer_id}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_customer_id\": \"PARTNER_USER_456\",\n \"metadata\": {\n \"store_id\": \"store_789\",\n \"platform_version\": \"2.1.0\"\n }\n}"
response = http.request(request)
puts response.read_body{
"customer_id": "9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4",
"partner_customer_id": "PARTNER_USER_456",
"status": "ACTIVE",
"created_at": "2025-02-13T19:08:07.000Z",
"updated_at": "2025-02-13T19:08:07.000Z",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}{
"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"
}{
"error": {
"type": "<string>",
"message": "Customer already linked to a partner account",
"existing_link": {
"customer_id": "9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4",
"partner_customer_id": "PARTNER_USER_456",
"status": "ACTIVE",
"created_at": "2025-02-13T19:08:07.000Z",
"updated_at": "2025-02-13T19:08:07.000Z",
"metadata": {
"store_id": "store_789",
"platform_version": "2.1.0"
}
}
}
}Authorizations
Path Parameters
Body
The unique identifier for the customer in the partner's system.
Compared byte-for-byte, so PARTNER_USER_456 and partner_user_456 are
two different customers. Send the same casing everywhere or a later
lookup silently returns no match.
Restricted to printable ASCII (\x20–\x7E) rather than arbitrary
UTF-8: the value is propagated between internal services as an HTTP/2
header, which cannot carry non-ASCII bytes. The bound is published
rather than discovered.
1 - 128^[\x20-\x7E]+$"PARTNER_USER_456"
Response
Customer accounts linked successfully
The unique identifier for the customer in the partner's system.
Compared byte-for-byte, so PARTNER_USER_456 and partner_user_456 are
two different customers. Send the same casing everywhere or a later
lookup silently returns no match.
Restricted to printable ASCII (\x20–\x7E) rather than arbitrary
UTF-8: the value is propagated between internal services as an HTTP/2
header, which cannot carry non-ASCII bytes. The bound is published
rather than discovered.
1 - 128^[\x20-\x7E]+$"PARTNER_USER_456"