Attach an external identifier
curl --request POST \
--url https://api.rigaly.com/api/v1/customers/{userId}/identifiers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "shopify-8842",
"label": "Shopify customer ID"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 'shopify-8842', label: 'Shopify customer ID'})
};
fetch('https://api.rigaly.com/api/v1/customers/{userId}/identifiers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/customers/{userId}/identifiers"
payload = {
"value": "shopify-8842",
"label": "Shopify customer ID"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/customers/{userId}/identifiers",
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([
'value' => 'shopify-8842',
'label' => 'Shopify customer ID'
]),
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;
}{
"success": true,
"message": "<string>",
"data": {
"identifier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "shopify-8842",
"label": "Shopify customer ID",
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}Customers
Attach an external identifier
Link your own customer ID (e.g. from your e-commerce platform) to a Rigaly customer, then use it as identifier everywhere.
POST
/
api
/
v1
/
customers
/
{userId}
/
identifiers
Attach an external identifier
curl --request POST \
--url https://api.rigaly.com/api/v1/customers/{userId}/identifiers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "shopify-8842",
"label": "Shopify customer ID"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 'shopify-8842', label: 'Shopify customer ID'})
};
fetch('https://api.rigaly.com/api/v1/customers/{userId}/identifiers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/customers/{userId}/identifiers"
payload = {
"value": "shopify-8842",
"label": "Shopify customer ID"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/customers/{userId}/identifiers",
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([
'value' => 'shopify-8842',
'label' => 'Shopify customer ID'
]),
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;
}{
"success": true,
"message": "<string>",
"data": {
"identifier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "shopify-8842",
"label": "Shopify customer ID",
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}Authorizations
API key from the Rigaly dashboard: Authorization: Bearer rgly_sk_...
Path Parameters
The Rigaly customer ID (from lookup or previous responses).
Body
application/json