Savemerchantsettings
curl --request PUT \
--url https://api.loyalty.dog/v2/giftcards/merchants/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"programId": "<string>",
"locationId": "<string>",
"merchantId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({programId: '<string>', locationId: '<string>', merchantId: '<string>'})
};
fetch('https://api.loyalty.dog/v2/giftcards/merchants/settings', 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/settings"
payload = {
"programId": "<string>",
"locationId": "<string>",
"merchantId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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": {}
}
]
}Gift Card Merchants
Savemerchantsettings
Save Per-Location Merchant Settings
Saves the programId for a specific merchant location. Merchant identity
is resolved from the validated X-Eposn-Merchant-Token session, so
ownership is checked by confirming the programme belongs to that user.
Validation steps:
- Parse and look up the
programId— must exist in the Programme collection. - Confirm the programme type is
GIFT_CARD. - Confirm the programme’s
userIdmatches the authenticated user. - Upsert the
programIdonto the target location of the matchingGiftCardMerchantdocument (matched bymerchantId == str(user.id)).
Status Codes:
- 200: Settings saved successfully
- 400: programId is invalid or wrong type
- 401: Not authenticated
- 403: Programme does not belong to this user
- 404: Programme or merchant not found
PUT
/
v2
/
giftcards
/
merchants
/
settings
Savemerchantsettings
curl --request PUT \
--url https://api.loyalty.dog/v2/giftcards/merchants/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"programId": "<string>",
"locationId": "<string>",
"merchantId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({programId: '<string>', locationId: '<string>', merchantId: '<string>'})
};
fetch('https://api.loyalty.dog/v2/giftcards/merchants/settings', 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/settings"
payload = {
"programId": "<string>",
"locationId": "<string>",
"merchantId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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.
Headers
Body
application/json
Payload for saving per-location merchant settings.
Response
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.
Required string length:
24Pattern:
^[0-9a-f]{24}$Example:
"5eb7cf5a86d9755df3a6c593"
Show child attributes
Show child attributes
