Skip to main content
POST
/
api
/
public
/
perks
/
{perkId}
/
claim
{
  "Url": "<string>"
}

Claim Perk

Records that the authenticated customer has claimed a specific perk. If the perk has an associated external URL (e.g. a discount code landing page), the response includes a Url field for redirection.

Authentication

Requires a valid customer bearer token.

Path Parameters

perkId
number
required
The integer ID of the perk to claim. Obtained as Perks[].Id from GET /api/public/perks.

Request Body

No request body required.

Response

Url
string
External URL to redirect the customer to after claiming the perk. May be empty if the perk has no associated link.

Examples

Claim a perk

POST /api/public/perks/101/claim
Authorization: Bearer {token}
{
  "Url": "https://cornercafe.example.com/discount?code=NX15"
}

TypeScript Integration

import endpoints from '@/api/endpoints'

const result = await httpClient.post(endpoints.perks.claim(101))
if (result.Url) {
  window.open(result.Url, '_blank')
}