Skip to main content

Endpoint Reference

All endpoints share the same base URLs and authentication model.

Base URLs:

  • Sandbox: https://sandbox.blinkreceipt.com
  • Production: https://scan.blinkreceipt.com

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


Configuration

POST /ereceipts/config

Sets global scraping configuration for your account.

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
day_cutoffintegerNo*Days back to search
date_cutoffintegerNo*UNIX timestamp cutoff
use_aggregationbooleanNoAggregate multi-email orders
return_emlbooleanNoInclude raw EML in results
retailersarrayNoPer-retailer cutoff configs

Response:

{ "success": true }

GET /ereceipts/config

Returns the currently active account configuration.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Response:

{
"success": true,
"results_endpoint": "https://your-server.com/webhooks/ereceipts",
"day_cutoff": 14,
"use_aggregation": false,
"return_eml": false,
"retailers": []
}

Retailers

GET /ereceipts/retailers

Returns all retailers currently saved to your account configuration.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Response:

{
"success": true,
"retailers": [
{
"email": "auto-confirm@amazon.com",
"day_cutoff": 7
},
{
"email": "noreply@ebay.com",
"day_cutoff": 30
}
]
}

Retailer Object Fields:

FieldTypeDescription
emailstringSender email address
day_cutoffintegerPer-retailer day cutoff (if set)
date_cutoffintegerPer-retailer UNIX timestamp cutoff (if set)

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 raw email for parsing. Returns a job_id that you can use to poll for status.

Headers:

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

Request Body (form-encoded):

FieldTypeRequiredDescription
eml_datastringYesRaw EML content of the email
email_hashstringYesSHA-256 hash of the user's email address
providerstringNoEmail provider name (e.g., gmail, outlook)
client_user_idstringNoYour internal user identifier for tracking
override_endpointstringNoOne-time override for the results webhook URL
country_codestringNoISO 3166-1 alpha-2 country code (e.g., US)

Example Request:

curl -X POST https://sandbox.blinkreceipt.com/ereceipts/create_job \
-H "api-key: YOUR_API_KEY" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "eml_data@/path/to/receipt.eml" \
--data-urlencode "email_hash=abc123..." \
--data-urlencode "provider=gmail" \
--data-urlencode "client_user_id=user_42"

Response:

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

POST /ereceipts/reprocess_job

Reprocesses previously ingested receipts. Useful for re-extracting data after a parser update or configuration change. You must supply either blink_receipt_ids or retailers — not both.

Headers:

HeaderRequiredDescription
api-keyYesYour API key
Content-TypeYesapplication/json

Request Body:

FieldTypeRequiredDescription
blink_receipt_idsarray of stringsNo*Specific receipt IDs to reprocess
retailersarrayNo*Retailer configs to reprocess all matching receipts

Example — reprocess by IDs:

{
"blink_receipt_ids": ["BR-AAAA-1111", "BR-BBBB-2222"]
}

Example — reprocess by retailers:

{
"retailers": [
{ "email": "auto-confirm@amazon.com", "day_cutoff": 7 }
]
}

Response:

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

Errors specific to this endpoint:

CodeDescription
112Must specify either blink_receipt_ids or retailers
113Cannot specify both blink_receipt_ids and retailers
114One or more Blink Receipt IDs was not found

GET /ereceipts/status

Polls the processing status of a job created by create_job or reprocess_job.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Query Parameters:

ParameterTypeRequiredDescription
job_idnumberYesThe job ID returned by create_job or reprocess_job

Example Request:

curl "https://sandbox.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.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Response:

{
"status": "ok",
"message": "E-receipt system is operational"
}

GET /ereceipts/simulate_results

Sends a sample results payload to your webhook or returns a sample payload locally. Use this to test your webhook integration without submitting real emails.

Headers:

HeaderRequiredDescription
api-keyYesYour API key

Query Parameters:

ParameterTypeRequiredDefaultDescription
post_to_remotebooleanNotrueWhen true, POSTs the sample payload to your configured results_endpoint. When false, returns the payload in the response body
results_endpointstringNoOverride the destination URL for this test call only

Example — preview locally:

curl "https://sandbox.blinkreceipt.com/ereceipts/simulate_results?post_to_remote=false" \
-H "api-key: YOUR_API_KEY"

Response when post_to_remote=false: An array of sample EReceipt objects (see response-structure.md).

Response when post_to_remote=true:

{ "success": true }

POST /ereceipts/clear_history

Removes stored user data. Intended for testing and development use.

Headers:

HeaderRequiredDescription
api-keyYesYour API key
Content-TypeYesapplication/json

Request Body:

FieldTypeRequiredDescription
emailAddressstringNoThe user's email address whose history should be cleared
clientUserIdstringNoThe client user ID whose history should be cleared

Example Request:

{
"emailAddress": "user@example.com",
"clientUserId": "user_42"
}

Response:

{ "success": true }