Skip to main content
POST
/
v2
/
customers
/
{customer_id}
/
link
Link an Imprint customer and partner customer accounts
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

Authorization
string
header
required

Basic HTTP authentication. Allowed headers-- Authorization: Basic <base64(api_key_id:api_key_secret)>

Path Parameters

customer_id
string
required

The unique identifier for the Imprint customer

Example:

"BBB815E9-F654-438D-9AD3-3F7BB8136FC0"

Body

application/json
partner_customer_id
string
required

The unique identifier for the customer in the partner's system

Example:

"PARTNER_USER_456"

metadata
object

Additional linking metadata

Example:
{
"store_id": "store_789",
"platform_version": "2.1.0"
}

Response

Customer accounts linked successfully

customer_id
string
required

The ID of the Imprint customer

Example:

"9B5E1EE0-2E1C-46E7-81B9-3C3917204BE4"

partner_customer_id
string
required

The unique identifier for the customer in the partner's system

Example:

"PARTNER_USER_456"

status
enum<string>
required

Status of the linked relationship

Available options:
ACTIVE,
INACTIVE
Example:

"ACTIVE"

created_at
string
required

the RFC-3339 timestamp when the link was created at.

Example:

"2025-02-13T19:08:07.000Z"

updated_at
string

the RFC-3339 timestamp when the link was last updated.

Example:

"2025-02-13T19:08:07.000Z"

metadata
object

Additional linking metadata

Example:
{
"store_id": "store_789",
"platform_version": "2.1.0"
}