Bonus Points
Base URL
{baseUrl}/api/v6.1
1. Get Account Bonus Points
Endpoint
GET /account
Description
Get the current bonus points information of a customer (KH) based on the customer code account_code
.
Request
curl --location '{baseUrl}/api/v6.1/account?account_code=KH%2F2025%2F011987&fields=id%2Caccount_code%2Ctotal_point_bonus' \
--header 'X-API-KEY: {api_key}'
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
account_code | string | Yes | Customer code to query |
fields | string | Yes | Fields to retrieve, comma-separated (, ) |
Response
{
"id": 12037,
"account_code": "KH/2025/011987",
"total_point_bonus": 301,
"custom_fields": []
}
Notes
- The
total_point_bonus
field is the current bonus points.
2. Add Bonus Points to Account
Endpoint
POST /account/points/bonus
Description
Add bonus points to a specific customer.
Request
curl --location '{baseUrl}/api/v6.1/account/points/bonus' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: {api_key}' \
--data '{
"account_code": "KH/2025/011987",
"point": 301,
"reason": "Give customer 301 more bonus points"
}'
Request Body
Field | Type | Required | Description |
---|---|---|---|
account_code | string | Yes | Customer code |
point | int | Yes | Number of bonus points to add |
reason | string | Yes | Note for adding points |
Response
{
"message": "Update successful",
"account_code": "KH/2025/011987",
"account_id": 12037,
"account_points": 602
}
Notes
- The
account_points
field reflects the total points after the update. - Ensure
account_code
is valid to avoid errors.
Authentication
- Requires a valid
X-API-KEY
.
Example Use Case
- Get customer points
KH/2025/011987
→ found301
points. - Add 301 points with the reason "Give customer 301 more bonus points" → new total points:
602
.