getGiftCards

Retrieve gift cards.

To create a new gift card, or update the balance of an existing gift card, use saveGiftCard. To get a log of gift card redeemings, see getGiftCardRedeemings.

In Erply, gift cards have a "balance". A gift card can be used multiple times, until all the balance has been spent. A customer can use any gift card that has not expired and has a non-zero balance.

See getGiftCardTypes to get the the possible types.

Input parameters

Parameter name Description Possible value Required
giftCardID ID of gift card integer
code Gift card's code string
purchaseInvoiceID Available only if "Gift card extras" module is enabled on your account. integer
purchasedUnixTimeFrom Filter gift cards by the "time of purchase" timestamp. Unix timestamp
purchasedUnixTimeTo Filter gift cards by the "time of purchase" timestamp. Unix timestamp
redeemedUnixTimeFrom Filter gift cards by the "time when redeemed" timestamp. Unix timestamp
redeemedUnixTimeTo Filter gift cards by the "time when redeemed" timestamp. Unix timestamp
vatrateID Filter gift cards by VAT rate ID. integer
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 retrieve 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
giftCardID integer ID of gift card
typeID integer ID of the gift card type
code string
value Decimal
balance number Remaining balance
minimumSpend number Minimum spend value
purchasingCustomerID integer
purchaseDateTime integer Unix timestamp. Date and time of purchase
redeemingCustomerID integer
redemptionDateTime integer Unix timestamp. Date and time of redemption
expirationDate Date (yyyy-mm-dd) Gift card expiration date. Note that gift card expiration is not enabled by default. Contact us if you need to enable gift card expiration. If not enabled, this field's value will always be an empty string. If this gift card does not have an expiration date, value will be an empty string.
purchaseInvoiceID integer Invoice with which the gift card was purchased. Available only if "Gift card extras" module is enabled on your account.
vatrateID integer

Tax rate (VAT rate) the gift card was sold with.

If the value is 0, you may assume that the gift card was sold with 0% tax.

information string
added integer Unix timestamp. Creation time.
lastModified integer Unix timestamp. Last modification time.