Skip to content

Advanced Coupon List

If you want to show the coupon list with your own UI, just call the following method to get the list:

nearit.getCoupons(function(coupons) {
  // iterate over the array of coupons
}, function(error) {
  // there was an error fetching the coupon list
});
nearit.getCoupons(
  coupons => { /* iterate over the array of coupons */ },
  error => { /* there was an error fetching the coupon list */ }
);

Each coupon has the following properties:

Name Description
title The title.
description A description.
value The value. Can be string or number
expiresAt Expiration date.
redeemableFrom Timestamp from which the coupon can be used by the user.
serial Serial number
claimedAt When the coupon has been obtained by the user.
redeemedAt When the coupon has been redeemed. If it is null, the coupon is valid.
image An object containing fullSize and squareSize images urls.