Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Gift Cards API

The API for interacting with gift cards.

The base API object provided to purchase 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?