Description

Credit a brand’s customer with points.

A customer’s spending will be the same as its points if the value is omitted in the request.

Parameters

Parameter Type Value Required
operation_name String collectPoints true
variables JSON $JSON_OBJECT true

$JSON_OBJECT Structure

Key Type Value Required
brandId String $SHARED_BRAND_ID true
phoneNumber String $PHONE_NUMBER true
extension String $EXTENSION true
outletName DEPRECEATED String $OUTLET_NAME false
outletId String $OUTLET_ID true
points Int $POINTS true
spending Float $SPENDING false
transactionNumber String $TRANSACTION_NUMBER false

Example

Request

curl \
-X POST \
-H "Content-Type: application/json" \
-H "Token: $TOKEN" \
-d '{
        "operation_name": "collectPoints",
        "variables": {
            "phoneNumber": "60123123123",
            "extension": "MY",
            "brandId": $SHARED_BRAND_ID,
            "outletName": $OUTLET_NAME,
            "outletId": $OUTLET_ID,
            "points": 100
        }
    }' \
https://mulahpoints.com/third_party

Response

{
  "data": {
    "thirdPartyCollectPoints": {
      "result": $SUCCESS_MESSAGE,
      "collectionId": $COLLECTION_ID,
      "phoneNumber": $PHONE_NUMBER,
      "collectedPoints": $POINTS,
      "spending": $SPENDING,
      "balance": $BALANCE,
      "errors": [
        {message: $ERROR_MESSAGE}
      ]
    }
  },
  "errors": [
    {message: $ERROR_MESSAGE}
  ]
}