Skip to main content

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
FieldData TypeMandatoryFormatDescription
refIdString
(36)
YESUUIDUnique reference ID for the transaction.
companyIdString
(36)
YESUUIDIdentifier of the company.
customerJSON ObjectYESJSON ObjectDetail information from customer.
emailString
(200)
YESEmailUser's email address.
phoneNumberString
(200)
YESNumericUser's phone number.
transactionTimeString
(32)
YESTimestampUsed to record the date and time when the transaction takes place.
paramsJSON ObjectYESJSON ObjectAn object of additional parameters for the transaction.
Spend AmountString
(200)
NONumericSpecifies 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
FieldData TypeMandatoryFormatDescription
requestIDString
(36)
YESUUIDUnique identifier for the request.
rcInteger
(3)
YESNumericResponse code indicating the status of the operation.
messageString
(200)
YESAlphanumericA descriptive message regarding the response.
dataJSON ObjectYESJSON ObjectDetail information from data.
Sample JSON Response
{
"requestId": "795093cf-bd80-4e52-9e0c-59774d0e998a",
"rc": 201,
"message": "success",
"data": null
}