Search

subtractCustomerRewardPoints

Subtract, or “redeem”, customer’s reward points.

Reward points accrue automatically from customer’s purchases. But whenever you perform an action that needs reward points to be redeemed — eg. apply a sales promotion where customer trades points for discount — you need to subtract the point amount manually, by calling subtractCustomerRewardPoints.

Use getCustomerRewardPoints to query for customer’s current amount of points.

To add points manually (although you typically do not need to do that), see addCustomerRewardPoints. 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.

Points are also subtracted from customer’s balance when you issue a coupon that “costs” reward points (see saveIssuedCoupon). However, this is done automatically by the API, and you do not need to call subtractCustomerRewardPoints for that.

Input parameters

Parameter nameDescriptionPossible valueRequired
customerIDCustomer's IDInteger yes
invoiceIDTransaction invoice ID.

If you want to save an invoice and adjust customer's point balance in one bulk request, set this field to a special value: "CURRENT_INVOICE_ID". Normally, creating two records where one references the other cannot be done within one bulk request; you would have to retrieve one record's ID before you can create the other. This is a special workaround for savePayment, saveGiftCard, saveIssuedCoupon, redeemIssuedCoupon, and subtractCustomerRewardPoints.

Note that if saving the invoice results in an error, the payments, coupons etc. will be created and points subtracted nevertheless, but without a reference to any invoice. For better error checking you may still want to do saveSalesDocument as a separate request.
Integer
campaignIDInteger
warehouseIDInteger
salepointIDInteger
salespersonIDInteger
pointsPoints to subtract (must be bigger then 0).Integer yes
subtractedUnixTimeTransaction timestamp.Unix timestamp
issuedCouponIDID of the issued coupon. 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
customerIDInteger
remainingPointsIntegerCustomer's balance
subtractedPointsInteger