🚧 Work in Progress: This documentation is actively being developed and is subject to change.
Core Functions

Stats & User Data

Learn how to retrieve user statistics, points balances, and transaction history.


Overview

After users enroll and scan receipts, you can access their PlanetPoints data:

  • User Summary - Points balance and account overview
  • Transaction History - List of all processed receipts
  • Transaction Detail - Item-level breakdown for a specific receipt

User Summary

Get a snapshot of a user's overall PlanetPoints activity.

Endpoint: GET /users/{id}/summary

Response fields:

FieldTypeDescription
userIDStringUser's unique ID
emailStringUser's email address
lifetimePointsNumberTotal points earned (all time)
availablePointsNumberCurrent available balance
numOfTransactionsIntegerNumber of receipts processed
totalCarbonScoreNumberCumulative carbon impact score
totalGreenProductsIntegerCount of eco-friendly products
createdAtDateTimeAccount creation date
updatedAtDateTimeLast update timestamp

Transaction History

Retrieve all processed receipts for a user.

Endpoint: GET /users/{id}/transactions

Returns an array of transaction summaries including:

  • Transaction ID
  • Merchant name
  • Purchase amount
  • Points earned
  • Processing timestamp

Transaction Detail

Get item-level breakdown for a specific transaction.

Endpoint: GET /users/{id}/transactions/{transaction_id}

Response includes:

FieldTypeDescription
transaction_idStringTransaction reference
itemsArrayList of products with ratings
total_amountNumberReceipt total
total_pointsNumberPoints earned

Item fields:

FieldTypeDescription
nameStringProduct name
qtyIntegerQuantity purchased
amountNumberPrice paid
pointsNumberPoints for this item
nutri_ratingInteger (1-5)Nutri-Score (1=A, 5=E)
carbon_ratingInteger (1-5)Carbon Score (1=A, 5=E)

Rating Display

Convert numeric ratings to letter grades:

RatingGradeMeaning
1AExcellent
2BGood
3CModerate
4DPoor
5EBad

Next Steps