---
title: cartGiftCardCodesUpdate - Storefront API
description: >-
  Updates the gift card codes applied to the cart. Unlike
  [`cartGiftCardCodesAdd`](/docs/api/storefront/2026-10/mutations/cartGiftCardCodesAdd),

  which adds codes without replacing existing ones, this mutation sets the gift

  card codes for the cart. Gift card codes are case-insensitive.
api_version: 2026-10
source_url:
  html: >-
    https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesUpdate
  md: >-
    https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesUpdate.md
api_name: storefront
api_type: graphql
type: mutation
---

# cart​Gift​Card​Codes​Update

mutation

Updates the gift card codes applied to the cart. Unlike [`cartGiftCardCodesAdd`](https://shopify.dev/docs/api/storefront/2026-10/mutations/cartGiftCardCodesAdd), which adds codes without replacing existing ones, this mutation sets the gift card codes for the cart. Gift card codes are case-insensitive.

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

  The input must not contain more than `250` values.

***

## Cart​Gift​Card​Codes​Update​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

* ### cartGiftCardCodesUpdate reference
