Skip to main content

Endpoint Reference

All endpoints share the same base URL and authentication model.

Base URL: https://api.blinkreceipt.com

Authentication: Every request requires an api-key header containing your BlinkReceipt API key.


Configuration​

POST /ereceipts/config​

Replaces your account configuration. Any field you omit is reset to its default, except retailers, which is preserved when omitted.

See configuration.md for the full field reference and examples.

Headers:

HeaderRequiredDescription
api-keyYesYour API key
Content-TypeYesapplication/json

Request Body (JSON):

FieldTypeRequiredDescription
results_endpointstringYesWebhook URL for results delivery. Must be a valid, publicly reachable HTTPS URL
day_cutoffintegerNo*Days back to search
date_cutoffintegerNo*Earliest email date, as a UNIX timestamp in seconds
return_emlbooleanNoInclude raw EML in results
enable_pii_scrubbingbooleanNoRedact PII from ereceiptEmailSubject and ereceiptRawHTMLtext
use_only_retailer_emailsbooleanNoSearch only your retailers list
default_retailer_country_listarray of stringsNoCountry codes whose retailers are also searched: US, UK, CA, AU, FR, DE, ZA, BE, NL
retailersarrayNoPer-retailer cutoff configs

Response: the stored configuration. See configuration.md.


GET /ereceipts/config​

Returns the currently active account configuration.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Response:

{
"results_endpoint": "https://your-server.com/webhooks/ereceipts",
"return_eml": false,
"default_retailer_country_list": [],
"enable_pii_scrubbing": false,
"use_only_retailer_emails": false,
"date_cutoff": null,
"date_cutoff_iso": null,
"day_cutoff": 14,
"retailers": []
}

Retailers​

GET /ereceipts/retailers​

Returns all retailers currently saved to your account configuration, as a bare array.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Response:

[
{
"email": "auto-confirm@amazon.com",
"day_cutoff": 7
},
{
"email": "noreply@ebay.com",
"date_cutoff": 1719792000
}
]

Retailer Object Fields:

FieldTypeDescription
emailstringSender email address or domain
day_cutoffintegerPer-retailer day cutoff, if set
date_cutoffintegerPer-retailer cutoff as a UNIX timestamp in seconds, if set

Only one of day_cutoff / date_cutoff appears per entry. A retailer with neither returns email alone.


DELETE /ereceipts/retailers​

Removes one or more retailers from your configuration.

Headers:

HeaderRequiredDescription
api-keyYesYour API key
Content-TypeYesapplication/json

Request Body:

FieldTypeRequiredDescription
retailer_emailsarray of stringsYesEmail addresses to remove

Example Request:

{
"retailer_emails": [
"auto-confirm@amazon.com",
"noreply@ebay.com"
]
}

Response:

{ "success": true }

Jobs​

POST /ereceipts/create_job​

Submits a mailbox or a raw email for parsing. Returns a job_id that you can use to poll for status.

There are two ways to supply the source. Pass eml_data to parse a single raw email, or pass credentials and provider to connect to a mailbox over IMAP or OAuth.

Headers:

HeaderRequiredDescription
api-keyYesYour API key
Content-TypeYesapplication/json or application/x-www-form-urlencoded

Request Body:

FieldTypeRequiredDescription
email_hashstringNo*SHA-256 hash of the user's email address. May be sent alongside client_user_id
client_user_idstringNo*Your internal user identifier. May be sent alongside email_hash
eml_datastringNo**Base64-encoded raw EML content of a single email. Alternative to credentials and provider
providerstringNo**Mailbox provider. Required when credentials is used
credentialsstringNo**Encrypted mailbox credentials. Requires provider
country_codestringNoISO 3166-1 alpha-2 country code (e.g., US)
override_endpointstringNoOne-time override for the results webhook URL
override_datestringNoOne-time override for the cutoff date

You must supply at least one of email_hash or client_user_id. Supplying neither returns error code 118. Both may be sent together.

You must also supply either eml_data, or both credentials and provider. If eml_data is present, credentials and provider are ignored.

Provider Values:

ValueConnection
gmail-imapIMAP
yahoo-imapIMAP
yahoo-imap-altIMAP
aol-imapIMAP
aol-imap-altIMAP
gmail-oauthOAuth
outlook-oauthOAuth

For the IMAP providers, credentials decrypts to email@domain.com:AppPassword. For the OAuth providers, it decrypts to the access token.

Example Request:

curl -X POST https://api.blinkreceipt.com/ereceipts/create_job \
-H "api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eml_data": "UmVjZWl2ZWQ6IGZyb20...",
"email_hash": "abc123...",
"client_user_id": "user_42"
}'

Response:

{
"success": true,
"job_id": 98765
}

Only one job may be in flight per user. Submitting a second returns error code 13.


GET /ereceipts/status​

Polls the processing status of a job created by create_job.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Query Parameters:

ParameterTypeRequiredDescription
job_idnumberYesThe job ID returned by create_job

Example Request:

curl "https://api.blinkreceipt.com/ereceipts/status?job_id=98765" \
-H "api-key: YOUR_API_KEY"

Response:

{
"success": true,
"job_status": {
"id": 98765,
"email_hash": "abc123...",
"client_user_id": "user_42",
"status": "completed",
"error_code": null,
"error_message": null,
"processing_time": 3.2,
"created_at": "2024-08-01 10:00:00",
"updated_at": "2024-08-01 10:00:03"
}
}

Job Status Values:

StatusDescription
queuedJob is waiting to be picked up
executingJob is actively being processed
completedProcessing finished successfully; results sent to webhook
errorProcessing failed; check error_code and error_message

System​

GET /ereceipts/health_check​

Verifies that the e-receipt processing system is operational. Does not require an API key.

Response:

{ "status": "ok" }

POST /ereceipts/clear_history​

Removes stored user data.

Headers:

HeaderRequiredDescription
api-keyYesYour API key
Content-TypeYesapplication/json

Request Body:

FieldTypeRequiredDescription
emailAddressstringNo*The user's email address whose history should be cleared. Takes precedence over clientUserId
clientUserIdstringNo*The client user ID whose history should be cleared. Used only when emailAddress is absent

You must supply at least one of emailAddress or clientUserId. Supplying neither returns error code 121. If you supply both, emailAddress is used and clientUserId is ignored.

Example Request:

{
"emailAddress": "user@example.com"
}

Response:

{ "success": true }