curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/merchants/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"appToken": "<string>",
"merchantId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({appToken: '<string>', merchantId: '<string>'})
};
fetch('https://api.loyalty.dog/v2/giftcards/merchants/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/giftcards/merchants/session"
payload = {
"appToken": "<string>",
"merchantId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"merchantId": "5eb7cf5a86d9755df3a6c593",
"name": "<string>",
"platform": "<string>",
"programId": "<string>",
"active": true,
"locationId": "<string>",
"locationName": "<string>",
"locations": [
{
"locationId": "<string>",
"locationName": "<string>",
"lastSeenAt": "<string>",
"programId": "<string>"
}
],
"cashierId": "<string>",
"terminalId": "<string>",
"role": "<string>",
"sessionToken": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Initmerchantsession
Init or Refresh Merchant Session
Called by eposn-giftcards immediately after resolving a valid platform token.
Looks up the merchant by (merchantId, platform). If a record exists the
info is updated; if not, a new GiftCardMerchant document is created.
Locations are stored as embedded sub-documents. If locationId is provided,
the matching location is upserted within the merchant document.
programId is stored per location — if supplied it will update only the
active location’s programId, not a merchant-level field.
Returns:
- Full merchant context including the active location’s
programIdso callers can build a session without an additional API round-trip.
Status Codes:
- 200: Merchant record created or updated successfully
- 401: HMAC authentication failed
curl --request POST \
--url https://api.loyalty.dog/v2/giftcards/merchants/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"appToken": "<string>",
"merchantId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({appToken: '<string>', merchantId: '<string>'})
};
fetch('https://api.loyalty.dog/v2/giftcards/merchants/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.loyalty.dog/v2/giftcards/merchants/session"
payload = {
"appToken": "<string>",
"merchantId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"merchantId": "5eb7cf5a86d9755df3a6c593",
"name": "<string>",
"platform": "<string>",
"programId": "<string>",
"active": true,
"locationId": "<string>",
"locationName": "<string>",
"locations": [
{
"locationId": "<string>",
"locationName": "<string>",
"lastSeenAt": "<string>",
"programId": "<string>"
}
],
"cashierId": "<string>",
"terminalId": "<string>",
"role": "<string>",
"sessionToken": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT access token obtained from POST /v2/token.
Body
Payload sent by eposn-giftcards after resolving a platform token.
Fields are intentionally generic so that EPOS Now, Shopify, and future platforms all use the same endpoint.
1 - 512Platform-specific merchant/company identifier
1 - 100Human-readable merchant/company name
255eposnow, shopify, clover, wordpress Platform-specific location identifier
100255Linked LoyaltyDog programme ID (per location)
100Optional LoyaltyDog User ID to link/onboard this merchant
100Role of the merchant
100Platform-specific cashier identifier
100Platform-specific terminal identifier
100Response
Successful Response
Returned after a successful merchant session init or validation.
Contains everything needed to populate the eposn-giftcards session without an additional core_api round-trip.
24^[0-9a-f]{24}$"5eb7cf5a86d9755df3a6c593"
Show child attributes
Show child attributes
