Actual Links Account Linking: Android Developer Guide

This guide covers everything you need to integrate account linking into your Android app: how it works, setup, authentication, order retrieval, background processing, account management, and references.

How It Works

  1. Connect — The user links their retailer account through your app. The SDK handles authentication, including two-factor authentication and CAPTCHA challenges.
  2. Verify — The SDK verifies the credentials against the retailer.
  3. Retrieve — The SDK fetches purchase history from the linked account and returns structured order data.
  4. Enrich (optional) — If Product Intelligence is enabled, line items are matched against the product catalog for UPC, brand, and category.

Credentials are encrypted and stored locally on the device. They never leave the device and are only used when the retailer session expires and re-authentication is required.

Requirements

RequirementVersion
Android Min SDK23+ (Android 6.0+)
Android Compile SDK36+
Java17+
Architecturearmeabi-v7a, arm64-v8a

Installation

  1. Add the Maven repository:

Kotlin DSL:

repositories {<br>    mavenCentral()<br>}

Groovy:

repositories {
    mavenCentral()
}
  1. Add the dependencies:

Kotlin DSL:

dependencies {
    implementation(platform("com.microblink.blinkreceipt:blinkreceipt-bom:1.9.13"))
    implementation("com.microblink.blinkreceipt:blinkreceipt-account-linking")
}

Groovy:

dependencies {
    implementation platform("com.microblink.blinkreceipt:blinkreceipt-bom:1.9.13")
    implementation "com.microblink.blinkreceipt:blinkreceipt-account-linking"
}

→ 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:

BlinkReceiptSdk.licenseKey = "YOUR-LICENSE-KEY"
BlinkReceiptSdk.productIntelligenceKey = "YOUR-PROD-INTEL-KEY"

Java:

BlinkReceiptSdk.licenseKey("YOUR-LICENSE-KEY");
BlinkReceiptSdk.productIntelligenceKey("YOUR-PROD-INTEL-KEY");

Initialize the SDK

Kotlin:

BlinkReceiptSdk.initialize(this, object : InitializeCallback {
    override fun onComplete() {
        // Ready to use
    }

    override fun onException(throwable: Throwable) {
        // Log exception
    }
})

Java:

BlinkReceiptSdk.initialize(this, new InitializeCallback() {
    @Override
    public void onComplete() {
        // Ready to use
    }

    @Override
    public void onException(@NonNull Throwable throwable) {
        // Log exception
    }
});

Authentication, Retrieval & Configuration

After installation and initialization, the account linking flow (authentication options, verification, order retrieval, background processing, account management) follows the same concepts across iOS and Android. For detailed Android code and examples:

Order Types

TypeDescription
In-StorePurchases made in a physical store (if visible in the retailer account)
DeliveryOnline purchases shipped to the customer
PickupOnline purchases picked up in store
DigitalMovies, eBooks, songs, digital storage, etc.

Not all order types are available for every retailer. Target, Walmart, and Kroger are examples of retailers that surface in-store purchases through their online accounts.

Order Status

Each order can include status information at three levels:

LevelWhat it tracks
Order statusOverall order status (ordered, completed, cancelled, refunded, returned)
Shipment statusStatus of a specific shipment within the order (delivery orders only)
Product statusStatus of a specific product within the order

Important: Account linking returns each order only once. If an order’s status changes after it has been retrieved (e.g., shipped → delivered), you need to reset the order history and re-retrieve to get the updated status.

Configuration Options

SettingWhat it doesDefault
dayCutoffHow many days of purchase history to retrieve15 days
dateCutoffSpecific earliest date to retrieve fromNone
webviewAuthEnabledUse retailer webview instead of host app credentialsfalse

Error Handling

Common error codes and what they mean:

ErrorDescriptionHow to handle
verificationNeededRetailer requires 2FA, CAPTCHA, or other user inputPresent the provided view controller
verificationCompletedUser successfully completed additional authenticationDismiss the view controller
invalidCredentialsUsername or password is incorrectPrompt the user to re-enter credentials
noCredentialsNo credentials providedEnsure credentials are set on the connection
unsupportedRetailerRetailer is not supportedCheck the supported retailers list
cancelledOperation was cancelledDismiss any presented view controllers
webViewClosedUser dismissed the webviewDismiss any presented view controllers

→ Full Android Error Codes Reference

Account Management

Unlinking

Users can unlink a retailer account at any time. Unlinking removes stored credentials from the device.

Important: Unlinking does not reset the order history cache. If the same user re-links, the SDK will only return orders since the last successful retrieval. To reset the cache, explicitly call the reset history method for that retailer.

Changing Credentials

Modifying credentials on an existing connection is not supported. To change credentials, unlink the account first, then create and link a new connection with the updated credentials. It is recommended to verify the new credentials before linking.

Multiple Accounts

Linking multiple accounts for the same retailer is not supported. Unlink the existing account before linking a different one for the same retailer.

Testing Recommendations

  • Test linking and verification for multiple retailers
  • Test 2FA and CAPTCHA flows (most retailers trigger these intermittently)
  • Test with accounts that have both in-store and online purchase history
  • Verify that dayCutoff controls the retrieval window correctly
  • Test unlinking and re-linking with the same and different credentials
  • Test background order retrieval
  • Remember to call reset history between test runs, or you will only see new orders since the last retrieval

Implementation Timeline

ScopeEstimated Dev Time
Standard integration (single retailer)~1 week + QA
Full integration (all retailers + background)~2 weeks + QA

Additional References

Related

Let’s Turn Proof Into Action 

Your next move should be backed by proof, and we’re here to help you leverage real data for real results. Start turning verified insights into measurable impact today.