Skip to main content

cartGiftCardCodesUpdateDefault

Creates a function that accepts an array of strings and adds the gift card codes to a cart

Anchor to options
options
required

CartGiftCardCodesUpdateFunction

export type = ( giftCardCodes: string[], optionalParams?: , ) => Promise<>;
Examples

JavaScript

import {cartGiftCardCodesUpdateDefault} from '@shopify/hydrogen';

const cartGiftCardCodes = cartGiftCardCodesUpdateDefault({
storefront,
getCartId,
});

const result = await cartGiftCardCodes(['GIFT_CARD_CODE_123']);
Was this page helpful?