Skip to main content

Gift Cards

The API for interacting with gift cards.

The base API object provided to purchase, and customer-account.order-status extension targets.

Anchor to appliedGiftCards
appliedGiftCards
StatefulRemoteSubscribable<[]>
required

Gift Cards that have been applied to the checkout.

The API object provided to purchase.checkout extension targets.

Anchor to applyGiftCardChange
applyGiftCardChange
(change: ) => Promise<>
required

Performs an update on the gift cards. It resolves when gift card change have been negotiated and results in an update to the value retrieved through the appliedGiftCards property.

Caution

See security considerations if your extension retrieves gift card codes through a network call.

Note

This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.

Anchor to useAppliedGiftCards
useAppliedGiftCards()

Returns the current gift cards applied to the cart.

[]

Anchor to useApplyGiftCardChange
useApplyGiftCardChange()

Returns a function to add or remove gift cards.

(change: ) => Promise<>
Was this page helpful?