This guide covers everything you need to integrate email linking into your Android app: how it works, setup, authentication, retrieval, and references.
How It Works
- Authenticate — The user connects their email account through your app using IMAP. Credentials are stored on-device only and are never sent to or stored on Actual servers.
- Extract — The SDK searches the user’s inbox for receipt emails from supported merchants and returns structured purchase data.
- Enrich (optional) — If Product Intelligence is enabled, extracted line items are matched against the product catalog for UPC, brand, and category.
Supported Email Providers
| Provider | Authentication | Notes |
|---|---|---|
| Gmail | IMAP with App Password | SDK automates App Password creation, or user can enable Less Secure Apps |
| Yahoo | IMAP with App Password | SDK automates App Password creation |
| AOL | IMAP with App Password | SDK automates App Password creation |
The SDK supports linking multiple IMAP accounts simultaneously.
Choose Your Integration Approach
| Approach | How it works | Best for |
|---|---|---|
| On-Device (Local) | SDK searches the inbox directly from the user’s device. Results returned immediately in callback. | Real-time results while the user is in the app |
| On-Device Auth + Server Processing(Recommended) | User authenticates on-device. Inbox search happens asynchronously on Actual’s server. Results posted to your webhook. | Background processing without requiring the app to stay open |
| Server-Only | No SDK. Send email data (EML format) directly to the remote scrape API. | Systems that already collect email data externally |
| Email Forwarding | Users forward receipts to a dedicated inbox. Actual processes every two minutes. | Passive collection, minimal integration effort |
Requirements
| Requirement | Version |
|---|---|
| Android Min SDK | 23+ (Android 6.0+) |
| Android Compile SDK | 36+ |
| Java | 17+ |
| Architecture | armeabi-v7a, arm64-v8a |
Installation
- Add the Maven repository:
Kotlin DSL:
repositories {
maven { url = uri("https://maven.microblink.com") }
}
Groovy:
repositories {
maven { url "https://maven.microblink.com" }
}
- Add the dependency:
Kotlin DSL:
dependencies {
implementation(platform("com.microblink.blinkreceipt:blinkreceipt-bom:1.9.13"))
implementation("com.microblink.blinkreceipt:blinkreceipt-digital")
}
Groovy:
dependencies {
implementation platform("com.microblink.blinkreceipt:blinkreceipt-bom:1.9.13")
implementation "com.microblink.blinkreceipt:blinkreceipt-digital"
}
→ Android SDK Repository (GitHub)
License Keys
You need two keys: a license key and a Product Intelligence key.
Option A: Android Manifest
<meta-data
android:name="com.microblink.LicenseKey"
android:value="YOUR-LICENSE-KEY"
/>
<meta-data
android:name="com.microblink.ProductIntelligence"
android:value="YOUR-PROD-INTEL-KEY"
/>
Option B: Programmatically
Kotlin:
BlinkReceiptDigitalSdk.licenseKey = "YOUR-LICENSE-KEY"
BlinkReceiptDigitalSdk.productIntelligenceKey = "YOUR-PROD-INTEL-KEY"
Java:
BlinkReceiptDigitalSdk.licenseKey("YOUR-LICENSE-KEY");
BlinkReceiptDigitalSdk.productIntelligenceKey("YOUR-PROD-INTEL-KEY");
Initialize the SDK
Kotlin:
BlinkReceiptDigitalSdk.initialize(this, object : InitializeCallback {
override fun onComplete() {
// Ready to use
}
override fun onException(throwable: Throwable) {
// Log exception
}
})
Java:
BlinkReceiptDigitalSdk.initialize(this, new InitializeCallback() {
@Override
public void onComplete() {
// Ready to use
}
@Override
public void onException(@NonNull Throwable throwable) {
// Log exception
}
});
IMAP Authentication, Retrieval & Configuration
After installation and initialization, the email linking flow (IMAP authentication, local and remote retrieval, search window configuration, order aggregation, signing out) follows the same concepts across iOS and Android. For detailed code examples:
- IMAP Integration — IMAP authentication for Gmail, Yahoo, and AOL
- Gmail Integration — Gmail-specific setup
- Outlook Integration — Outlook-specific setup
- Tasks — Managing retrieval tasks
- Project Integration — Full project integration guide
- Requirements — Platform and dependency requirements
Remote Retrieval: Server-Side Configuration
If using the recommended On-Device Auth + Server Processing approach, you also need to configure the server side:
| Setting | Description |
|---|---|
| Webhook endpoint URL | Where Actual posts results |
| Retailer email addresses | Which merchants to look for |
| Cutoff dates | Per-retailer or global |
| Country code (optional) | Improves extraction if receipts are from a specific country |
→ eReceipts Configuration API (SwaggerHub) → Webhook Documentation
Supported Merchant Emails
The list of merchant email senders that Actual processes is publicly available and updated regularly.
Emails from senders not on this list are not processed or stored.
Email Receipt Data
Email receipts return the same core fields as paper receipts (merchant, date, total, line items) plus additional fields:
| Field | Description |
|---|---|
ereceiptOrderNum | Order number from the email receipt |
ereceiptRawHTML | Raw HTML content of the receipt email |
shippingStatus | Shipping status per line item |
ereceiptComponentEmails | Component emails for aggregated orders |
For the full list of returned fields, see the Data Reference →.
Error Handling
| Error type | Reference |
|---|---|
| IMAP errors (auth failures, App Password issues, connection timeouts) | Remote Error Codes (SwaggerHub) |
| Remote scraping errors (job failures, processing issues) | Remote Error Codes (SwaggerHub) |
Testing Recommendations
- Test each supported provider (Gmail, Yahoo, AOL) end to end
- Test with accounts that have varying volumes of receipt emails
- Test the remote scraping flow including webhook delivery
- Verify cutoff date behavior
- Test account unlinking and re-authentication
- Test aggregation with orders that generate multiple emails
Implementation Timeline
| Scope | Estimated Dev Time |
|---|---|
| Single provider | ~1 week + QA |
| All providers + remote scraping | ~2 weeks + QA |
| Server-side webhook setup | Additional ~1 week |
Additional References
- Javadoc — Full API reference