Create Loyalty Program Customer
curl --request POST \
--url https://api.loyalty.dog/v2/loyalty/programs/{programId}/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "[email protected]",
"phone": "<string>",
"points": 0,
"referrerId": "5eb7cf5a86d9755df3a6c593",
"customFields": {},
"initialConsentGranted": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: '[email protected]',
phone: '<string>',
points: 0,
referrerId: '5eb7cf5a86d9755df3a6c593',
customFields: {},
initialConsentGranted: {}
})
};
fetch('https://api.loyalty.dog/v2/loyalty/programs/{programId}/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/loyalty/programs/{programId}/customers"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "[email protected]",
"phone": "<string>",
"points": 0,
"referrerId": "5eb7cf5a86d9755df3a6c593",
"customFields": {},
"initialConsentGranted": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Loyalty
Create Loyalty Program Customer
Create Loyalty Program Customer
Creates a new customer within a loyalty program.
Path Parameters:
programId: UUID of the loyalty program
Request Body:
data: Customer data to be added
Returns:
- Customer details as a JSON object on successful creation.
- HTTP 404 Not Found if the program template is not found.
POST
/
v2
/
loyalty
/
programs
/
{programId}
/
customers
Create Loyalty Program Customer
curl --request POST \
--url https://api.loyalty.dog/v2/loyalty/programs/{programId}/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "[email protected]",
"phone": "<string>",
"points": 0,
"referrerId": "5eb7cf5a86d9755df3a6c593",
"customFields": {},
"initialConsentGranted": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: '[email protected]',
phone: '<string>',
points: 0,
referrerId: '5eb7cf5a86d9755df3a6c593',
customFields: {},
initialConsentGranted: {}
})
};
fetch('https://api.loyalty.dog/v2/loyalty/programs/{programId}/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/loyalty/programs/{programId}/customers"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "[email protected]",
"phone": "<string>",
"points": 0,
"referrerId": "5eb7cf5a86d9755df3a6c593",
"customFields": {},
"initialConsentGranted": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Headers
Path Parameters
Required string length:
24Pattern:
^[0-9a-f]{24}$Example:
"5eb7cf5a86d9755df3a6c593"
Body
application/json
The customer creation payload
Attributes: firstName (str | None, optional): The first name of the customer. Defaults to None lastName (str | None, optional): The last name of the customer. Defaults to None email (str | None, optional): The email address of the customer. Defaults to None phone (str | None, optional): The E164 phone number of the customer. Defaults to None customFields (Dict | None, optional): The values of the custom fields. Defaults to {}
referrerId (PydanticObjectId | None, optional): The ID of the referrer customer. Defaults to None
Required string length:
24Pattern:
^[0-9a-f]{24}$Example:
"5eb7cf5a86d9755df3a6c593"
Response
Successful Response
