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

Reward Attributes

Rewards consist of a required number of credits (or points), a title and an image or emoji. However, any number of custom Reward Attributes can be created as well. There are, however, some more advanced attributes – such as cost price and a claim limit – and filters. They can also be complemented with custom attributes, which mostly serves integrating purposes, so you might want to keep this in the back of your mind.

List Reward Attributes

Get a list of Reward Attributes.

GET
https://api.piggy.eu/api//reward-attributes
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 { "data": [ { "name": "eennaam", "label": "testNaam ", "placeholder": "somePlaceholder", "description": "someOmschrijving", "type": "boolean", "fieldType": "default", "options": [], "isPiggyDefined": 0, "isSoftReadOnly": 0, "isHardReadOnly": 0 }, { "name": "middle_name", "label": "Middle name", "placeholder": null, "description": "Contact's middle name", "type": "text", "fieldType": "text", "options": [], "isPiggyDefined": 0, "isSoftReadOnly": 1, "isHardReadOnly": 1 }, { "name": "middle_name1223434", "label": "Middle name123412312", "placeholder": "Your middle name", "description": "Contact's middle name", "type": "text", "fieldType": "text", "options": [], "isPiggyDefined": 0, "isSoftReadOnly": 1, "isHardReadOnly": 1 }, { "name": "asdfjkl", "label": "Asfjkl", "placeholder": "", "description": "Some description", "type": "select", "fieldType": "select", "options": [ { "label": "spongebob", "value": "100" }, { "label": "kees", "value": "200" } ], "isPiggyDefined": 0, "isSoftReadOnly": 0, "isHardReadOnly": 0 }, { "name": "something", "label": "Something", "placeholder": "", "description": "Some description", "type": "select", "fieldType": "select", "options": [ { "label": "spongebob", "value": "100" }, { "label": "kees", "value": "200" } ], "isPiggyDefined": 0, "isSoftReadOnly": 0, "isHardReadOnly": 0 } ] }

Create Reward Attribute

Globally create a Reward Attribute for the Account in question.

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

Body

namestring
REQUIRED
The name (internal value) for the attribute.
labelstring
OPTIONAL
The label for the attribute.
descriptionstring
OPTIONAL
Description for the attribute.
typestring
REQUIRED
Type of attribute (options: url, text,date, phone, float, color, email, number, select, boolean, rich_text, date_time, long_text, date_range, time_range, identifier, birth_date, file_upload, media_upload, multi_select, license_plate).
placeholderstring
OPTIONAL
An additional hint, description, or example of the information required for a particular field.
optionsarray
OPTIONAL
Applicable for (multi)selects only. Array consisting of label and value objects.
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 { "name": "middle_name8349", "label": "Middle name", "description": "Contact's middle name", "data_type": "select", "placeholder": "Your middle name", "options": [ { "label" : "Harry", "value" : 100 }, { "label" : "SpongeBob", "value" : 200 }, { "label" : "Peter", "value" : 300 } ] }