Staged Credit Receptions

Staged Credit Receptions are 'to be claimed credits', usually sent by email. After creation of a Staged Credit Reception, a system email can be sent out to the recipient. Conversely, if desired, the URL generated in the creation can be extracted from the response and used in any way imaginable (printed out, used in an alternative mailing system, sent via text etc.).

Through the generated URL, the recipient is redirected to the Customer Dashboard or Customer App, where they are to login. After logging in, the credits can be claimed. Please note that the Customer account with which they login to claim the points need not be registered to the same email address used in the email sent.



Create Staged Credit Reception

Creates a Staged Credit Reception. If credits are not set, loyalty rules (if set) are used to calculate credits. Keep in mind that the (potential) appliance of loyalty rules happens upon redemption of the Staged Credit Reception (when the Credit Reception is actually created).

Note that the creation of a Staged Credit Reception does not yet send out an email whereby the credits can be claimed.

POSTCreate Staged Credit Reception

https://api.piggy.nl/api//staged-credit-receptions

HEADERS

AuthorizationBearer {{ api_key }}

BODY

creditsnumber
REQUIRED | OPTIONALRequired if purchase_amount is not set. Number of credits to be claimed. Bypasses any set loyalty rules.
purchase_amountnumber
REQUIRED | OPTIONALRequired if credits is not set. The purchase amount for the transaction in cents. Adheres to loyalty rules.
1 2 3 4 5 6 7 8 9 10 { "data": { "id": 1, "url": "https://customer.piggy.nl/claim-credits-reception?hash=HASH123", "hash": "HASH123", "credits": 10, "created_at": "2021-01-01T12:00:00+00:00" }, "meta": [] }

Code

Message

7002
Account inactive.
55018
Loyalty Program not active.
1102
Shop not linked to a Loyalty Program.
1008
Shop not found.
7011
User has no access to this account.


Get Staged Credit Reception

Gets the information about the Staged Credit Reception, including a linked Credit Reception when present (which would indicate that it has been redeemed).

GETGet Staged Credit Reception

https://api.piggy.nl/api//mstaged-credit-receptions/{staged_credit_reception_id}

HEADERS

AuthorizationBearer {{ api_key }}

PARAMETERS

staged_credit_reception_idnumber
REQUIREDThe Staged Credit Reception's ID
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "data": { "id": 1, "hash": "HASH123", "credits": 10, "url": "https://customer.piggy.nl/claim-credits-reception?hash=HASH123", "created_at": "2021-01-01T12:00:00+00:00", "credit_reception": { "id": "1", "credits": 10, "created_at": "2021-01-01T12:15:00+00:00", "member": { "id": 1, "email": "member@piggy.eu" } } }, "meta": [] }
1 2 3 4 5 6 7 8 9 10 11 { "data": { "id": 1, "hash": "HASH123", "url": "https://customer.piggy.nl/claim-credits-reception?hash=HASH123", "credits": 10, "created_at": "2021-01-01T12:00:00+00:00", "credit_reception": null }, "meta": [] }

Code

Message

7002
Account inactive.
55018
Loyalty Program not active.
1102
Shop not linked to a Loyalty Program.
1041
Staged Credit Reception not found.
1103
Loyalty Program not found.


Send Staged Credit Reception

Send an email to the recipient, by which the Staged Credit Reception can be claimed.

POSTSend Staged Credit Reception

https://api.piggy.nl/api//staged-credit-receptions/{staged_credit_reception_id}/send

HEADERS

AuthorizationBearer {{ api_key }}

PARAMETERS

staged_credit_reception_idnumber
REQUIREDThe Staged Credit Reception ID

BODY

emailstring
REQUIREDRecipient's email address where the staged credit reception is to be sent
localestring
OPTIONALLanguage of the email sent. By default, it takes the language set on the Shop. Possible values: Dutch ('nl'), English ('en') and German ('de').
1 2 3 4 { "data": [], "meta": [] }

Code

Message

7002
Account inactive.
55018
Loyalty Program not active.
1102
Shop not linked to a Loyalty Program.
1103
Loyalty Program not found.
1041
Staged Credit Reception not found.
1034
Staged credit reception is already redeemed.

Related