--- title: cartGiftCardCodesAdd - Storefront API description: Adds gift card codes to the cart without replacing existing ones. api_version: 2025-10 api_name: storefront type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesAdd md: https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesAdd.md --- # cart​Gift​Card​Codes​Add mutation Adds gift card codes to the cart without replacing existing ones. ## Arguments * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required The ID of the cart. * gift​Card​Codes [\[String!\]!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required The case-insensitive gift card codes to add. The input must not contain more than `250` values. *** ## Cart​Gift​Card​Codes​Add​Payload returns * cart [Cart](https://shopify.dev/docs/api/storefront/latest/objects/Cart) The updated cart. * user​Errors [\[Cart​User​Error!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartUserError) non-null The list of errors that occurred from executing the mutation. * warnings [\[Cart​Warning!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartWarning) non-null A list of warnings that occurred during the mutation. *** ## Examples * ### cartGiftCardCodesAdd reference ## Mutation Reference ```graphql mutation cartGiftCardCodesAdd($cartId: ID!, $giftCardCodes: [String!]!) { cartGiftCardCodesAdd(cartId: $cartId, giftCardCodes: $giftCardCodes) { cart { # Cart fields } userErrors { field message } warnings { # CartWarning fields } } } ``` ## Input ```json { "cartId": "gid://shopify//10079785100", "giftCardCodes": [ "" ] } ``` ##### Variables ``` { "cartId": "gid://shopify//10079785100", "giftCardCodes": [ "" ] } ```