# useApplyGiftCardChange Returns a function to add or remove gift cards. > Caution: > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call. ## ### UseApplyGiftCardChangeGeneratedType Returns a function to add or remove gift cards. > Caution: > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call. #### Returns: (change: GiftCardChange) => Promise export function useApplyGiftCardChange< ID extends RenderExtensionPoint = RenderExtensionPoint, >(): (change: GiftCardChange) => Promise { const api = useApi(); if ('applyGiftCardChange' in api) { return api.applyGiftCardChange; } throw new ExtensionHasNoMethodError( 'applyGiftCardChange', api.extensionPoint, ); } ### GiftCardAddChange ### type value: `"addGiftCard"` The type of the `GiftCardChange` API. ### code value: `string` Gift card code. ### GiftCardRemoveChange ### type value: `"removeGiftCard"` The type of the `GiftCardChange` API. ### code value: `string` Gift card code. ### GiftCardChangeResultSuccess ### type value: `"success"` Indicates that the gift card change was applied successfully. ### GiftCardChangeResultError ### type value: `"error"` Indicates that the gift card change failed. ### message value: `string` A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer. ## Related - [StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) - [CheckoutApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/checkoutapi) - [OrderStatusApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/orderstatusapi) - [CartLineDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) - [PickupPointsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuppointsapi) - [PickupLocationsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuplocationsapi) - [ShippingMethodDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/shippingmethoddetailsapi) - [ExtensionPoints](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensionpoints)