Skip to main content

Configuration

The configuration endpoints let you set global scraping behavior for your account and inspect the currently active settings. You must configure at least a results_endpoint before creating jobs.


POST /ereceipts/config​

Replaces your account configuration.

A POST replaces the whole configuration. Any field you omit is reset to its default rather than keeping its stored value. The one exception is retailers — see Retailers below.

Method: POST Path: /ereceipts/config Content-Type: application/json

Request Headers​

HeaderTypeRequiredDescription
api-keystringYesYour BlinkReceipt API key

Request Body​

FieldTypeRequiredDefaultDescription
results_endpointstringYes—Webhook URL where parsed results are POSTed. Must be a valid, publicly reachable HTTPS URL; an invalid URL returns error code 102
day_cutoffintegerNo*nullHow many days back to search for emails. Mutually exclusive with date_cutoff
date_cutoffintegerNo*nullEarliest email date to process, as a UNIX timestamp in seconds. Mutually exclusive with day_cutoff
return_emlbooleanNofalseWhen true, includes the raw EML content in the ereceiptRawEML field of each result
enable_pii_scrubbingbooleanNofalseWhen true, PII is redacted from ereceiptEmailSubject and ereceiptRawHTMLtext, and the email body is delivered as plain text in ereceiptRawHTMLtext instead of raw HTML in ereceiptRawHTML
use_only_retailer_emailsbooleanNofalseWhen true, only the senders in your retailers list are searched. When false, default_retailer_country_list also applies
default_retailer_country_listarray of stringsNo[]Country codes whose retailers are searched in addition to your retailers list. See Country Codes
retailersarrayNostored list is keptArray of retailer objects with per-retailer cutoff configuration

You must specify either day_cutoff or date_cutoff at the global level — not both, and not neither.

Country Codes​

default_retailer_country_list accepts the following values. It applies only when use_only_retailer_emails is false.

CodeCountry
USUnited States
UKUnited Kingdom
CACanada
AUAustralia
FRFrance
DEGermany
ZASouth Africa
BEBelgium
NLNetherlands

US also covers retailers that are not assigned to a country.

Coverage varies by country. US and UK have the broadest retailer coverage; the rest are smaller. Any code outside this list is accepted but matches no retailers.

Retailers​

retailers is the only field that is not reset when omitted:

You sendResult
No retailers key, or nullStored retailer list is left untouched
[]All retailers are removed
An array of retailer objectsStored list is replaced by what you sent

Duplicate email values within one request are ignored after the first.

Retailer Object​

Each object in the retailers array describes a specific sender and its cutoff settings.

FieldTypeRequiredDescription
emailstringYesSender email address (e.g., auto-confirm@amazon.com) or bare domain (e.g., amazon.com)
day_cutoffintegerNo*Days back to search for this retailer
date_cutoffintegerNo*Earliest email date for this retailer, as a UNIX timestamp in seconds

A retailer may specify day_cutoff or date_cutoff, but not both. A retailer with neither inherits the global cutoff.

Example Request​

{
"results_endpoint": "https://your-server.com/webhooks/ereceipts",
"day_cutoff": 14,
"return_eml": false,
"enable_pii_scrubbing": true,
"retailers": [
{
"email": "auto-confirm@amazon.com",
"day_cutoff": 7
},
{
"email": "noreply@ebay.com",
"day_cutoff": 30
}
]
}

Response​

Returns the stored configuration, in the same shape as GET /ereceipts/config.

{
"results_endpoint": "https://your-server.com/webhooks/ereceipts",
"return_eml": false,
"default_retailer_country_list": [],
"enable_pii_scrubbing": true,
"use_only_retailer_emails": false,
"date_cutoff": null,
"date_cutoff_iso": null,
"day_cutoff": 14,
"retailers": [
{
"email": "auto-confirm@amazon.com",
"day_cutoff": 7
},
{
"email": "noreply@ebay.com",
"day_cutoff": 30
}
]
}

On failure, the response carries a code and a message. See error-handling.md for the full list of configuration error codes.


GET /ereceipts/config​

Returns the currently active configuration for your account.

Method: GET Path: /ereceipts/config

Request Headers​

HeaderTypeRequiredDescription
api-keystringYesYour BlinkReceipt API key

Response​

FieldTypeDescription
results_endpointstringConfigured webhook URL
return_emlbooleanWhether raw EML is returned in results
default_retailer_country_listarray of stringsConfigured country codes
enable_pii_scrubbingbooleanWhether PII is redacted from ereceiptEmailSubject and ereceiptRawHTMLtext
use_only_retailer_emailsbooleanWhether only the retailers list is searched
date_cutoffinteger or nullGlobal date cutoff as a UNIX timestamp in seconds
date_cutoff_isostring or nullThe same cutoff as an ISO 8601 string, for readability
day_cutoffinteger or nullGlobal day cutoff setting
retailersarrayArray of configured retailer objects

Only one of date_cutoff / date_cutoff_iso and day_cutoff is set; the other is null. The same applies to each retailer object.

If use_only_retailer_emails is false and default_retailer_country_list is not empty, the returned retailers array also includes the retailers matched by those countries. Those entries carry your global cutoff.

Example Response​

{
"results_endpoint": "https://your-server.com/webhooks/ereceipts",
"return_eml": false,
"default_retailer_country_list": ["US", "UK"],
"enable_pii_scrubbing": false,
"use_only_retailer_emails": false,
"date_cutoff": 1719792000,
"date_cutoff_iso": "2024-07-01T00:00:00.000Z",
"day_cutoff": null,
"retailers": [
{
"email": "auto-confirm@amazon.com",
"day_cutoff": 7
},
{
"email": "noreply@ebay.com",
"date_cutoff": 1719792000,
"date_cutoff_iso": "2024-07-01T00:00:00.000Z"
}
]
}

Notes​

  • POST /ereceipts/config replaces your configuration. Send every field you want to keep, not just the ones you are changing. The exception is retailers, which is preserved when omitted.
  • For listing or deleting individual retailers, use the /ereceipts/retailers endpoints described in endpoints.md.