Reward Workflow
Overview
This workflow covers the complete reward points management system in the GafaPay platform. It provides users with the ability to view their points balance, track earning history, understand redemption options, and process point redemptions.
The workflow consists of several key components that work together to provide a comprehensive reward points experience:
1. Points Balance Display
Users can view their current reward points balance and account information.
2. Points History Tracking
Users can review their complete points earning history with detailed transaction information.
3. Redemption Configuration
Users can view available redemption options, limits, and rules for their user type and currency.
4. Points Redemption Process
Users can redeem their points for cashback or vouchers based on the available configuration.
5. Redemption History
Users can track their redemption history and view past redemption transactions.
Workflow Steps
1. Display User Points Balance
Purpose: Show the user their current reward points balance and account details.
Steps:
- Call the Get Reward Point API
- Pass the user's ID and currency ID as parameters
- Display the current points balance and user information
2. Display Points History
Purpose: Show the user their complete points earning history with transaction details.
Steps:
- Call the Get User Points Details API
- Pass user ID, currency ID, and pagination parameters
- Display the points earning history with descriptions
- Show transaction details, reward programs, and timestamps
3. Get Redemption Configuration
Purpose: Retrieve and display available redemption options and rules for the user.
Steps:
- Call the Get Points Redeem Config API
- Pass user type and currency ID as parameters
- Display redemption configuration details
- Show available redemption types (cashback/voucher)
- Display minimum and maximum redemption limits
4. Validate and Display Configuration
Purpose: Validate redemption rules and present options to the user.
Steps:
- Validate user's current points against minimum redemption requirements
- Check if redemption configuration is active
- Display available redemption options based on user type
- Show redemption limits and rules
5. Redeem Points
Purpose: Process the actual points redemption transaction.
Steps:
- Call the Redeem User Reward Points API
- Pass redemption details including points amount, user info, and wallet details
- Include company admin user information for transaction processing
6. Get Redemption History
Purpose: Display the user's redemption history and past transactions.
Steps:
- Call the Get User Points Redeem API
- Pass user ID, currency ID, and pagination parameters
- Display redemption history with transaction details
- Show amounts redeemed, descriptions, and timestamps
API References
Get Reward Point
- API: Get Reward Point
- Endpoint:
GET /gafapay/v3/reward_promotion/user_points - Purpose: Retrieve current user points balance and account information
Required Parameters:
user_id: ID of the logged-in usercurrency_id: Currency identifier
Example Request:
GET /gafapay/v3/reward_promotion/user_points?user_id=fb8f09210e0f46b7b4262d77f5b6c273¤cy_id=1f1519903ed240578f071aa45cb479f2
Get User Points Details
- API: Get User Points Details
- Endpoint:
GET /gafapay/v3/reward_promotion/user_points_detail - Purpose: Retrieve detailed points earning history
Required Parameters:
user_id: ID of the logged-in usercurrency_id: Currency identifier
Optional Parameters:
skip: Pagination offset (default: 0)limit: Number of records to return (default: 10)sorting: Sorting criteria for results
Example Request:
GET /gafapay/v3/reward_promotion/user_points_detail?skip=0&limit=10&user_id=fb8f09210e0f46b7b4262d77f5b6c273¤cy_id=1f1519903ed240578f071aa45cb479f2
Get Points Redeem Config
- API: Get Points Redeem Config
- Endpoint:
GET /gafapay/v3/reward_promotion/points_redeem_config - Purpose: Retrieve redemption configuration and rules
Required Parameters:
user_type: Type of user account (2=Customer, 3=Merchant, 5=Agent)currency_id: Currency identifier
Example Request:
GET /gafapay/v3/reward_promotion/points_redeem_config?user_type=2¤cy_id=1f1519903ed240578f071aa45cb479f2
Redeem User Reward Points
- API: Redeem User Reward Points
- Endpoint:
POST /gafapay/v3/reward_promotion/redeem_user_reward_points - Purpose: Process points redemption transaction
Required Parameters:
redeem_points: Number of points to redeemuser_type: Type of user accountuser_id: ID of the userwallet_id: Target wallet for creditcurrency_id: Currency identifiercompany_admin_user_info: Admin details for transaction processing
Example Request:
POST /gafapay/v3/reward_promotion/redeem_user_reward_points
Content-Type: application/json
{
"redeem_points": 10,
"user_type": 2,
"user_id": "fb8f09210e0f46b7b4262d77f5b6c273",
"wallet_id": "4010122e9d604e798b9a6e961df3e5b4",
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"company_admin_user_info": {
"currency_id": "1f1519903ed240578f071aa45cb479f2",
"debit_type": 1,
"debit_type_id": "4010122e9d604e798b9a6e961df3e5b4",
"debit_account_type": 1,
"debit_account_type_id": "640b793d04e2428dbf19ab10399f4edb",
"username": "Mouhamad Amine"
}
}
Get User Points Redeem
- API: Get User Points Redeem
- Endpoint:
GET /gafapay/v3/reward_promotion/user_points_redeem - Purpose: Retrieve redemption history
Required Parameters:
user_id: ID of the logged-in usercurrency_id: Currency identifier
Optional Parameters:
skip: Pagination offset (default: 0)limit: Number of records to return (default: 10)
Example Request:
GET /gafapay/v3/reward_promotion/user_points_redeem?skip=0&limit=10&user_id=fb8f09210e0f46b7b4262d77f5b6c273¤cy_id=1f1519903ed240578f071aa45cb479f2
Flow Logic
1. Initial Points Display
- Start with the logged-in user's ID and currency
- Call Get Reward Point API to fetch current balance
- Display points balance, user type, and account information
- Show currency details and account status
2. Points History Retrieval
- Use the same user ID and currency ID
- Call Get User Points Details API with pagination
- Display earning history with transaction descriptions
- Show reward program details and timestamps
- Handle pagination for large history datasets
3. Redemption Configuration Check
- Determine user type from the points balance response
- Call Get Points Redeem Config API with user type and currency
- Validate configuration is active and available
- Check minimum points requirements against current balance
- Display available redemption options and limits
4. Redemption Validation
- Validate user has sufficient points for minimum redemption
- Check if requested redemption amount is within limits
- Verify redemption configuration is active
- Ensure user type matches configuration requirements
- Display validation results and available options
5. Redemption Processing
- Collect redemption details from user input
- Prepare company admin user information
- Call Redeem User Reward Points API with all required parameters
- Display success confirmation and transaction details
6. Redemption History Display
- Use the same user ID and currency ID
- Call Get User Points Redeem API with pagination
- Display redemption history with transaction details
- Show amounts redeemed, descriptions, and timestamps
- Handle pagination for large redemption history
7. Error Handling
- Validate API responses for success status
- Handle insufficient points scenarios
- Manage configuration unavailability
- Process redemption limit violations
- Display appropriate error messages to users
8. User Experience Flow
- Provide clear navigation between different views
- Show loading states during API calls
- Display confirmation dialogs for redemption actions
- Maintain consistent pagination across history views
- Ensure responsive design for different screen sizes