Search

addCustomerRewardPoints

Add a new points transaction and increase customer’s point balance.

Typically, reward points accumulate automatically from customer’s purchases. You can define the “dollar spent / points earned” ratio in ERPLY backend, SETTINGS → Configuration → Invoices and Sales. This API function is only for adjusting customer’s point balance manually, or for building a custom loyalty program.

To subtract points from customer, see subtractCustomerRewardPoints. To get current point balance for a specific customer, see getCustomerRewardPoints. (There is currently no way to retrieve point balances for all customers simultaneously.)

If you are building a custom loyalty program, you may also take a look at getEarnedRewardPointRecords and getUsedRewardPointRecords — to retrieve a detailed list of all transactions where customer has earned or spent points.

Input parameters

Parameter nameDescriptionPossible valueRequired
customerIDCustomer ID.Integer
invoiceIDInvoice ID. Sale that earned the points.Integer
pointsPoints must be bigger then 0.Integer
createdUnixTimeUnix timestampTransaction timestamp.
expiryUnixTimeUnix timestampExpiry timestamp.
pointOfSaleIDRegister ID. Available only if "Reward point extras" module is enabled on your account.Integer
employeeIDCashier who processed the sale. Available only if "Reward point extras" module is enabled on your account.Integer
descriptionAvailable only if "Reward point extras" module is enabled on your account.String

Response

Field nameTypeDescription
transactionIDIntegerID of the newly-created item.
customerIDInteger
pointsInteger
createdUnixTimeUnix timestamp
expiryUnixTimeUnix timestamp

This API call returns error 1006 if "Reward points" module is not enabled on your account.