Skip to main content

Gift Cards
API

The API for interacting with gift cards.

The base API object provided to purchase extension targets.

StatefulRemoteSubscribable<[]>
required

Gift Cards that have been applied to the checkout.

Was this section helpful?

The API object provided to purchase.checkout extension targets.

(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.

Was this section helpful?

Anchor to useAppliedGiftCards
useAppliedGiftCards()

Returns the current gift cards applied to the cart.

[]
Was this section helpful?

Anchor to useApplyGiftCardChange
useApplyGiftCardChange()

Returns a function to add or remove gift cards.

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