Setup 2 - REST API Specs For Reward System v1.05 (Confirm Transaction)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

API Integration Guide Page 1

POS INTEGRATION SPECIFICATIONS

• Setup 2 - REST API specs for Reward System Interface


API Integration Guide Page 2

Table of Contents
Document Sign Off 3
Revision History 4
Generic Format 5
Overview 6
API 6
3.1 Checkout 7
3.2 Confirm Transaction 8
API Integration Guide Page 3

Document Sign Off

Version: 0.02

Signature:

Name:

Date:
API Integration Guide Page 4

Revision History
Name Date Reason for Changes Version

Tan Jack Hau 15/03/19 First draft created 0.01

Tan Jack Hau 22/03/19 Added checkout API 0.02

Edison Tan 08/08/19 Remove Mobile No. and added Reward Value, 1.03
Reward Name from the response API.

Edison Tan 08/10/19 Add in Confirm API 1.04

Edison Tan 11/11/19 Change Checkout API to ScanMember API (Removed 1.05
receiptNumber as mandatory)
API Integration Guide Page 5

1. Generic Format
● The APIs are JSON REST APIs

● Datetime (ISO 8601 Format) in UTC


o We standardize all datetime must be ISO 8601 in UTC
o Example: "2019-02-24T00:00:00Z"

● Request Url: http://{IP Address}:3000, IP address will be different for each Merchant
Terminal App.

● (Test API: https://www.getpostman.com/collections/1077e04d8fca7c58eaf5)


API Integration Guide Page 6

2. Overview
a. Simple to add a button in the POS System called “Mall Reward” for OGF Member to
earn points and use rewards.

b. Process flow of OGF Mall Reward.


API Integration Guide Page 7

3. API
Scan Member

This API is to open the Checkout page. This API will take long as waiting merchant terminal
app to complete the transaction with shopper.

3.1 ScanMember
HTTP Post to http://{IPAddress}:3000/ScanMember

Request Body
{
“amount”: 2000,
“posId”: “ABC124”
}

Response Body
{
“error”: “”,
“status”: 0,
“rewardConfirmation”: {
“userId”: “57d5d6e8-bd69-4eec-a814-0fde1737bcb0”,
“posId”: “ABC124”,
“totalAmount”: 2000,
“totalReward”: 1000,
"transNo": "23456789123",
“rewardTransactions”:[
{
“rewardSubtype”: 1,
“serialNumber”: “OGF0000001”,
“rewardValue”: 500,
“rewardName”: “1000 cash voucher”
},
{
“rewardSubtype”: 3,
“ serialNumber”: “OGF0000002”,
“rewardValue”: 500,
“rewardName”: “1000 cash voucher”
API Integration Guide Page 8

}
]
}
}

Confirmed Transaction

This API is to update the Receipt Number once the POS transaction is completed.

3.2 Confirm
HTTP Post to http://{IPAddress}:3000/Confirm

Request Body
{
"amount": 2000,
"posId": "ABC124",
"transNo": "23456789123",
"receiptNumber": "A123123123",
"receiptDateTime": "2019-03-05T11:30:00Z"
}

Response Body
{
"error": "",
"status": 0,
"transactionConfirmation": {
"userId": "57d5d6e8-bd69-4eec-a814-0fde1737bcb0",
"receiptNumber": "A123123123",
"receiptDateTime": "2019-03-05T11:30:00Z",
"posId": "ABC124",
"rewardTransactions": [
{
“rewardSubtype”: 1,
“serialNumber”: “OGF0000001”,
“rewardValue”: 500,
“rewardName”: “1000 cash voucher”
},
{
“rewardSubtype”: 3,
“ serialNumber”: “OGF0000002”,
“rewardValue”: 500,
“rewardName”: “1000 cash voucher”
}
]
API Integration Guide Page 9

"transNo": "23456789123",
"totalAmount": 2000,
"totalReward": 1000
}
}

Class name Variables Description


RewardResult error : String error message
Success = 0,
Error =1,
status : int Cancel =2
rewardConfirmation: RewardConfirmation Confirmation details
RewardConfirmation userId : String Member ID (optional)
Member mobile number
mobileNo : String (optional)
receiptNumber : String Same as data from POS
receiptDateTime : String Same as data from POS
posId : String Same as data from POS
totalAmount : Double Same as data from POS
Total reward value of all
totalReward : Double vouchers
rewardTransactions:
ArrayList<RewardTransaction> All selected vouchers

RewardTransaction serialNumber : String The voucher’s serial number

rewardValue: Double The voucher’s reward value

rewardName: String The voucher’s reward name


1 = Mall
2 = Partner
rewardSubType : Int 3 = Retailer

You might also like