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

Contacts

Contacts are the end-users of Clients. Contacts are provided with basic attributes, such as an email address, first name, last name, and so forth. Any custom attributes can also be created, either in the Business Dashboard or via API. Their email address is the standard unique identifier, via which Contacts can be found. Aside from the email address, Contact Identifiers can also be used to find a Contact.


List Contacts

Retrieve a list of Contacts with pagination. The pagination has default values, but you can alter those by supplying the pageand limitparameters including values with the call.

Please note: the attributes array is now deprecated.
GET
https://api.piggy.eu/api/v3/oauth/clients/contacts
Headers
Authorization
Accept
Bearer {{ personal_access_token }}
application/json
Input parameters
limitnumber
optional
Limit of records to retrieve. Maximum: 100.
pagenumber
optional
Page to retrieve. Default: 1.
sortstring
optional
Sort by column. Ascending by default, prefix with a hyphen to sort descending (e.g. ?sort=-created_at)
Possible values:
created_atarray
optional
Filter on creation date, can only be sent in as array. Date value must be in ISO8601 format. Combine to retrieve contacts created between two dates.
Possible values:
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 { "data": [ { "id": 21, "uuid": "9504d4b2-03c5-41d8-8423-4b1821b6aa00", "email": "spongebob@bikinibottom.sea", "attributes": [], "tier": null, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 0, "id": 2625749 }, "prepaid_balance": { "balance_in_cents": 0 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": null, "tier": null, "uuid": "9504d4b2-03c5-41d8-8423-4b1821b6aa00", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": null, "lastname": "", "birthdate": null, "firstname": "", "created_at": "2021-10-20T18:06:09+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-13T12:56:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": false, "add_to_wallet": "http://piggy.eu/add-to-wallet/loyalty?uuid=9504d4b2-03c5-41d8-8423-4b1821b6aa00", "a_custom_attribute": null, "loyalty_balance": 0, "prepaid_balance": 0, "custom_app_login_url": "http://piggy.eu/home?token=eyJpdiI6IklhRnV6cDNkRUVieTZ2YzN2NlM0Y2c9PSIsInZhbHVlIjoieUZyMlJrRU5MVXRLZDh0dDErWWwxWjN6cnI2VFg3YmVWSWYvQTZhQXRWd1UrQXBqVTcwVmp1ZHo0bDNaK3FncTlGZWdBOEV3ZHkyY0pHemgrSitLSHRyblI0bEJwNnE4eEsyZ0cvN2dEeDQ2ekRjRVlzN05vWW9PWkZ1VjR5NUlCdDdFZUZwUmNHZ2pLTlp5OGdNWnRIaHFpVDdrVzljWC9JU2U4Vk1POFQ4RU9qdU5GbFAyc1ZSaStEekNGUkhyUjRINDRRSHkwa24yVmxkN25lVVBkdz09IiwibWFjIjoiOTcyMTRhZmRhNzRmYWQ3M2NjODY2YTYyOTgxYWFlZWY5OWMzMWY2ZTM0OWJiNDQxNTc1M2ViNjE4ODJjMDVjNyIsInRhZyI6IiJ9", "favorite_color": null, "custom_app_login_code": 973756, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "", "previous_loyalty_balance": 0, "default_contact_identifier": null, "subscription_preferences_url": "http://piggy.eu/subscription-preferences/9504d4b2-03c5-41d8-8423-4b1821b6aa00", "loyalty_last_transaction_date": null, "loyalty_first_transaction_date": null, "loyalty_number_of_transactions": 0, "loyalty_total_credits_received": 0, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=9504d4b2-03c5-41d8-8423-4b1821b6aa00&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=9504d4b2-03c5-41d8-8423-4b1821b6aa00&subscription_type=3", }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "", "uuid": "", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "", "lastname": "", "birthdate": "", "firstname": "", "created_at": "2021-10-20, 20:06", "postalcode": "", "updated_at": "2023-11-13, 13:56", "housenumber": "", "phonenumber": "", "is_anonymous": "False", "add_to_wallet": "http://piggy.eu/add-to-wallet/loyalty?uuid=9504d4b2-03c5-41d8-8423-4b1821b6aa00", "a_custom_attribute": "", "loyalty_balance": "0", "prepaid_balance": "0", "custom_app_login_url": "http://piggy.eu/home?token=eyJpdiI6Ikt2N3d5RXJRdEx3VXNqdFZpc2tNaVE9PSIsInZhbHVlIjoiSmpXeVRqZlJ5S2c1cUhOUGtzeXRmMmNQcEpBTzU3K1RjaFpzNnJxY2NBc2xFbVZDNXd5R2k1WDRyQWVQRUt3TDUrRnVPTnp5MURMakFjN0RITjNKQWtaRXpWK3V1V2lqOThTVnEvK3pyZkhHWm42VXdKSkkxSjc1MHZuTFBaK1hFdTZIRHBKaGdmaFR5clczelhYbHhkM0RaL2kzV0l1T0JtRVNqSk5lRm53TWpyWGlNYWExSzlEdXNCMmZyQi9YOU0xOUpvZjdYN2dZRzBJNnFFeVpMdz09IiwibWFjIjoiYmI5MzE3MGU5YmQxODUwOWI1ZTVjNjFjMWRjN2U0Y2FhOGEyOTI5ZDcwNWI5NzY3ZGUwN2U3NzQyNDEyZjAxMyIsInRhZyI6IiJ9", "favorite_color": "", "custom_app_login_code": "973756", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "", "previous_loyalty_balance": "0", "default_contact_identifier": "", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/9504d4b2-03c5-41d8-8423-4b1821b6aa00", "loyalty_last_transaction_date": "", "loyalty_first_transaction_date": "", "loyalty_number_of_transactions": "0", "loyalty_total_credits_received": "0", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=9504d4b2-03c5-41d8-8423-4b1821b6aa00&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=9504d4b2-03c5-41d8-8423-4b1821b6aa00&subscription_type=3", } }, { "id": 22, "uuid": "123", "email": "spongebob@bikinibottom.sea", "attributes": [], "tier": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "name": "Krusty Krew", "description": "Krusty Krew Members only", "position": 1, "media": null }, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 2895, "id": 2625740 }, "prepaid_balance": { "balance_in_cents": 4000 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": null, "tier": "1", "uuid": "123", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": null, "lastname": "SquarePants", "birthdate": null, "firstname": "SpongeBob", "created_at": "2021-10-20T18:06:09+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-13T14:37:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": false, "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": null, "loyalty_balance": 2895, "prepaid_balance": 40, "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6ImxTKzI5cXNMdlNXTnM0QXFpMUFVWHc9PSIsInZhbHVlIjoiWEFFK3JYb3lXVDlicC82SkJ0SWNQMUd6S0pUVDROY0ZiY2kvVWVxYzNNOTRoTmswSHcxSkZMOHZqTFRrdmsySm1HL0NJS3BybmNrNW50RkpyL2V2VndZUWVGTEcwK1ZXWWptcnp3MmE4M3kycmlleGRRY0VsaDZ3eXRGd1VkMHRlMGhzdWtic0U5c21Kbm5iTW9qWDcvU0pQSzNEUVRtYnhRWG9ucU1HR21JPSIsIm1hYyI6Ijc2MjY2M2YzNmY3NjNlODMwNWVhNDA2ZjIwZDAxMWExZDNjOWVkZDU4NDYwMGExMTJiYzBhODVkOGJlZGMyMTIiLCJ0YWciOiIifQ==", "favorite_color": null, "custom_app_login_code": 206820, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "123123;5fd3322e-671e-430f-aa38-5ed02e600ff7", "previous_loyalty_balance": 2897, "default_contact_identifier": "123123", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-13T14:37:04+00:00", "loyalty_first_transaction_date": "2023-01-09T15:03:37+00:00", "loyalty_number_of_transactions": 77, "loyalty_total_credits_received": 3014, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3", }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "Gold", "uuid": "", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "", "lastname": "SquarePants", "birthdate": "", "firstname": "SpongeBob", "created_at": "2021-10-20, 20:06", "postalcode": "", "updated_at": "2023-11-13, 15:37", "housenumber": "", "phonenumber": "", "is_anonymous": "False", "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": "", "loyalty_balance": "2895", "prepaid_balance": "40", "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Ijh6SnNUM2hIL1lqTStaNFVSbEtPZWc9PSIsInZhbHVlIjoiM0o4K2x4ajlOazl2bW90UzRGbkJnbVNjbDFaall1cWhOL1ZaRjE2d0VhR1BsSll6OG43dTU1dHlMVkxQMnlmOWZ6TFZaWTI3enZOTVFiWmxrNldNUitEMHRvQjIvWjUrbE1UNmJPaFRBb3R4cUxuMzNPUjdEWFZmZFRxUlJOQUs2MEdIK0llR1BQd0dncGhKanZSd0JYYVB3VWplek9FdnpPSUlKczBBTmVzPSIsIm1hYyI6ImYzOTFhMjA0ODE0ZjY3YmExYTY2ODM0YzhkNzFlNjFhNmM2M2Q1MjFhNDA2NDcxMjEzOGI1MGZkYmE1YjdlZWEiLCJ0YWciOiIifQ==", "favorite_color": "", "custom_app_login_code": "206820", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "Krusty Krab Downtown and Sesame Street", "previous_loyalty_balance": "2897", "default_contact_identifier": "123123", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-13, 15:37", "loyalty_first_transaction_date": "2023-01-09, 16:03", "loyalty_number_of_transactions": "77", "loyalty_total_credits_received": "3014", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3", } } ], "meta": { "page": 1, "limit": "2", "viewing_from": 1, "viewing_to": 2, "last_page": 31, "total": 62 } }

Create Contact

If a Contact needs to be created, only the email address is needed. To add any additional data to the Contact, a subsequent Update Contact API call can be used.

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

Body

emailstring
REQUIRED
The email address of the Contact to be created.
referral_codestring
OPTIONAL
A referral code used for Piggy's referral programme.
Response Example
Show more
1 2 3 4 5 6 { "data": { "uuid": "cd183615-d1cb-402a-b618-6472d5e13890" }, "meta": [] }

Create Contact Async

If a Contact needs to be created quickly and any system values that are normally created upon creation aren't relevant, this function can be used. This API call is much faster than the 'regular' creation API call, focusing on basic Contact creation.

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

Body

emailstring
REQUIRED
The email address of the Contact to be created.
referral_codestring
OPTIONAL
A referral code used for Piggy's referral programme.
Response Example
Show more
1 2 3 4 5 6 { "data": { "uuid": "cd183615-d1cb-402a-b618-6472d5e13890" }, "meta": [] }

Create Anonymous Contact

Creates an anonymous Contact with a fictitious email address. This can be used whenever a new Contact cannot (yet) be identified by their email address, but some actions are already desired (e.g. creation of Credit Receptions). The Contact in question can later create a Contact with their actual email address, and subsequently 'claim' the anonymous Contact, which is then merged with the new Contact.

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

Body

contact_identifier_valuestring
OPTIONAL
The unique value for the Contact Identifier, which will serve as the identifier
Response Example
Show more
1 2 3 4 5 6 { "data": { "uuid": "cd183615-d1cb-402a-b618-6472d5e13890" }, "meta": [] }

Find Contact

Find a Contact by email address. To find a Contact using an identifier, see Contact Identifiers.

Please note: the attributes array is now deprecated.
GET
https://api.piggy.eu/api//contacts/find-one-by
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
emailstring
REQUIRED
The Contact's email address
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "data": { "id": 22, "uuid": "123", "email": "spongebob@bikinibottom.sea", "tier": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "name": "Krusty Krew", "description": "Krusty Krew Members only", "position": 1, "media": null }, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 1612, }, "prepaid_balance": { "balance_in_cents": 2000 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": null, "tier": "1", "uuid": "123", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": null, "lastname": "", "birthdate": null, "firstname": "", "created_at": "2021-10-20T18:06:09+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-06T16:47:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": false, "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": null, "loyalty_balance": 1612, "prepaid_balance": 20, "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Ikh3ZW8yRW9pSU9Gc25SYmxRUFVVWUE9PSIsInZhbHVlIjoianhuYncxVHBlK0dqMTN4RHhXNzdZNVJ3aGJqcERFdmVWQlcxYjFNZVZYSVdoWVVMWk54K1UvQ2lFek1nMmtGaTJZNGRNOG1rUUxwRGNnU25JcitpN0d5RWVKN21kS1gvSmMvNTA2bmxqU0Z0cmxoR2pPT0Ewc1hXeEJsMkVJNGFDQlNlSWpHRXVpWndyd3g3eTVXck90Z0tlL3J2RHNRKzRjRkNGb0tmVmVzPSIsIm1hYyI6ImZlMzc0ZDYzZDVjNTNjOTc3YTc1ZTMxN2RmMzM4MDFkZWQ2YWI2MDkwNDY4OWQ1MDk0ZWRkN2Y2ZTdhZjY5ZmEiLCJ0YWciOiIifQ==", "custom_app_login_code": 198169, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "123123;5fd3322e-671e-430f-aa38-5ed02e600ff7", "previous_loyalty_balance": 1617, "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06T11:32:00+00:00", "loyalty_first_transaction_date": "2023-01-09T15:03:37+00:00", "loyalty_number_of_transactions": 55, "loyalty_total_credits_received": 1697, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "Gold", "uuid": "", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "", "lastname": "", "birthdate": "", "firstname": "", "created_at": "2021-10-20, 20:06", "postalcode": "", "updated_at": "2023-11-06, 17:47", "housenumber": "", "phonenumber": "", "is_anonymous": "False", "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": "", "loyalty_balance": "1612", "prepaid_balance": "20", "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Imx6TzJVV1ZwNlBRd3VkQmV1NnhKbnc9PSIsInZhbHVlIjoiVnlKZWM4OG5Vdjl0QmNEY242YmZ3OFNpWjQwQXkwRThmMCttWHlwQmNSTFluNzdpVkQwY0ZEcVo5TktvUXRHSVBYUE43S2dscFpyMUJnazFrWWZWVHI3cDNLTVJsZDcwWU9zQWdIejh5YjRQOGx4RjV6aDJjR3FTWlI1RTNlQlRrZEVNcURZeFlaZlYvQ2R2STdSU1RDdFdZT0RRdkxNN01vOXhLQnhaZkNVPSIsIm1hYyI6ImJjMzczNWQ2NGEwNzZlNjZhZTU0OTk3MzIxOTczODYzZjMxZjYwNzM2MjY5ZWJkODRkMTEzODU0NmQxMDU4OTQiLCJ0YWciOiIifQ==", "custom_app_login_code": "198169", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "Krusty Krab Downtown and Sesame Street", "previous_loyalty_balance": "1617", "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06, 12:32", "loyalty_first_transaction_date": "2023-01-09, 16:03", "loyalty_number_of_transactions": "55", "loyalty_total_credits_received": "1697", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" } }, "meta": [] }

Find or Create Contact

Find Contact by email address or – if no Contact exists yet for this email address – our API creates a new Contact for the email address you just supplied and returns the newly created Contact in the response.

GET
https://api.piggy.eu/api//contacts/find-or-create
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
emailstring
REQUIRED
The Contact's email address.
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "data": { "id": 22, "uuid": "123", "email": "spongebob@bikinibottom.sea", "tier": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "name": "Krusty Krew", "description": "Krusty Krew Members only", "position": 1, "media": null }, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 1612, }, "prepaid_balance": { "balance_in_cents": 2000 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": null, "tier": "1", "uuid": "123", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": null, "lastname": "", "birthdate": null, "firstname": "", "created_at": "2021-10-20T18:06:09+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-06T16:47:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": false, "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": null, "loyalty_balance": 1612, "prepaid_balance": 20, "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Ikh3ZW8yRW9pSU9Gc25SYmxRUFVVWUE9PSIsInZhbHVlIjoianhuYncxVHBlK0dqMTN4RHhXNzdZNVJ3aGJqcERFdmVWQlcxYjFNZVZYSVdoWVVMWk54K1UvQ2lFek1nMmtGaTJZNGRNOG1rUUxwRGNnU25JcitpN0d5RWVKN21kS1gvSmMvNTA2bmxqU0Z0cmxoR2pPT0Ewc1hXeEJsMkVJNGFDQlNlSWpHRXVpWndyd3g3eTVXck90Z0tlL3J2RHNRKzRjRkNGb0tmVmVzPSIsIm1hYyI6ImZlMzc0ZDYzZDVjNTNjOTc3YTc1ZTMxN2RmMzM4MDFkZWQ2YWI2MDkwNDY4OWQ1MDk0ZWRkN2Y2ZTdhZjY5ZmEiLCJ0YWciOiIifQ==", "custom_app_login_code": 198169, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "123123;5fd3322e-671e-430f-aa38-5ed02e600ff7", "previous_loyalty_balance": 1617, "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06T11:32:00+00:00", "loyalty_first_transaction_date": "2023-01-09T15:03:37+00:00", "loyalty_number_of_transactions": 55, "loyalty_total_credits_received": 1697, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "Gold", "uuid": "", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "", "lastname": "", "birthdate": "", "firstname": "", "created_at": "2021-10-20, 20:06", "postalcode": "", "updated_at": "2023-11-06, 17:47", "housenumber": "", "phonenumber": "", "is_anonymous": "False", "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": "", "loyalty_balance": "1612", "prepaid_balance": "20", "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Imx6TzJVV1ZwNlBRd3VkQmV1NnhKbnc9PSIsInZhbHVlIjoiVnlKZWM4OG5Vdjl0QmNEY242YmZ3OFNpWjQwQXkwRThmMCttWHlwQmNSTFluNzdpVkQwY0ZEcVo5TktvUXRHSVBYUE43S2dscFpyMUJnazFrWWZWVHI3cDNLTVJsZDcwWU9zQWdIejh5YjRQOGx4RjV6aDJjR3FTWlI1RTNlQlRrZEVNcURZeFlaZlYvQ2R2STdSU1RDdFdZT0RRdkxNN01vOXhLQnhaZkNVPSIsIm1hYyI6ImJjMzczNWQ2NGEwNzZlNjZhZTU0OTk3MzIxOTczODYzZjMxZjYwNzM2MjY5ZWJkODRkMTEzODU0NmQxMDU4OTQiLCJ0YWciOiIifQ==", "custom_app_login_code": "198169", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "Krusty Krab Downtown and Sesame Street", "previous_loyalty_balance": "1617", "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06, 12:32", "loyalty_first_transaction_date": "2023-01-09, 16:03", "loyalty_number_of_transactions": "55", "loyalty_total_credits_received": "1697", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" } }, "meta": [] }

Find or Create Contact Async

If a Contact needs to be retrieved or created quickly and any system values that are normally created upon contact creation aren't relevant, this can be used. This API call is much faster than the 'regular' find or create API call; only the Contact's UUID will be returned on the response in this instance.

GET
https://api.piggy.eu/api//contacts/find-or-create/async
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json

Body

emailstring
REQUIRED
The email address of the Contact to be created or to be found.
Response Example
Show more
1 2 3 4 5 6 { "data": { "uuid": "cd183615-d1cb-402a-b618-6472d5e13890" }, "meta": [] }

Get Contact

Retrieve a specific Contact with the the using its UUID.

Please note: the attributes array is now deprecated.
GET
https://api.piggy.eu/api//contacts/{{contact_uuid}}
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact'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 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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "data": { "id": 22, "uuid": "123", "email": "spongebob@bikinibottom.sea", "tier": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "name": "Krusty Krew", "description": "Krusty Krew Members only", "position": 1, "media": null }, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 1612, }, "prepaid_balance": { "balance_in_cents": 2000 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": null, "tier": "1", "uuid": "123", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": null, "lastname": "", "birthdate": null, "firstname": "", "created_at": "2021-10-20T18:06:09+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-06T16:47:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": false, "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": null, "loyalty_balance": 1612, "prepaid_balance": 20, "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Ikh3ZW8yRW9pSU9Gc25SYmxRUFVVWUE9PSIsInZhbHVlIjoianhuYncxVHBlK0dqMTN4RHhXNzdZNVJ3aGJqcERFdmVWQlcxYjFNZVZYSVdoWVVMWk54K1UvQ2lFek1nMmtGaTJZNGRNOG1rUUxwRGNnU25JcitpN0d5RWVKN21kS1gvSmMvNTA2bmxqU0Z0cmxoR2pPT0Ewc1hXeEJsMkVJNGFDQlNlSWpHRXVpWndyd3g3eTVXck90Z0tlL3J2RHNRKzRjRkNGb0tmVmVzPSIsIm1hYyI6ImZlMzc0ZDYzZDVjNTNjOTc3YTc1ZTMxN2RmMzM4MDFkZWQ2YWI2MDkwNDY4OWQ1MDk0ZWRkN2Y2ZTdhZjY5ZmEiLCJ0YWciOiIifQ==", "custom_app_login_code": 198169, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "123123;5fd3322e-671e-430f-aa38-5ed02e600ff7", "previous_loyalty_balance": 1617, "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06T11:32:00+00:00", "loyalty_first_transaction_date": "2023-01-09T15:03:37+00:00", "loyalty_number_of_transactions": 55, "loyalty_total_credits_received": 1697, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "Gold", "uuid": "", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "", "lastname": "", "birthdate": "", "firstname": "", "created_at": "2021-10-20, 20:06", "postalcode": "", "updated_at": "2023-11-06, 17:47", "housenumber": "", "phonenumber": "", "is_anonymous": "False", "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": "", "loyalty_balance": "1612", "prepaid_balance": "20", "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Imx6TzJVV1ZwNlBRd3VkQmV1NnhKbnc9PSIsInZhbHVlIjoiVnlKZWM4OG5Vdjl0QmNEY242YmZ3OFNpWjQwQXkwRThmMCttWHlwQmNSTFluNzdpVkQwY0ZEcVo5TktvUXRHSVBYUE43S2dscFpyMUJnazFrWWZWVHI3cDNLTVJsZDcwWU9zQWdIejh5YjRQOGx4RjV6aDJjR3FTWlI1RTNlQlRrZEVNcURZeFlaZlYvQ2R2STdSU1RDdFdZT0RRdkxNN01vOXhLQnhaZkNVPSIsIm1hYyI6ImJjMzczNWQ2NGEwNzZlNjZhZTU0OTk3MzIxOTczODYzZjMxZjYwNzM2MjY5ZWJkODRkMTEzODU0NmQxMDU4OTQiLCJ0YWciOiIifQ==", "custom_app_login_code": "198169", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "Krusty Krab Downtown and Sesame Street", "previous_loyalty_balance": "1617", "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06, 12:32", "loyalty_first_transaction_date": "2023-01-09, 16:03", "loyalty_number_of_transactions": "55", "loyalty_total_credits_received": "1697", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" } }, "meta": [] }

Update Contact

Contact's attributes. Please note that system values or system defined attributes, such as 'credit balance' or 'created at', cannot be updated.

Example payload:

1 2 3 4 5 6 7 { "attributes": { "firstname": "John", "lastname": "Doe", "example_custom_attribute": "Hello", } }
PUT
https://api.piggy.eu/api//contacts/{{contact_uuid}}
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact's UUID

Body

attributesarray
REQUIRED
An array of the attributes to be updated.
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 { "data": { "id": 22, "uuid": "123", "email": "spongebob@bikinibottom.sea", "tier": { "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839", "name": "Krusty Krew", "description": "Krusty Krew Members only", "position": 1, "media": null }, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 1612, }, "prepaid_balance": { "balance_in_cents": 2000 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": null, "tier": "1", "uuid": "123", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": null, "lastname": "", "birthdate": null, "firstname": "", "created_at": "2021-10-20T18:06:09+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-06T16:47:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": false, "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": null, "loyalty_balance": 1612, "prepaid_balance": 20, "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Ikh3ZW8yRW9pSU9Gc25SYmxRUFVVWUE9PSIsInZhbHVlIjoianhuYncxVHBlK0dqMTN4RHhXNzdZNVJ3aGJqcERFdmVWQlcxYjFNZVZYSVdoWVVMWk54K1UvQ2lFek1nMmtGaTJZNGRNOG1rUUxwRGNnU25JcitpN0d5RWVKN21kS1gvSmMvNTA2bmxqU0Z0cmxoR2pPT0Ewc1hXeEJsMkVJNGFDQlNlSWpHRXVpWndyd3g3eTVXck90Z0tlL3J2RHNRKzRjRkNGb0tmVmVzPSIsIm1hYyI6ImZlMzc0ZDYzZDVjNTNjOTc3YTc1ZTMxN2RmMzM4MDFkZWQ2YWI2MDkwNDY4OWQ1MDk0ZWRkN2Y2ZTdhZjY5ZmEiLCJ0YWciOiIifQ==", "custom_app_login_code": 198169, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "123123;5fd3322e-671e-430f-aa38-5ed02e600ff7", "previous_loyalty_balance": 1617, "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06T11:32:00+00:00", "loyalty_first_transaction_date": "2023-01-09T15:03:37+00:00", "loyalty_number_of_transactions": 55, "loyalty_total_credits_received": 1697, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "Gold", "uuid": "", "email": "spongebob@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "", "lastname": "", "birthdate": "", "firstname": "", "created_at": "2021-10-20, 20:06", "postalcode": "", "updated_at": "2023-11-06, 17:47", "housenumber": "", "phonenumber": "", "is_anonymous": "False", "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=123", "a_custom_attribute": "", "loyalty_balance": "1612", "prepaid_balance": "20", "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Imx6TzJVV1ZwNlBRd3VkQmV1NnhKbnc9PSIsInZhbHVlIjoiVnlKZWM4OG5Vdjl0QmNEY242YmZ3OFNpWjQwQXkwRThmMCttWHlwQmNSTFluNzdpVkQwY0ZEcVo5TktvUXRHSVBYUE43S2dscFpyMUJnazFrWWZWVHI3cDNLTVJsZDcwWU9zQWdIejh5YjRQOGx4RjV6aDJjR3FTWlI1RTNlQlRrZEVNcURZeFlaZlYvQ2R2STdSU1RDdFdZT0RRdkxNN01vOXhLQnhaZkNVPSIsIm1hYyI6ImJjMzczNWQ2NGEwNzZlNjZhZTU0OTk3MzIxOTczODYzZjMxZjYwNzM2MjY5ZWJkODRkMTEzODU0NmQxMDU4OTQiLCJ0YWciOiIifQ==", "custom_app_login_code": "198169", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "Krusty Krab Downtown and Sesame Street", "previous_loyalty_balance": "1617", "default_contact_identifier": "hash123456", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/123", "loyalty_last_transaction_date": "2023-11-06, 12:32", "loyalty_first_transaction_date": "2023-01-09, 16:03", "loyalty_number_of_transactions": "55", "loyalty_total_credits_received": "1697", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=123&subscription_type=3" } }, "meta": [] }

Delete Contact

Deletes a Contact. This action is irreversible, the Contact's Credit Balance and any relation to other entities within the system will be removed, although the entities themselves may remain. When using 'DEFAULT' as the deletion type, a log is created containing detailed information. If 'GDPR' is used as the deletion type, any reference to personal data is removed.

Note: This API call schedules the removal of the Contact, this may take a few minutes.

POST
https://api.piggy.eu/api//contacts/{{contact_uuid}}/delete
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact's UUID.

Body

typestring
REQUIRED
The deletion type. Options are DEFAULT and GDPR.
Response Example
Show more
1 2 3 4 { "data": null, "meta": {} }

Claim Anonymous Contact

This function enables the conversion of an anonymous Contact (registered with a fictional email address) into a recognized Contact with a real email address. If a Contact already exists with the provided real email address, the anonymous and existing Contacts will be merged.

PUT
https://api.piggy.eu/api//contacts/{{anonymous_contact_uuid}}/claim
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
anonymous_contact_uuidstring
OPTIONAL
The anonymous Contact's UUID that contains a fictional email address

Body

emailstring
OPTIONAL
The real email address for the Contact that is about to be not anonymous anymore.
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 { "data": { "id": 45842, "uuid": "999", "email": "patrick@bikinibottom.sea", "tier": null, "subscriptions": [ { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Marketing", "description": "Subscribe here for marketing purposes", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": "123123123", "id": 1 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Bikini Bottom Deals", "description": "A monthly email blast with our best offers!", "active": true, "strategy": "DOUBLE_OPT_IN", "uuid": null, "id": 3 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Events", "description": "Stay in the loop for all our special events", "active": true, "strategy": "OPT_IN", "uuid": null, "id": 4 } }, { "is_subscribed": false, "status": "UNSUBSCRIBED", "subscription_type": { "name": "Krusty Krab News", "description": "Never miss out on any of our newest features", "active": true, "strategy": "OPT_OUT", "uuid": null, "id": 5 } } ], "credit_balance": { "balance": 0, "id": 2625795 }, "prepaid_balance": { "balance_in_cents": 0 }, "current_values": { "age": null, "city": "Bikini Bottom", "dier": "false", "tier": null, "uuid": "3a685add-1711-425d-9184-fc6db18e0e1d", "email": "plankton@bikinibottom.sea", "avatar": "", "locale": null, "status": "ACTIVE", "address": "", "channel": "OAUTH_API", "lastname": "", "birthdate": null, "firstname": "", "created_at": "2023-11-01T14:59:14+00:00", "postalcode": "9999YZ", "updated_at": "2023-11-01T15:05:00+00:00", "housenumber": 12, "phonenumber": "", "is_anonymous": true, "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=3a685add-1711-425d-9184-fc6db18e0e1d", "a_custom_attribute": null, "loyalty_balance": 0, "prepaid_balance": 0, "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6Ikx2dDRqSTF4U3phV21PL1BIcG1STWc9PSIsInZhbHVlIjoiVnc0dUdhblAzZDdod29NQnhmVDlqbFdxYkF3S041WnhlN3hJQ3hrYklaa3BVVzhGbkIrM2R3citUWDVRQnRFL0IrSFJtY1JoQ09WRmR4N3hrZGFzdXBUL2pQVDF4aW9nWFEwQTFUcmliQk5EYXVBaEVpODZiMzh6Qm9Kb0E5QjZaOXM4bjQ3bFhIVEY3SVovRzRnejJZZlVYZUp0ZnA2RUNlUHVYYWlYNytucER5QndxYVNUSnRYVm9na1FrempOTDBmRFE0QkhJOFFIYTM2SnMvcTJ2QT09IiwibWFjIjoiN2JiZTQ5ZDVjMjgyMjY3NDkzYjE2ZTQ0ZTc5M2UyNjUyZWU3ODdiYmFlNzg2N2FjZjJjMDg3MDcxMGUzNTcxNSIsInRhZyI6IiJ9", "custom_app_login_code": 184014, "subscription_status_1": "UNSUBSCRIBED", "subscription_status_3": "UNSUBSCRIBED", "subscription_status_4": "UNSUBSCRIBED", "subscription_status_5": "UNSUBSCRIBED", "loyalty_associated_shops": "", "previous_loyalty_balance": 0, "default_contact_identifier": null, "subscription_preferences_url": "http://piggy.eu/subscription-preferences/3a685add-1711-425d-9184-fc6db18e0e1d", "loyalty_last_transaction_date": null, "loyalty_first_transaction_date": null, "loyalty_number_of_transactions": 0, "loyalty_total_credits_received": 0, "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=3a685add-1711-425d-9184-fc6db18e0e1d&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=3a685add-1711-425d-9184-fc6db18e0e1d&subscription_type=3" }, "current_display_values": { "age": "", "city": "", "dier": "False", "tier": "", "uuid": "", "email": "plankton@bikinibottom.sea", "avatar": "", "locale": "", "status": "Active", "address": "", "channel": "Oauth API", "lastname": "", "birthdate": "", "firstname": "", "created_at": "2023-11-01, 15:59", "postalcode": "", "updated_at": "2023-11-01, 16:05", "housenumber": "", "phonenumber": "", "is_anonymous": "True", "add_to_wallet": "https://leat.com/add-to-wallet/loyalty?uuid=3a685add-1711-425d-9184-fc6db18e0e1d", "a_custom_attribute": "", "loyalty_balance": "0", "prepaid_balance": "0", "custom_app_login_url": "https://leat.com/home?token=eyJpdiI6ImhWRlZWek8vUDBFWHpGUFRqaXVuQ1E9PSIsInZhbHVlIjoiRFU4WHF4bitIOFVuMHZvdEdFcjZYSlJOZFFxMHJ6bVpNVW4yZVRCZktna3ZXTExZb3d5RnRYNEVIU2FWM3RrMThOamZlUWRXRTdhdCtxazgvQjRyVEJrREwrNDFsSkhpUERWTTJLTTRkbDMrd1kzM3d5KzdLMXMvbVFZcGVFaHFSR0p4aG5WMUJlRHg0UFB6NllINTdYMURhMzMxY1FuVVZZeGdrcmRGaWIrQytxdXBveVZHampsbUdpUlowWktDbEpzbFlHTzBQSWFyWHo0N2ErbWFzZz09IiwibWFjIjoiOTQ4ZmExZGM2YWU4NTAwYjIxZTY4ZmI5YzhhZDFiYTQzMDQ5ZTdmNWNlNGQyNmU3Yjk3MmZkNDI5ZjJmYzE3NSIsInRhZyI6IiJ9", "custom_app_login_code": "184014", "subscription_status_1": "Unsubscribed", "subscription_status_3": "Unsubscribed", "subscription_status_4": "Unsubscribed", "subscription_status_5": "Unsubscribed", "loyalty_associated_shops": "", "previous_loyalty_balance": "0", "default_contact_identifier": "", "subscription_preferences_url": "http://piggy.eu/subscription-preferences/3a685add-1711-425d-9184-fc6db18e0e1d", "loyalty_last_transaction_date": "", "loyalty_first_transaction_date": "", "loyalty_number_of_transactions": "0", "loyalty_total_credits_received": "0", "double_opt_in_confirmation_url_1": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=3a685add-1711-425d-9184-fc6db18e0e1d&subscription_type=1", "double_opt_in_confirmation_url_3": "http://piggy.eu/double-opt-in-confirmation?contact_uuid=3a685add-1711-425d-9184-fc6db18e0e1d&subscription_type=3" } }, "meta": [] }

Merge Contact

WARNING: Use at your own risk and with consent from your clients. Before using, ensure both email addresses belong to the same person.

Merges a 'source' Contact into a 'destination' Contact. The 'destination' Contact will be the resulting Contact, whilst the 'source' Contact will be removed. Note: This cannot be undone, so use with care. Only use after verifying the person in question has access to both email addresses.

Note: This API call schedules the merge of the Contacts, this may take a few minutes.

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

Body

source_contact_uuidstring
REQUIRED
The UUID of the Source Contact which will cease to exist.
destination_contact_uuidstring
REQUIRED
The UUID of the Destination Contact which remain.

Get Contact Identifiers

Use this endpoint to retrieve a Contact's Contact Identifiers.

GET
https://api.piggy.eu/api//contacts/{{contact_uuid}}/contact-identifiers
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact's UUID from whom you want to retrieve the Contact Identifiers.
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 { "data": { [ "name": "Main Loyalty Card", "value": "ABCDE12356-90", "active": true, "default": true, "contact": { "uuid": "123abc-def789-qwerty-34567", } ], [ "name": "Gary Card", "value": "QWERTY-7890", "active": true, "default": false, "contact": { "uuid": "123abc-def789-qwerty-34567", } ], }, "meta": [] }

Get Credit Balance

Retrieve the current Credit Balance of a specific Contact, identified through their UUID.

GET
https://api.piggy.eu/api//contacts/{{contact_uuid}}/credit-balance
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact's UUID
Response Example
Show more
1 2 3 4 5 6 { "data": { "balance": 49 }, "meta": [] }

Get Prepaid Balance

Use this function to retrieve the Prepaid Balance of a particular Contact, identified by their UUID.

GET
https://api.piggy.eu/api//contacts/{{contact_uuid}}/prepaid-balance
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact's UUID
Response Example
Show more
1 2 3 4 5 6 7 { "data": { "balance_in_cents": 5000, "balance": "€50.00" }, "meta": [] }

Get Tier

Use this endpoint to retrieve the current loyalty Tier of a specific Contact. It’s useful for understanding a Contact's loyalty status and offering them tailored Rewards based on their Tier.

GET
https://api.piggy.eu/api//contacts/{{contact_uuid}}/tier
Headers
Authorization
Bearer {{ access_token | api_key }}
Accept
application/json
Params
contact_uuidstring
REQUIRED
The Contact's UUID from whom you want to retrieve the Tier.
Response Example
Show more
1 2 3 4 5 6 7 8 9 10 { "data": { "name": "Krusty Krew", "description": "Krusty Krew Members only", "position": 1, "media": null, "uuid": "ea77edd4-5a5e-4a6e-aeda-55038c43c839" }, "meta": [] }