Search

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 nameDescriptionPossible valueRequired
giftCardIDID of an existing gift card. If this parameter is present, then the matching gift card will be updated.Integer
codeIf the code matches an existing gift card, then that gift card will be updated, instead of creating a new one.String
valueDecimal
balanceRemaining balanceDecimal
purchasingCustomerIDCustomer who purchased the gift cardInteger
purchaseDateTimeDate and time of purchaseUnix timestamp
purchaseWarehouseIDStore or location where the gift card was purchasedInteger
purchasePointOfSaleIDRegister where the gift card was purchasedInteger
purchaseInvoiceIDInvoice 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
purchaseEmployeeIDSalesperson who sold the gift cardInteger
redeemingCustomerIDCustomer who redeemed the gift cardInteger
redemptionDateTimeDate and time of redemptionUnix timestamp
redemptionWarehouseIDStore or location where the gift card was redeemedInteger
redemptionPointOfSaleIDRegister where the gift card was redeemedInteger
redemptionInvoiceIDInvoice 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
redemptionEmployeeIDSalesperson who accepted the gift cardInteger
expirationDateGift 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)

Response

Field nameTypeDescription
giftCardIDIntegerID of the newly-created or updated item