Magic Receipt callbacks
This page describes on how to utilize callbacks for different magic receipt states.
What is a Magic Receipt callback?
A magic receipt callback is a specific callback only sent for magic receipt state changes (also called stateful magic receipt callbacks). The magic receipt callbacks work differently from the general reward callbacks since you will receive all the different states of a receipt and additional information about the receipt.
How to set up Magic Receipts callbacks
To set up the magic receipt stateful callbacks, visit the Publisher Dashboard -> Apps -> Your App -> Integration -> Magic Receipts Callback:
IMPORTANT: You can enable the stateful magic receipts callbacks which have the following effects:
- Magic receipt callbacks for all states will be sent now (Before only
COMPLETED
would be sent) - The transaction ID for each state change will be the same
- The
TYPE
parameter will return the typestate_change
To configure a new URL, press the cog wheel to open the callback URL configurator:
Multiple fields have to be filled out:
- Callback URL Host: Enter the callback endpoint URL you have set up.
- Protocol: In most cases, you want to leave it as is.
- Callback Parameter: Here you can add all the parameters you need to process the callbacks correctly. We highly recommend that you have the following parameters in there:
UID
,TX
,VAL
, andRAW
.- For magic receipts, we also recommend to add the
magic_receipt_state
parameter.magic_receipt_state
will return the state of a receipt:PENDING
,REVIEWING
,RECONCILED
,COMPLETED
. Learn more about the magic receipt states here.
- For magic receipts, we also recommend to add the
- Custom Parameter: In case you want to attach a parameter yourself, you can add it here. However, it does only support static parameters.
- Example URL: This shows you an example callback URL that you would receive. Keep in mind the hash in the example is not a valid one!
Here is an example of how a callback URL could be configured:
Press the Save button and then the Save Changes button in the top right.
Magic Receipt states
Each offer callback will have a different state. The following states are available:
COMPLETED
: The COMPLETED
callback will be sent when a receipt is approved. This is the only final state and can not change.
PENDING
: A PENDING
callback will be sent when a reward for a magic receipt is pending. After a PENDING
callback was sent, a COMPLETED
or RECONCILED
can follow.
REVIEWING
: A REVIEWING
callback will be sent when a receipt goes into manual review. A support person takes a look at the receipt. After a REVIEWING
callback was sent, a COMPLETED
or RECONCILED
can follow. REVIEWING
can only occur once after a RECONCILIED
was fired. A specific receipt submission can only be once in REVIEWING
.
RECONCILED
: A RECONCILED
callback will be sent when a magic receipt is rejected. You can use the reason and reason ID macros to learn more about the rejection. A RECONCILED
state is never final and can change to a COMPLETED
or REVIEWING
.
Make sure to only reward users for magic_receipt_state=COMPLETED callbacks!
Magic Receipt parameters
For magic receipts we do provide additional parameters for additional information:
Parameter | Type | Description |
---|---|---|
[%MAGIC_RECEIPT_STATE%] | String | It can only be used when using Stateful Magic Receipts Callbacks. One of: COMPLETED , PENDING , RECONCILED , REVIEWING |
[%RECEIPT:OFFER:ID%] | Integer | Returns the offer ID |
[%RECEIPT:OFFER:NAME%] | String | Returns the offer name |
[%RECEIPT:UPLOAD:ID%] | Integer | Returns an ID that is associated to an upload |
[%RECEIPT:UPLOAD:OFFER:ID%] | Integer | Returns the offer ID |
[%MAGIC_RECEIPT_REASON%] | String | Returns the reason why a receipt got rejected or approved. |
[%MAGIC_RECEIPT_REASON_ID%] | Integer | Returns the id of the reason. |
For a full list of all parameters click here. For more information on the magic receipt reasons, click here.
How to test Magic Receipt callbacks
Currently, we do not offer a way to test the magic receipts callbacks end-to-end. The only way to test if your system can process a callback, is to simulate it. You can simulate a callback by following these steps:
- Set up the magic receipts callback
- Copy the URL in the configuration modal at the bottom
- Replace the hash in the URL with the real hash according to this page
- Replace the reward amount, state and user ID with the correct ones
- Open the URL in the web browser
This will send you a callback with which you can test your system.
Magic Receipt Reasons and Reason IDs
In the following table you can see all the different reason IDs and descriptions.
statusID | Description | Description |
---|---|---|
1 | Pending Review | Pending automated review |
2 | Rejected | Error parsing receipt - manual reviews disabled |
3 | Rejected | Receipt is duplicate - different member |
4 | Rejected | Offer no longer available |
5 | Rejected | Offer not added to member list |
6 | Rejected | Unable to parse receipt merchant (legacy) |
7 | Rejected | Unrecognized receipt merchant |
8 | Rejected | Selected merchantID and receipt merchant mismatch (legacy) |
9 | Rejected | Offer purchased at incorrect merchant |
10 | Rejected | Unable to parse receipt date |
11 | Rejected | Receipt date before offer start date |
12 | Rejected | Receipt date after offer end date |
13 | Rejected | Member already completed offer max number of times |
14 | Rejected | No matching line items found |
15 | Rejected | Insufficient quantity available for offer |
16 | Rejected | Partner rejected completion |
17 | Approved | Awarded |
18 | Rejected | Internal error |
19 | Rejected | No goals found |
20 | Rejected | All goals capped |
21 | Rejected | Offer already in manual review |
22 | Rejected | An error occurred. Rolling back award |
23 | Pending Review | Pending manual review - manual offer |
24 | Pending Review | Under manual review |
25 | Approved | Awarded manually |
26 | Rejected | Incomplete receipt |
27 | Rejected | Duplicate receipt - manual review |
28 | Pending Review | User requested manual review pending |
29 | Rejected | Offer purchased at incorrect state (legacy) |
30 | Pending Review | Duplicate receipt from same user. Forced into manual review |
31 | Rejected | Fraud |
32 | Pending Review | Member previously uploaded fraud reciept - Forced manual review |
33 | Pending Review | Rate limiter prevented : Successfully uploaded x receipts |
34 | Pending Review | Rate limiter prevented : Redeemed X awards |
35 | Pending Review | Rate limiter prevented : Earned X dollars |
36 | Pending Review | Awaiting E-Receipt Email |
37 | Rejected | Matching E-Receipt Email Not Found |
39 | Rejected | Duplicate Any receipt |
40 | Approved | Admin Courtesy Award |
41 | Rejected | Receipt Date Out Of Range |
42 | Approved | First time courtesy award |
43 | Rejected | Offer purchased at incorrect medium |
44 | Pending Review | Pending COS Review |
45 | Rejected | Error Uploading to COS |
46 | Rejected | Offer Already Under COS Review |
47 | Rejected | Non COS Offer |
48 | Rejected | Receipt Is A Screen |
49 | Pending Review | COS Import: Under review |
50 | Rejected | COS Import: Receipt denied |
51 | Rejected | COS Import: Receipt ineligible |
52 | Approved | COS Import: Awarded |
53 | Rejected | COS Import: Receipt approved, offer denied |
54 | Rejected | COS Import: Receipt approved, error awarding |
55 | Rejected | Rekognition Fraud |
56 | Award Pending | Automated approved, award pending |
57 | Approved | Award credited after pending period |
58 | Approved | Manually credited pending award |
59 | Rejected | Bulk Transition - Rejected |
60 | Approved | Bulk Transition - Standard Award |
61 | Approved | Bulk Transition - Courtesty Award |
62 | Pending Review | Rekognition Possible Fraud |
63 | Pending Review | Rekognition Certain Fraud - Pending Manual Review |
64 | Rejected | Duplicate Receipt Same Offer Awarded |
65 | Rejected | Receipt Contains Banned Phrases |
66 | Rejected | Any Receipt Already Used |
67 | Rejected | All Line Items Are For Curbside Pickup |
68 | Rejected | Offer already Pending |
69 | Award Pending | Rate Limiter Pending: Successfully uploaded x receipts |
70 | Award Pending | Rate Limiter Pending: Redeemed X awards |
71 | Award Pending | Rate Limiter Pending: Earned X dollars |
72 | Rejected | All Line Items Have Incorrect Order Status |
73 | Rejected | REKOGNITION_FRAUD_MANUAL_REVIEW_DISABLED |
74 | Rejected | RATE_LIMITER_AWARD_PENDING_DISABLED |
75 | Pending Review | QUOTIENT_PENDING_UPLOAD |
76 | Pending Review | QUOTIENT_PENDING_REVIEW |
77 | Rejected | QUOTIENT_FAILED_UPLOAD |
78 | Rejected | QUOTIENT_REJECTED |
79 | Rejected | QUOTIENT_DUPLICATE_RECEIPT |
80 | Award Pending | QUOTIENT_APPROVED_AWARD_PENDING |
81 | Rejected | QUOTIENT_APPROVED_ERROR_AWARDING |
82 | Rejected | QUOTIENT_EXPIRE_OLD_UPLOADS |
83 | Rejected | QUOTIENT_RECEIPT_DATE_BEFORE_ACTIVATION |
84 | Rejected | QUOTIENT_NO_TRANSACTION_ID |
85 | Pending Review | Pending Manual Review - Admin Requested |
86 | Rejected | Image Size Inadequate - Possible Fraud |
87 | Pending Review | QUOTIENT_MANUAL_REVIEW |
88 | Rejected | QUOTIENT_MANUAL_REVIEW_REJECTED |
89 | Rejected | QUOTIENT_MANUAL_REVIEW_ALREADY_REVIEWED |
90 | Rejected | QUOTIENT_MANUAL_REVIEW_INSUFFICIENT_QUANTITY |
91 | Approved | QUOTIENT_MANUAL_REVIEW_APPROVED |
92 | Rejected | QUOTIENT_MANUAL_REVIEW_FRAUD |
93 | Approved | QUOTIENT_APPROVED_AUTOMATED |
94 | Pending Review | Quantity mismatch - manual review |
95 | Award Pending | Barcode Scan Award |
96 | Approved | Overrode Expired Upload |
97 | Pending Review | Auto Manual Review |
98 | Award Pending | All Line Items Are For Curbside Pickup Allowed |
99 | Rejected | Bad Barcode |
100 | Pending Review | Secondary Manual Review |
101 | Pending Review | Error Parsing Receipt Retry Upload |
102 | Rejected | Error Parsing Receipt Retry Failed |
103 | Pending Review | Secondary Manual Review From Approval |
104 | Pending Review | QUOTIENT_SECONDARY_MANUAL_REVIEW |
105 | Approved | QUOTIENT_APPROVED_SECONDARY_MANUAL_REVIEW |
Updated 15 days ago