Logo
Getting started
    • Overview
    • Authentication
    • Testing
    • Error handling
    • Webhooks
    • Loyalty Tokens
    • Register API
Tutorials
API Reference

Perks

Perks are benefits associated with different Tiers in our system, designed to enhance customer engagement and loyalty Each tier, such as Bronze, Silver, and Gold, comes with specific perks like percentage discounts or free delivery. These Perks can be retrieved via our API to implement and manage the associated benefits, like applying set discount Perks.

List Perks

This API call fetches a list of all Perks with their Perk Options.

GET
https://api.piggy.eu/api//perks
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Response Example
Show more
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "data": [ { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "label": "Discount", "name": "discount", "data_type": "single_select", "options": [ { "label": "No discount", "value": "0_off", "default": true, }, { "label": "10% off", "value": "10_off", "default": false, }, { "label": "25% off", "value": "25_off", "default": false, } ] } ] }

Create Perk

Creates a new Perk.

POST
https://api.piggy.eu/api//perks
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json

Body

labelstring
REQUIRED
The label of the perk.
namestring
REQUIRED
The name of the perk (used internally).
data_typestring
REQUIRED
The data type of the perk, available options: single_select or boolean.
optionsarray
REQUIRED
The options of the perk (should contain a label, value and default key with values). When data_type is boolean, only true and false values are allowed. A default option is required: this one will be assigned to your existing tiers.
Response Example
Show more
1 2 3 4 5 6 7 8 9 10 { "data": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "label": "Discount", "name": "discount", "data_type": "single_select", "options": [] }, "meta": {} }

Get Perk

Retrieve a Perk with its Perk Options using its UUID.

GET
https://api.piggy.eu/api//perks/{{perk_uuid}}
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
perk_uuidstring
REQUIRED
The Perk's UUID
Response Example
Show more
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 { "data": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "label": "Discount", "name": "discount", "data_type": "single_select", "options": [ { "label": "No discount", "value": "0_off", "default": true, }, { "label": "10% off", "value": "10_off", "default": false, }, { "label": "25% off", "value": "25_off", "default": false, } ] }, "meta": {} }

Update Perk

Updates an existing Perk.

PUT
https://api.piggy.eu/api//perks/{{perk_uuid}}
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
perk_uuidstring
REQUIRED
The Perk's UUID

Body

labelstring
REQUIRED
The label of the perk.
Response Example
Show more
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 { "data": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "label": "Discount", "name": "discount", "data_type": "single_select", "options": [ { "label": "No discount", "value": "0_off", "default": true, }, { "label": "10% off", "value": "10_off", "default": false, }, { "label": "25% off", "value": "25_off", "default": false, } ] }, "meta": {} }