getIssuedCoupons

Get the list of coupons that have been printed from POS and issued to customers.

Coupons are used in Erply to give promotional discounts. Coupons can be printed from POS and given to customers. If customer returns to the store, presents the coupon and cashier scans coupon code, a specific promotion will apply to the ongoing sale.

Issued coupons can be registered in Erply with saveIssuedCoupon. If customer returns to the store with a coupon, it can be validated with verifyIssuedCoupon and then redeemed with redeemIssuedCoupon. To apply coupon discount to a sale, pass coupon code to API call calculateShoppingCart. calculateShoppingCart will also notify you whether the coupon was applicable to that particular shopping cart or not.

This API call returns error 1006 if promotions module is not enabled on this account.

Input parameters

Parameter name Description Possible value Required
uniqueIdentifier Unique identifier of the coupon. String
status Filter coupons by status: ACTIVE, REDEEMED, EXPIRED. String
issuedTimestampFrom Unix timestamp.
issuedTimestampTo Unix timestamp.
redeemedTimestampFrom Unix timestamp.
redeemedTimestampTo Unix timestamp.
issuedCustomerID Integer
issuedCustomerIDs Comma-separated list of customer IDs. String
redeemedCustomerID Integer
redeemedCustomerIDs Comma-separated list of customer IDs. String
couponIDs Comma-separated list of coupon rule IDs (see getCoupons). String
changedSince Retrieve 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)
recordsOnPage Number of records API should return. By default 20, at most 100. Integer
pageNo API 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 name Type Description
issuedCouponID Integer ID of the issued coupon.
couponID Integer ID of the coupon rule (see getCoupons). Coupon rule is like the "blueprint" or "type" of a printed coupon. 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.
couponCode String See previous.
campaignName String Promotion name.
uniqueIdentifier String Unique identifier of the coupon.
issuedTimestamp Unix timestamp Issue time.
expiryDate ISO date (yyyy-mm-dd) Expiry date.
issuedInvoiceID Integer Invoice the coupon was issued with.
issuedInvoiceNo String Invoice number.
issuedCustomerID Integer Customer the coupon was issued to.
issuedCustomerCardNumber Integer Code of customer's loyalty/membership card.
issuedWarehouseID Integer Store or location where the coupon was issued.
issuedWarehouseCode String Store or location code.
issuedPointOfSaleID Integer Register where the coupon was issued.
issuedEmployeeID Integer Salesperson who issued the coupon.
isPrintedAutomatically Integer (1 or 0) Denotes whether the coupon was printed automatically (as per coupon terms and conditions) or did the salesperson choose it manually.
redeemedTimestamp Unix timestamp Accept time.
redeemedInvoiceID Integer Invoice the coupon was redeemed with.
redeemedInvoiceNo String Invoice number.
redeemedCustomerID Integer Customer who redeemed the coupon.
redeemedCustomerCardNumber Integer Code of customer's loyalty/membership card.
redeemedWarehouseID Integer Store or location where the coupon was accepted.
redeemedWarehouseCode String Store or location code.
redeemedPointOfSaleID Integer Register where the coupon was accepted.
redeemedEmployeeID Integer Salesperson who accepted the coupon.
status String Issued coupon status, possible statuses are 'ACTIVE', 'REDEEMED' AND 'EXPIRED'.
added Unix timestamp Creation time.
lastModified Unix timestamp Last modification time.