Skip to main content

Transaction

Transaction in OneRewards represent sales transaction, points transaction or voucher transaction of members.

  • Sales transaction represent the member's spending on your company.
  • Points transaction represent the member's points changes on your company, such as point collection and redemption.
  • Voucher transaction represent the member's usage of voucher on your company.

Sales

It records the total paid for this transaction, taxes, payments, and the sales details.

Sales Details

When posting transaction, the field details inside Sales Input Model is an array of Sales Detail Input Model used to record the product bought, discount that applied, returns and trade-ins. Please refer below to know how it works:

Example
For type "N"
It is used to records product bought and the price before and after taxes.
{
"type": "N",
"productId": 1,
"productCode": "Microsoft Laptop",
"description": "Microsoft Surface Pro 9 (Core i5, 16GB/256GB, Windows 11) 13-inch Tablet - Graphite (QI9-00030)",
"qty": 1,
"unitPrice": 6999,
"discount": 0,
"subTotalExTax": 6999,
"subTotal": 6999,
"seq": 1
}
For type "D"

It is used to records for discount that applied to the whole bill instead of specific products. If vouchers are used for the discount, the field Vouchers should have the corresponding record.

{
"type": "D",
"unitPrice": 0,
"discount": 0,
"subTotalExTax": -699.9,
"subTotal": -699.9,
"seq": 2
}
For type "R"
It is used records return product previously bought.
{
"type": "R",
"productId": 1,
"productCode": "Microsoft Laptop",
"description": "Microsoft Surface Pro 9 (Core i5, 16GB/256GB, Windows 11) 13-inch Tablet - Graphite (QI9-00030)",
"qty": -1,
"unitPrice": 6999,
"discount": 0,
"subTotalExTax": -6999,
"subTotal": -6999,
"seq": 1
}
For type "T"
It is used to records the product traded-in followed by product bought with it.
{
"type": "T",
"productId": 2,
"productCode": "Acer Laptop",
"description": "Acer Predator Helios Neo 16 PHN16-71-77HU / Intel Core i7-13700HX / 16GB-32GB RAM / 1TB SSD / 16" WQXGA IPS / RTX4060 8GB / W11",
"qty": -1,
"unitPrice": 6599,
"discount": 0,
"subTotalExTax": -6599,
"subTotal": -6599,
"seq": 1
},
{
"type": "N",
"productId": 1,
"productCode": "Microsoft Laptop",
"description": "Microsoft Surface Pro 9 (Core i5, 16GB/256GB, Windows 11) 13-inch Tablet - Graphite (QI9-00030)",
"qty": 1,
"unitPrice": 6999,
"discount": 0,
"subTotalExTax": 6999,
"subTotal": 6999,
"seq": 2
}

Sales Payment

The field payments records the payment methods and the amount paid for each methods.

{
"payments": [
{
"description": "CASH",
"amount": 6099.1
},
{
"description": "POINT",
"amount": 200
}
]
}

Points

The field Points records the point collected or redemption. If the point is used for payment, the field payments should have the corresponding record detailing another payment method with points and the amount paid.

{
"point": {
"redemption": 2000,
"redemptionDescription": "Redeem RM200"
}
}

Vouchers

The field voucher and discountAmount record the vouchers used. If there are vouchers used, the field Sales Details should have records with type D to indicate the discount amount applied.

{
"voucher": {
"voucherNo": "00001-00001-000001",
"discountAmount": 699.9
}
}

Related API methods: