v2

latestOpenAPI 3.1.02026-08-01244220427.0 KB
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:

  1. Parse and look up the programId — must exist in the Programme collection.
  2. Confirm the programme type is GIFT_CARD.
  3. Confirm the programme's userId matches the authenticated user.
  4. Upsert the programId onto the target location of the matching GiftCardMerchant document (matched by merchantId == 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

Headers

X-Eposn-Merchant-Tokenstring nullable

Request body

programIdstring nullable

LoyaltyDog programme ID to link to the active location

locationIdstring nullable

Location to update; defaults to the first location if omitted

merchantIdstring nullable

User ID of the merchant

Response

Successful Response

idstring required
merchantIdstring required
namestring nullable required
platformstring required
programIdstring nullable required
activeboolean required
locationIdstring nullable required
locationNamestring nullable required
cashierIdstring nullable
terminalIdstring nullable
rolestring nullable
sessionTokenstring nullable

Example response

{
  "merchantId": "5eb7cf5a86d9755df3a6c593"
}