Search

getCoupons

Get coupon rules.

Coupon rule is like the “blueprint” or “type” of a printed coupon (that is issued from POS and handed to a customer). The “blueprint” specifies in what circumstances the coupons will be printed from POS, and what promotion will apply when customer returns with the coupon — ie., what discount or extra value it effectively carries.

A coupon rule should be associated with a sales promotion (see getCampaigns).

In order for the customer to use those discounts, you need to issue the customer a coupon with an unique serial number (see getIssuedCoupons, saveIssuedCoupon). When customer returns with the coupon code, it has to be scanned at the POS. Scanning redeems the coupon, invokes the promotion associated with it, and gives customer a discount.

To create a coupon rule, see saveCoupon.

Input parameters

Parameter nameDescriptionPossible valueRequired
couponIDID of couponInteger
couponIDsMultiple coupon IDs, separated by commas, such as: 1,2,3,4,5.String
changedSinceRetrieve only items that have been added or modified since the specified timestamp. Use it to keep a local database in sync with ERPLY.Integer (Unix timestamp)
recordsOnPageNumber of records API should return. By default 20, at most 100.Integer
pageNoAPI returns at most recordsOnPage items at a time. To retrive the next recordsOnPage items, send a new request with pageNo incremented by one. By default, API returns "page 1".Integer

Response

Field nameTypeDescription
couponIDInteger
campaignIDIntegerIf set, the coupon gives discounts according to the specified sales promotion.
warehouseIDIntegerIf set, these coupons are issued only from a specific store/location.
issuedFromDateDateissuedFromDate and issuedUntilDate specify the time period when this coupon may be issued. It does not affect the validity of the coupon (the validity period is defined by the sales promotion instead).
issuedUntilDateDate
nameString
codeString
printedAutomaticallyInPOSInteger (0 or 1)If set to 0, then the cashier may issue the coupon at any time, and the following conditions are all irrelevant. If set to 1, POS will print this coupon automatically, if the following conditions are met:
thresholdIntegerCustomer must either:
  1. make a purchase with a certain value (in which case thresholdType = "this_sale" and threshold specifies how big the purchase must be: for example, $250.00 or worth 10 reward points),
  2. Or customer's all purchases over the history must give a certain total (in which case thresholdType = "points_amt" and threshold specifies how much purchases the customer must have made: for example, worth a total of $500, or 125 reward points.
measureStringPossible values: "dollars","points".
thresholdTypeStringPossible values: "points_amt","this_sale".
printingCostInRewardPointsIntegerPrinting cost in reward points.
descriptionStringIf defined, description will be printed on coupon instead of name.
addedUnix timestampCreation time.
lastModifiedUnix timestampLast modification time.