saveGiftCard

Create a new gift card; or redeem an existing gift card and update its balance.

To retrieve a list of all gift cards, or for more information about gift cards in Erply, see getGiftCards.

Input parameters

Parameter name Description Possible value Required
giftCardID ID of an existing gift card. If this parameter is present, then the matching gift card will be updated. Integer
typeID ID of an existing gift card type. To get the list of types, see getGiftCardTypes. Integer
code If the code matches an existing gift card, then that gift card will be updated, instead of creating a new one. String
value Decimal
balance Remaining balance Decimal
information String
purchasingCustomerID Customer who purchased the gift card Integer
purchaseDateTime Date and time of purchase Unix timestamp
purchaseWarehouseID Store or location where the gift card was purchased Integer
purchasePointOfSaleID Register where the gift card was purchased Integer
purchaseInvoiceID Invoice with which the gift card was purchased.

If you want to save an invoice and an associated gift card together 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 coupons redeemed nevertheless, but without a reference to any invoice. For better error checking you may still want to do saveSalesDocument as a separate request.
Integer
purchaseEmployeeID Salesperson who sold the gift card Integer
redeemingCustomerID Customer who redeemed the gift card Integer
redemptionDateTime Date and time of redemption Unix timestamp
redemptionWarehouseID Store or location where the gift card was redeemed Integer
redemptionPointOfSaleID Register where the gift card was redeemed Integer
redemptionInvoiceID Invoice with which the gift card was redeemed.

If you want to save an invoice and redeem an associated gift card together 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 coupons redeemed nevertheless, but without a reference to any invoice. For better error checking you may still want to do saveSalesDocument as a separate request.
Integer
redemptionEmployeeID Salesperson who accepted the gift card Integer
expirationDate 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 not be saved in database. Date (yyyy-mm-dd)
vatrateID

Indicate the tax rate (VAT rate) the gift card was sold with.

If you omit this field or set the value to 0, Erply will assume the gift card was sold with 0% tax.

Taxing gift cards at time of purchase may sometimes be required due to the EU Council Directive 2016/1065, which defines the concept of "single-purpose vouchers".

A list of defined tax rates can be fetched with API call getVatRates.

Integer

Response

Field name Type Description
giftCardID Integer ID of the newly-created or updated item