Features
Introduction
Gift Card integrations make use of the Web Extensions interface, allowing the app to use Javascript to interact with sales directly in the POS in realtime.
Important
Creating and/or adding funds to gift cards via API or the Web Extension interface is not currently supported. Only redemption is currently supported. See Understanding Gift Cards for more details.
Scanning Gift Card
- If the gift card has a QR code or barcode, use
pos_onBarcodeScanEvent(callback)
to scan the gift card and send the results to the provided callback. - If the gift card has NFC, use
pos_onNFCEvent(callback)
to scan the gift card and send the results to the provided callback.
Redeeming for Item
- If the gift card is being redeemed for a specific fixed price item, use
pos_addItemToCurrentAccount(itemId)
. - If the gift card is being redeemed for a specific variable price item, use
pos_addSpecialItemToCurrentAccount(itemId, priceCents, name)
to add the item and set its price.
Determining Payment Amount
- Use
pos_getCurrentAccount()
to get the order total when making full payment with a gift card. This total amount includes tax for both tax-inclusive and tax-exclusive scenarios.
note
- Individual item and unit tax amounts for tax-exclusive scenarios cannot be determined with this function. To calculate the tax amount for individual items, use the tax-breakdown endpoint.
Paying with Gift Card
- To pay the current account in full, use
pos_payAccount(paymentMethodCode, callback)
. - To make a partial payment using the gift card, use
pos_addPayment(amountCents, paymentMethodCode, callback)
.
Handling Errors and Responses
- The
posData
, andposResponse
objects will contain response data from the POS that your app may need to process. - If an issue is encountered while executing the function, a
posError
object containing a description of the error will be returned.
Special Offers/Discounts
- To retrieve discounts that can be applied, use
pos_getAvailableDiscounts(callback)
. - To apply a discount to a specific item, use
pos_toggleDiscount(discountCode, lineId, callback)
. - To apply a discount to the whole sale, use
pos_toggleGlobalDiscount(discountCode, callback).
.
Communication with POS
- Use
pos_postMessage(data)
to send messages to the POS app.
Adding a reference
- To add a reference to the current sale, for future retrieval, use
pos_addExternalReference(reference, prefix)
Closing the Web Extension
- Once the gift card operations are completed, use
pos_close()
to close the web view hosted in the POS app.