loyalty

Embed
Preview of the card
<a href="https://hermetica.15.204.158.166.sslip.io/docs/ref-loyalty"><img src="https://hermetica.15.204.158.166.sslip.io/docs/_api/public/orgs/5fcd8b3c-a27c-4688-972f-de710125592f/spaces/caf5dc05-15f7-4e0c-bdb8-ab29ede6211e/pages/c47a3b2d-9cb6-4aa8-8a09-6a1cefb21e33/social-card.svg?v=3e7ae33eec8b" alt="loyalty" width="600" height="315"></a>
GEThttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "items": [
    {
      "id": "string",
      "name": "string",
      "status": "active",
      "pointsName": "string",
      "expiryDays": 0,
      "tierWindowDays": 0,
      "attributeKey": "string",
      "members": 0,
      "pointsOutstanding": 0,
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ]
}
Schema
itemsobject[]required
Show child parameters
idstringrequired
namestringrequired
statusstringrequired
active | paused
pointsNamestringrequired
expiryDaysintegerrequired
tierWindowDaysintegerrequired
attributeKeystringrequired
membersintegerrequired
pointsOutstandingintegerrequired
createdAtstringrequired
4XX Default Response
Example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  }
}
Schema
errorobjectrequired
Show child parameters
codestringrequired
messagestringrequired
detailsobject
5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

POSThttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs

Request body

application/json
namestringrequired
statusstring
active | paused = active
pointsNamestring
= points
expiryDaysinteger
tierWindowDaysinteger
attributeKeystring
{
  "name": "string",
  "status": "active",
  "pointsName": "points",
  "expiryDays": 0,
  "tierWindowDays": 0,
  "attributeKey": "string"
}

Code samples

cURL
curl -X POST "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","status":"active","pointsName":"points","expiryDays":0,"tierWindowDays":0,"attributeKey":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Default Response
Example
{
  "id": "string",
  "name": "string",
  "status": "active",
  "pointsName": "string",
  "expiryDays": 0,
  "tierWindowDays": 0,
  "attributeKey": "string",
  "members": 0,
  "pointsOutstanding": 0,
  "createdAt": "2024-01-01T00:00:00Z"
}
Schema
idstringrequired
namestringrequired
statusstringrequired
active | paused
pointsNamestringrequired
expiryDaysintegerrequired
tierWindowDaysintegerrequired
attributeKeystringrequired
membersintegerrequired
pointsOutstandingintegerrequired
createdAtstringrequired
4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

GEThttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}

Parameters

idstringpathrequired

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 201 · POST /v1/loyalty/programs

4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

DELETEhttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}

Delete a programme with its ledger (balances are lost)

Parameters

idstringpathrequired

Code samples

cURL
curl -X DELETE "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "ok": true
}
Schema
okbooleanrequired
true
4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

PATCHhttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}

Parameters

idstringpathrequired

Request body

application/json
namestring
statusstring
active | paused
pointsNamestring
expiryDaysinteger
tierWindowDaysinteger
attributeKeystring
{
  "name": "string",
  "status": "active",
  "pointsName": "string",
  "expiryDays": 0,
  "tierWindowDays": 0,
  "attributeKey": "string"
}

Code samples

cURL
curl -X PATCH "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","status":"active","pointsName":"string","expiryDays":0,"tierWindowDays":0,"attributeKey":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 201 · POST /v1/loyalty/programs

4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

GEThttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules

Parameters

idstringpathrequired

Code samples

cURL
curl -X GET "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response
Example
{
  "items": [
    {
      "id": "string",
      "programId": "string",
      "name": "string",
      "eventName": "string",
      "kind": "per_value",
      "points": 0,
      "minValueMinor": 0,
      "filter": {},
      "enabled": true,
      "expiryDays": 0
    }
  ]
}
Schema
itemsobject[]required
Show child parameters
idstringrequired
programIdstringrequired
namestringrequired
eventNamestringrequired
kindstringrequired
per_value | fixed
pointsintegerrequired
minValueMinorintegerrequired
filterobjectrequired
enabledbooleanrequired
expiryDaysintegerrequired
4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

POSThttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules

Earn points on an event (orders are `purchase`)

Parameters

idstringpathrequired

Request body

application/json
namestringrequired
eventNamestring
= purchase
kindstring
per_value | fixed = per_value
pointsintegerrequired
minValueMinorinteger
= 0
filterobject
= {}
enabledboolean
= true
expiryDaysinteger
{
  "name": "string",
  "eventName": "purchase",
  "kind": "per_value",
  "points": 0,
  "minValueMinor": 0,
  "filter": {},
  "enabled": true,
  "expiryDays": 0
}

Code samples

cURL
curl -X POST "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","eventName":"purchase","kind":"per_value","points":0,"minValueMinor":0,"filter":{},"enabled":true,"expiryDays":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Default Response
Example
{
  "id": "string",
  "programId": "string",
  "name": "string",
  "eventName": "string",
  "kind": "per_value",
  "points": 0,
  "minValueMinor": 0,
  "filter": {},
  "enabled": true,
  "expiryDays": 0
}
Schema
idstringrequired
programIdstringrequired
namestringrequired
eventNamestringrequired
kindstringrequired
per_value | fixed
pointsintegerrequired
minValueMinorintegerrequired
filterobjectrequired
enabledbooleanrequired
expiryDaysintegerrequired
4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

DELETEhttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules/{subId}

Parameters

idstringpathrequired
subIdstringpathrequired

Code samples

cURL
curl -X DELETE "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules/{subId}" \
  -H "Authorization: Bearer $SSLIP_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Default Response

Same as 200 · DELETE /v1/loyalty/programs/{id}

4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

PATCHhttps://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules/{subId}

Parameters

idstringpathrequired
subIdstringpathrequired

Request body

application/json
namestring
eventNamestring
kindstring
per_value | fixed
pointsinteger
minValueMinorinteger
filterobject
enabledboolean
expiryDaysinteger
{
  "name": "string",
  "eventName": "string",
  "kind": "per_value",
  "points": 0,
  "minValueMinor": 0,
  "filter": {},
  "enabled": true,
  "expiryDays": 0
}

Code samples

cURL
curl -X PATCH "https://hermetica.15.204.158.166.sslip.io/v1/loyalty/programs/{id}/rules/{subId}" \
  -H "Authorization: Bearer $SSLIP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","eventName":"string","kind":"per_value","points":0,"minValueMinor":0,"filter":{},"enabled":true,"expiryDays":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

4XX Default Response

Same as 4XX · GET /v1/loyalty/programs

5XX Default Response

Same as 4XX · GET /v1/loyalty/programs

Updated