Integration Flow
Overview
Integrating PlanetPoints into your platform follows a simple, secure flow. This guide walks through the full journey from user enrollment to points awarding and explains how our hosted pages and webhook notifications fit into the process.
The Complete Flow
User Enrollment
Your customer opts into PlanetPoints through your app. You call our enrollment API with minimal user data:
{
"email":"test@reewild.com",
"firstName": "Test",
"lastName":"User",
"city":"London",
"country":"UK",
"imageUrl": "https://avatar.iran.liara.run/public/41",
"postalCode": "5BC21"
}PlanetPoints responds with the user account details:
{
"user": {
"userID": "013LPI",
"email": "test@reewild.com",
"lifetimePoints": 0,
"availablePoints": 0,
"numOfTransactions": 0,
"totalCarbonScore": 0,
"totalGreenProducts": 0,
"createdAt": "2025-09-05T12:51:05.3361193",
"updatedAt": "2025-09-05T12:51:05.3361193"
}
}Submitting Purchase & Consumption Data
When a user wants to submit purchasing or consumption data toward PlanetPoints, the flow can follow one of the following paths depending on your use case.
Path 1: Purchase Capture
PlanetPoints automatically processes purchasing data through two supported ingestion methods.
Receipt-Based Capture
For merchants without digital receipts, or when no email receipt is available, you can capture receipts in two ways. Include transaction metadata (merchant, amount, timestamp, last 4 digits) to improve validation and fraud detection.
Option A: Your Own UI
If you prefer to own the UX, build your own upload or scanner UI and send images directly to our Receipt Scanning API.
PlanetPoints handles:
- OCR processing
- Item extraction
- Validation
- Fraud detection
- Scoring
Option B: Hosted Capture (Recommended)
Redirect users to Reewild's optimized, white-labelled capture page.
Flow summary:
- Your backend sends transaction metadata when creating a capture session
- You redirect the user to the hosted capture page:
{{hosted_pages_url}}?session_id={session_token} - User scans or uploads their receipt
- PlanetPoints extracts, validates, and processes item-level data
- User returns to your app with the result
Path 2: Manual Consumption Entry
Your app may allow users to manually enter what they consumed-whether it's a full meal or a single food item. Collect the item names, quantities, and any optional details (e.g., barcode), then either:
- Redirect the user to the hosted consumption-entry page, or
- Send the data directly to the relevant API endpoint
Both flows feed into the same scoring pipeline used across the platform.
Scoring & Points Awarding
Behind the scenes, our system:
- Validates the submitted data (receipt details, tracked items, or meal entries) against the metadata you provide
- Extracts item-level information through our processing pipeline
- Maps items to our product database
- Calculates health and carbon ratings
- Awards points based on the combined scoring and source type
- Sends webhook notification to your endpoint with the result
You receive a webhook event with the scoring outcome:
{
"eventType": "rewards.awarded",
"data": {
"user": {
"id": "00B4N5",
"availablePoints": 250,
"lifetimePoints": 250
},
"transaction": {
"transactionID": "080c2949-b9fc-493d-85b5-906330bb3d7b",
"totalPoints": 250,
"items": [
{
"name": "Organic Bananas",
"carbonImpactRating": 1,
"healthImpactRating": 1,
"totalPlanetPoints": 150
}
]
}
}
}Visual Flow Diagram
Data You Can Access
After points are awarded, you can retrieve detailed user and activity data through our APIs.
Summary Endpoint
GET /users/{id}/summaryReturns the user's PlanetPoints summary, including:
- Available points
- Lifetime points
- Total number of earning events
- Health and carbon impact metrics
Transactions Endpoint
GET /users/{id}/transactionsReturns a paginated list of all PlanetPoints earning events, including:
- Date of the event
- Points awarded
- Item-level breakdowns
- Health and carbon scores
Transaction Detail Endpoint
GET /users/{id}/transactions/{transaction_id}Returns a structured item-level record for the earning event:
- Full item list
- Carbon and health scores per item
- Pricing or quantity breakdowns (if available)
- Source information (receipt scan, meal entry, item tracking)
Next Steps
Ready to integrate? Here's what to do next:
Set Up Authentication
Configure OAuth credentials and token management
Implement Enrollment
Add the user enrollment flow to your app
Integrate Scanner
Embed the hosted receipt scanning experience
Configure Webhooks
Set up event notifications for points awarding