Redeem User Reward Points API
Overview
Redeem user reward points for cashback or vouchers based on the redemption configuration. This API processes the points redemption transaction and updates the user's wallet balance.
API Details
- Method: POST
- URL: https://api.gafapay.com:8443/gafapay/v3/reward_promotion/redeem_user_reward_points
- Content-Type: application/json
- companyid: 59388167894b4d10a04fe5da3b8a2104
- requestid: b35d332f-131e-44c1-892f-8322e022da74
- Authorization: Token required
Endpoint
POST https://api.gafapay.com:8443/gafapay/v3/reward_promotion/redeem_user_reward_points
Headers
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJmYjhmMDkyMTBlMGY0NmI3YjQyNjJkNzdmNWI2YzI3MyIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3NzY5NDU0fQ.QMvK_JLnYBE6XYaFdyg16aVupTONBO7eMGDmzAGVhVg
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: b35d332f-131e-44c1-892f-8322e022da74
Content-Type: application/json
Request Body
{
"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"
}
}
Request Body Fields
Required Fields
-
redeem_points (number, required): Number of points to redeem
- Must be within the configured min/max limits
- Example: 10, 25.5, 100
-
user_type (integer, required): Type of user account
2= Customer3= Merchant5= Agent
-
user_id (string, required): Unique identifier of the user
- Format: UUID string
- Example: "fb8f09210e0f46b7b4262d77f5b6c273"
-
wallet_id (string, required): Unique identifier of the user's wallet
- Format: UUID string
- Example: "4010122e9d604e798b9a6e961df3e5b4"
-
currency_id (string, required): Unique identifier of the currency
- Format: UUID string
- Example: "1f1519903ed240578f071aa45cb479f2"
-
company_admin_user_info (object, required): Company admin user information for transaction processing
- currency_id (string, required): Currency identifier
- debit_type (integer, required): Type of debit transaction
- debit_type_id (string, required): Debit type identifier
- debit_account_type (integer, required): Type of debit account
- debit_account_type_id (string, required): Debit account type identifier
- username (string, required): Admin username processing the transaction
Response
{
"success": 1,
"error": [],
"data": {
"message": "REWARD_PROMOTION_REWARD_POINTS_REDEEM_SUCCESS",
"redeem_points_detail": {
"points": 10.0,
"amount": 10.0,
"txn_id": "b25a85a59e994314bced888814dda327",
"txn_number": "68623672"
}
}
}
Response Fields
- success (integer): Response status indicator
1= Success0= Failure
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- message (string): Success message indicating points were redeemed successfully
- redeem_points_detail (object): Details of the redemption transaction
- points (number): Number of points that were redeemed
- amount (number): Amount credited to the wallet (in currency units)
- txn_id (string): Unique transaction identifier for the redemption
- txn_number (string): Human-readable transaction number
Example Usage
curl --location 'https://api.gafapay.com:8443/gafapay/v3/reward_promotion/redeem_user_reward_points' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJmYjhmMDkyMTBlMGY0NmI3YjQyNjJkNzdmNWI2YzI3MyIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3NzY5NDU0fQ.QMvK_JLnYBE6XYaFdyg16aVupTONBO7eMGDmzAGVhVg' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b35d332f-131e-44c1-892f-8322e022da74' \
--header 'Content-Type: application/json' \
--data '{
"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"
}
}'
Notes
- This API processes the redemption of user reward points
- The redemption amount is calculated based on the points redemption configuration
- Points are deducted from the user's reward points balance
- The equivalent amount is credited to the user's wallet
- A transaction record is created with a unique transaction ID and number
- The
company_admin_user_infois required for transaction processing and audit purposes - Ensure the user has sufficient points before attempting redemption
- The redemption must comply with the configured min/max limits and active status