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 name Description Possible value Required
customerID Customer's ID integer yes
invoiceID Transaction 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
campaignID integer
warehouseID integer
salepointID integer
salespersonID integer
points Points to subtract (must be bigger then 0). integer yes
subtractedUnixTime Transaction timestamp. Unix timestamp
issuedCouponID ID of the issued coupon. Available only if "Reward point extras" module is enabled on your account. integer
description Available only if "Reward point extras" module is enabled on your account. string

Response

Field name Type Description
customerID integer
remainingPoints integer Customer's balance
subtractedPoints integer
transactionID integer ID of reward point subtraction transaction. getUsedRewardPointRecords returns the same transactionID.