Wallet App: Guide to Fetching a User's Receipts via OAuth
This guide is for wallet-style apps where a user links their own Receipt Roller account and browses their purchase receipts on iOS, Android, a LINE Mini App, and so on (data is fetched with the
user.receipts.read scope, with the user's consent).If a store instead wants to issue digital receipts to its customers from its own app and receive real-time notifications via Webhooks, see the store-facing guide.
Wallet App: Guide to Fetching a User's Receipts via OAuth
This is a developer guide for stores and brands that have their own iOS app, Android app, or LINE Mini App.
Using ReceiptRoller's OAuth authentication and API, you can fetch the digital receipts issued at your store, with the user's consent, and display them in your own app.
Use cases
For example, you can build things like these.
- A convenience-store chain shows "purchase history" in its own app
- A drugstore shows "My Receipts" in a LINE Mini App
- An e-commerce brand shows a monthly spending summary on the dashboard of its Android app
- The moment a purchase completes, receipt data is sent to your own server via Webhook
How it works
User → Your app → OAuth consent screen (ReceiptRoller)
↓
Access token issued
↓
Your app → Receipts API → Fetch digital receipts
Your app obtains an access token via ReceiptRoller's OAuth 2.0 flow.
When you call the API with that token, it returns the receipts that user received at your store.
Step 1: Register an app
- Log in to ReceiptRoller's developer portal
- From "Register app," issue a client ID and secret
- Set the
redirect_uri(the redirect destination after authorization)
Step 2: Implement the OAuth authorization code flow
2-1. Obtain an authorization code
Send the user to the following URL in a browser.
GET /oauth/authorize
?client_id=YOUR_CLIENT_ID
&redirect_uri=YOUR_REDIRECT_URI
&response_type=code
&scope=user.receipts.read user.spending.read
&state=RANDOM_STRING
When the user taps "Allow" on ReceiptRoller's consent screen, an authorization code is returned to redirect_uri.
YOUR_REDIRECT_URI?code=AUTH_CODE&state=RANDOM_STRING
2-2. Exchange the code for a token
POST /api/v1/auth/token
Content-Type: application/json
{
"grantType": "authorization_code",
"clientId": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET",
"code": "AUTH_CODE",
"redirectUri": "YOUR_REDIRECT_URI"
}
Response:
{
"accessToken": "eyJ...",
"refreshToken": "def50200...",
"tokenType": "Bearer",
"expiresIn": 3600,
"scope": "user.receipts.read user.spending.read"
}
2-3. Refreshing the token
Refresh when the access token expires.
POST /api/v1/auth/refresh
Content-Type: application/json
{
"refreshToken": "def50200...",
"clientId": "YOUR_CLIENT_ID"
}
Step 3: Fetch receipts
Add an Authorization: Bearer {access_token} header to every API request.
Receipt list (supports monthly filtering)
GET /api/v1/user/receipts?year=2026&month=4
Authorization: Bearer {access_token}
Receipt detail (includes line items and store info)
GET /api/v1/user/receipts/{id}
Authorization: Bearer {access_token}
Monthly spending summary
GET /api/v1/user/receipts/summary?year=2026&month=4
Authorization: Bearer {access_token}
Scope: user.spending.read
Returns the breakdown by category, month-over-month comparison, and receipt count. Useful for building a dashboard screen.
Step 4: Receive real-time notifications via Webhook
Instead of polling the API, you can receive a notification to your own server the moment a receipt is issued. Registering a Webhook endpoint from the developer portal causes a POST every time a user's receipt is created or updated.
Security verification
To confirm that a received Webhook is legitimate, verify the X-RR-Signature header.
import hmac, hashlib
def verify_signature(payload_body: bytes, secret: str, signature_header: str) -> bool:
expected = "sha256=" + hmac.new(
secret.encode(), payload_body, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature_header)
Scopes needed
| Scope | Purpose |
|---|---|
user.receipts.read |
Fetch receipt list and detail, and scan images |
user.spending.read |
Fetch the monthly spending summary |
Supported platforms
| Platform | Implementation |
|---|---|
| iOS | OAuth authorization via ASWebAuthenticationSession, API calls via URLSession |
| Android | OAuth authorization via Chrome Custom Tabs, API calls via OkHttp or Retrofit |
| LINE Mini App | After liff.init(), get the LINE token with liff.getAccessToken() and exchange it for a ReceiptRoller OAuth token |
Frequently asked questions
Q. Do I only get receipts from my own store?
A. Yes. Of the receipts the OAuth-authenticated user received, the API returns only those associated with your store. You cannot fetch other stores' data.
Q. What if the user revokes consent?
A. The access token is invalidated. Subsequent API requests return 401.
Q. Are Webhooks re-sent?
A. If your server doesn't return 2xx, they are automatically retried up to 4 times.
Next steps
- For technical questions, contact support
-
The flow to getting startedExplains the flow to start using the ReceiptRoller developer portal. If you register as a store user and are on the Starter plan or higher, no separate developer application is needed; you can register an app and begin API implementation right away.
-
What is application registrationExplains the concept of ReceiptRoller application registration. Registering an app as an OAuth client issues a client ID, secret, and redirect URI, letting you start API and Webhook integrations.
-
OAuth Scopes Reference and AvailabilityA reference of all scopes available in the ReceiptRoller OAuth API and which kinds of apps each scope can be granted to. Also covers the review requirement for User scopes, why Store and User scopes can't be mixed, and how to use the API from a LIFF app.
-
Creating a new appExplains the concrete steps to register a new app (OAuth client) in the ReceiptRoller developer portal. Covers the input fields, validation, the post-creation credentials display, and common errors.