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

User Enrollment

Learn how to enroll users into the PlanetPoints program and manage user accounts.


Overview

User enrollment is the foundational step that connects your customers to the PlanetPoints rewards ecosystem. When you enroll a user, you're creating a link between their account in your system and their PlanetPoints profile in Reewild's platform.

This one-time process enables users to:

  • Earn PlanetPoints on sustainable purchases
  • Upload receipts and track their environmental impact
  • Access sustainability insights

Enrollment Options

Reewild provides two enrollment methods depending on your integration preference:

Option 1: Direct API Enrollment

Use the /users/enroll endpoint to enroll users directly from your backend.

Best for: Applications that want full control over the enrollment UI and flow.

View API Reference →

Option 2: Hosted Enrollment Page

Use the /users/enroll/session endpoint to create a session and redirect users to Reewild's hosted enrollment page.

Best for: Applications that want a quick integration without building custom UI.

Flow:

  1. Call the session endpoint with user details
  2. Redirect user to the returned URL
  3. User completes enrollment on Reewild's branded page (showing your app logo)
  4. User is redirected back to your app via the deep link you configured

View API Reference →


Required vs. Optional Fields

Required Fields

FieldTypeDescription
emailStringUser's email address
firstNameStringUser's first name
lastNameStringUser's last name

Optional Fields

FieldTypeDescription
imageUrlString (URL)User's profile picture
countryStringUser's country
cityStringUser's city
postalCodeStringUser's postal code

Location data improves receipt validation and enables region-specific features.


Understanding User IDs

When you successfully enroll a user, the system generates a unique userID:

  • Use in all API calls: Pass this ID when uploading receipts, retrieving stats, etc.
  • Store securely: Map this ID to your internal user records
  • Permanent: This ID remains consistent throughout the user's lifecycle

Success Response

When enrollment succeeds, you receive:

{
  "user": {
    "userID": "USR-24A91C",
    "email": "alex.lee@example.com",
    "lifetimePoints": 0,
    "availablePoints": 0,
    "numOfTransactions": 0,
    "totalCarbonScore": 0,
    "totalGreenProducts": 0,
    "createdAt": "2025-02-14T10:22:31Z",
    "updatedAt": "2025-02-14T10:22:31Z"
  }
}

After successful enrollment:

  • Store the userID in your database
  • Guide users to upload their first receipt

Error Responses

Status CodeErrorHow to Handle
201CreatedUser successfully enrolled
400Invalid parametersValidate input before sending request
401UnauthorizedCheck your API credentials
500Internal server errorRetry with exponential backoff

Monitoring Enrollments

You can monitor user enrollments in real-time through the developer portal:

  • View detailed logs of enrollment activities
  • Track timestamps and event types
  • Debug failed enrollments

Next Steps