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//perksHeaders
Authorization
Bearer {{ access_token | api_key }}Accept
application/jsonResponse 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//perksHeaders
Authorization
Bearer {{ access_token | api_key }}Accept
application/jsonBody
labelstringREQUIREDThe label of the perk.
namestringREQUIREDThe name of the perk (used internally).
data_typestringREQUIREDThe data type of the perk, available options: single_select or boolean.
optionsarrayREQUIREDThe 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": {}
}Code
Message
1003Invalid input.
Get Perk
Retrieve a Perk with its Perk Options using its UUID.
GET
https://api.piggy.eu/api//perks/{{perk_uuid}}Headers
ParamsAuthorization
Bearer {{ access_token | api_key }}Accept
application/jsonperk_uuidstringREQUIREDThe 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": {}
}Code
Message
1003Invalid input.
110000Perk not found.
Update Perk
Updates an existing Perk.
PUT
https://api.piggy.eu/api//perks/{{perk_uuid}}Headers
ParamsAuthorization
Bearer {{ access_token | api_key }}Accept
application/jsonperk_uuidstringREQUIREDThe Perk's UUID
Body
labelstringREQUIREDThe 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": {}
}Code
Message
1003Invalid input.
110000Perk not found.
