Skip to main content

Spending Loyalty Point

Award spending-loyalty points to a member based on a sales amount. Uses the merchant's loyalty point rules to compute the reward.

When to Use

Use this endpoint when:

  • Awarding points proportional to spend after a non-auto-give payment
  • Implementing manual loyalty-point awarding for non-WeChat wallets
caution

Only WeChat Pay + WeChat OA loyalty program supports auto-give points during payment. All other wallets DO NOT support auto-give points. Use the merchant app / terminal app or this endpoint to award points manually for each payment.

How to Use

Endpoint
POST/v3/loyalty/spending-reward

POST to /v3/loyalty/spending-reward with currencyType, amount, and the member identifier.


Request Parameters

currencyTypeSTRINGrequired

Currently MYR only

Example: MYR

amountINTEGERrequired

Transaction amount to calculate loyalty points earned.

Example: 100

typeSTRINGrequired

"ID" ,"PHONENUMBER" or "QRCODE"

Example: Use phone number , ID or QR Code to give loyalty point(s).

memberIdSTRING

Member ID if type "ID" being provided.

Example: "2777058682717858418"

countryCodeSTRING

Country code if type "PHONENUMBER" being provided.

Example: "60"

phoneNumberSTRING

Phone number if type "PHONENUMBER" being provided.

Example: "172826990"

Example Request Phone Number
JSON
1curl --location --request POST "{{open_base_path}}/v3/loyalty/spending-reward" \
2--header "Content-Type: application/json" \
3--header "Authorization: Bearer {{clientToken}}" \
4--header "X-Signature: sha256 Sty3LNcKA8+WlMHtAgIY+y1xbwnzKsN0UdyKaW+yYIgcTkBAtF7G5Lx251qQITURJ4wiXPDODxhs1nFVmBBing==" \
5--header "X-Nonce-Str: VYNknZohxwicZMaWbNdBKUrnrxDtaRhN" \
6--header "X-Timestamp: 1528450585" \
7--data "{
8 \"currencyType\": \"MYR\",
9 \"amount\": 100,
10 \"type\": \"PHONENUMBER\",
11 \"countryCode\": \"60\",
12 \"phoneNumber\": \"176473298\"
13}"
Example Request QR Code
JSON
1curl --location --request POST "{{open_base_path}}/v3/loyalty/spending-reward" \
2--header "Content-Type: application/json" \
3--header "Authorization: Bearer {{clientToken}}" \
4--header "X-Signature: sha256 Sty3LNcKA8+WlMHtAgIY+y1xbwnzKsN0UdyKaW+yYIgcTkBAtF7G5Lx251qQITURJ4wiXPDODxhs1nFVmBBing==" \
5--header "X-Nonce-Str: VYNknZohxwicZMaWbNdBKUrnrxDtaRhN" \
6--header "X-Timestamp: 1528450585" \
7--data "{
8 \"currencyType\": \"MYR\",
9 \"amount\": 100,
10 \"type\": \"QRCODE\"
11}"
Example Request Member ID
JSON
1curl --location --request POST "https://sb-open.revenuemonster.my/v3/loyalty/spending-reward" \
2--header "Content-Type: application/json" \
3--header "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjIwMTgtMDMtMTMiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsiKiJdLCJleHAiOjE1MjE2MjkyNTYsImlhdCI6MTUyMTYyMjA1NywiaXNzIjoiaHR0cHM6Ly9zYi1vYXV0aC5yZXZlbnVlbW9uc3Rlci5teSIsImp0aSI6IkVod0tFRTlCZFhSb1FXTmpaWE56Vkc5clpXNFF5cmYza3EzTDY4QnoiLCJuYmYiOjE1MjE2MjIwNTcsInN1YiI6IkVoUUtDRTFsY21Ob1lXNTBFSlhWemQzd3JhcVRPUklRQ2dSVmMyVnlFSXlKcUl6dnlNUFZjUSJ9.dJknY9MZHLNrKx1p7gZxS0_oA3uXLWplDU1r1dpwxIbmdB6yw4tQBTXKlWArDfKLlBDn6v22_gT5Px7sdCMj7e5M9eRoJoMnoPnslgYpmJJ5kjqAbKU7dUxKb1OzFLrvmtSK9r-FRLVtMFHioWYpwgSvSPBgZ6lAYkUyDzH7aKadFYtQcBuJR0hlq2CXtP0mzbHOeu2q6giONf3E5-XqS8lLRtuHPAbJ7_YFwo0Oe2zc6h05IOocmx_NvBVPfDBnuygTU063h70Q987MYeGDV_Os4N6N_I4b-GoHprEPtmntB1RJPrFrY28hvvoUfDHXHZVXT1GlrsozrkWV4EjbTw" \
4--header "X-Signature: sha256 Sty3LNcKA8+WlMHtAgIY+y1xbwnzKsN0UdyKaW+yYIgcTkBAtF7G5Lx251qQITURJ4wiXPDODxhs1nFVmBBing==" \
5--header "X-Nonce-Str: VYNknZohxwicZMaWbNdBKUrnrxDtaRhN" \
6--header "X-Timestamp: 1528450585" \
7--data "{
8 \"currencyType\": \"MYR\",
9 \"amount\": 100,
10 \"type\": \"ID\",
11 \"memberId\": \"2777058682717858418\"
12}"

Response Parameters

codeSTRING

Successfully call this endpoint. If fail, will return error code object (Refer Appendix 1: Error Codes)

Example: "SUCCESS"

Example Response (PhoneNumber & Member ID)
JSON
1{
2"code": "SUCCESS"
3}
Example Response (QR Code)
JSON
1{
2"item": {
3 "id": "83f575034d45f776b8e1fed1a26e2fee",
4 "qrCodeUrl": "https://dev-rm-api.ap.ngrok.io/qr/4118165203679668885/loyalty/d3008719d04cab91c53eb0b5d8cc4ee6"
5},
6"code": "SUCCESS"
7}