saveGiftCard

This call is deprecated. We recommend to use Point of Sale API instead.

The corresponding new call is: POST /v1/giftcard/, POST /v1/giftcard/bulk/.

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
minimumSpend Minimum spend value 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