Transaction Earn Point
This API is used when a customer performs a transaction (e.g., purchase, payment, etc.). This API records the transaction and automatically calculates the points earned based on the customer’s tier level or applicable point rules.
Endpoint
URL : {BaseURL}/api/v1/transaction
Method : POST
Header : Content-Type : Application/JSON
Header : Authorization : {{Token}}
Request
This section explains the request parameters and provides example JSON requests for recording a customer transaction and calculating the reward points earned.
Description Parameter Request
| Field | Data Type | Mandatory | Format | Description |
|---|---|---|---|---|
| refId | String (36) | YES | UUID | Unique reference ID for the transaction. |
| companyId | String (36) | YES | UUID | Identifier of the company. |
| customer | JSON Object | YES | JSON Object | Detail information from customer. |
| String (200) | YES | User's email address. | ||
| phoneNumber | String (200) | YES | Numeric | User's phone number. |
| transactionTime | String (32) | YES | Timestamp | Used to record the date and time when the transaction takes place. |
| params | JSON Object | YES | JSON Object | An object of additional parameters for the transaction. |
| Spend Amount | String (200) | NO | Numeric | Specifies the transaction amount that serves as the basis for point calculation. |
Sample JSON Request
curl --location '{{BaseURL}}/api/v1/transaction' \
--header 'Content-Type: application/json' \
--header 'Authorization: ' \
--data-raw '{
"refId": "54e713c5-6444-4ddc-8690-d8c9348b17cd",
"companyId": "7059942f-d617-4438-9a69-6b44fd51fb0d",
"customer": {
"email": "User-dashboard@mail.com",
"phoneNumber": "+6282100000001",
"transactionTime": "2025-09-01T14:30:00Z",
"params": {
"Spend Amount": 50000
}
}
}'
Response
This section describes the response parameters and provides JSON response examples returned after the transaction is successfully recorded and reward point are calculated.
Description Parameter Response
| Field | Data Type | Mandatory | Format | Description |
|---|---|---|---|---|
| requestID | String (36) | YES | UUID | Unique identifier for the request. |
| rc | Integer (3) | YES | Numeric | Response code indicating the status of the operation. |
| message | String (200) | YES | Alphanumeric | A descriptive message regarding the response. |
| data | JSON Object | YES | JSON Object | Detail information from data. |
Sample JSON Response
{
"requestId": "795093cf-bd80-4e52-9e0c-59774d0e998a",
"rc": 201,
"message": "success",
"data": null
}