Skip to main content

Response Structure

Scraped Forwarded Emails

Response from GET /api/emails/scraped_forwarded_emails.

Top-Level Fields

FieldTypeDescription
dataarrayList of forwarded email objects

Email Object Fields

FieldTypeDescription
senderstringEmail address of the receipt owner who forwarded the email
merchantstringMerchant name detected from the email
email_datestringTimestamp of the original email (ISO 8601)
blink_receipt_idstringUnique identifier for this receipt
scraped_dataobjectParsed receipt data (see below)

scraped_data Fields

FieldTypeDescription
indexintegerPosition of this result in the response array
blinkReceiptIdstringUnique receipt identifier
merchantNamestringName of the merchant
ereceiptOrderNumstringOrder number from the e-receipt
taxesdecimalTax amount
totaldecimalOrder total
productsarrayLine items (see below)
qualifiedPromotionsarrayPromotions that qualified for this receipt (see below)
unqualifiedPromotionsarrayPromotions that did not qualify (see below)

products Array

FieldTypeDescription
productDescriptionstringRaw product description from the e-receipt
productNumberstringProduct SKU or identifier
unitOfMeasurestringUnit of measurement (e.g. "lbs")
quantitydecimalQuantity purchased
unitPricedecimalPrice per unit
totalPricedecimalTotal price for this line item
shippingStatusstringShipping status for this item, if applicable
productNamestringEnriched product name
upcstringUniversal Product Code
imgUrlstringProduct image URL
categorystringProduct category path (e.g. `"Grocery
brandstringProduct brand
sizestringProduct size

qualifiedPromotions Array

FieldTypeDescription
slugstringPromotion identifier
rewardValuedecimalMonetary value of the reward
rewardCurrencystringCurrency of the reward (e.g. "dollars")
qualificationsarrayArray of qualifying product index arrays — each element represents one qualifying instance
relatedProductIndicesarrayIndexes of products in the products array that triggered this promotion

unqualifiedPromotions Array

FieldTypeDescription
slugstringPromotion identifier
errorCodeintegerNumeric error code for the disqualification reason
errorMessagestringHuman-readable explanation of why the promotion did not qualify

Example Response

{
"data": [
{
"sender": "receipt_owner@domain.com",
"merchant": "Walmart Grocery",
"email_date": "2019-08-08T00:39:30.000Z",
"blink_receipt_id": "ABCDEFGH-IJKL-MNOP-QRST-UVWXYZ123456",
"scraped_data": {
"index": 0,
"blinkReceiptId": "ABCDEFGH-IJKL-MNOP-QRST-UVWXYZ123456",
"merchantName": "Walmart Grocery",
"ereceiptOrderNum": "312312312312",
"taxes": 4.25,
"total": 178.44,
"products": [
{
"productDescription": "Banana",
"productNumber": "123123123123",
"unitOfMeasure": null,
"quantity": 2.0,
"unitPrice": 0.49,
"totalPrice": 0.98,
"shippingStatus": null,
"productName": "Yellow Bananas",
"upc": "4011",
"imgUrl": null,
"category": "Grocery|Produce|Fresh Fruit|Bananas",
"brand": null,
"size": null
}
],
"qualifiedPromotions": [
{
"slug": "a-promotion-1",
"rewardValue": 0.1,
"rewardCurrency": "dollars",
"qualifications": [[10]],
"relatedProductIndices": [10]
}
],
"unqualifiedPromotions": [
{
"slug": "a-promotion-2",
"errorCode": 99999,
"errorMessage": "Retailer Error: Receipt retailer is Merchant A. Promotion is only valid for the following retailer(s): Merchant B"
}
]
}
}
]
}

Scraped Forwarded Stats

Response from GET /api/emails/scraped_forwarded_stats.

Top-Level Fields

FieldTypeDescription
dataarrayList of stat objects

Stat Object Fields

FieldTypeDescription
scraped_successfullybooleanWhether the email was successfully scraped
attachment_typestringType of attachment in the email, if any
attachment_countintegerNumber of attachments
sendersstringJSON-encoded array of sender email addresses detected in the email
qualified_promotionsintegerNumber of promotions that qualified
promotion_value_dollarnumberTotal dollar value of qualified promotions
fail_reasonintegerFailure reason code, if scraping failed
user_error_typeintegerUser-level error type code, if applicable

Example Response

{
"data": [
{
"scraped_successfully": true,
"attachment_type": null,
"attachment_count": null,
"senders": "[\"grocery-wmt@walmart.com\", \"an_email@aol.com\", \"grocery@walmart.com\"]",
"qualified_promotions": 3,
"promotion_value_dollar": "0.7",
"fail_reason": null,
"user_error_type": null
}
]
}