Anchor to section titled 'undefined'

cartGiftCardCodesUpdate
mutation

Updates the gift card codes applied to the cart.


Anchor to cartId
cartId
required

The ID of the cart.

The case-insensitive gift card codes.

The input must not contain more than 250 values.


Was this section helpful?

The updated cart.

The list of errors that occurred from executing the mutation.

A list of warnings that occurred during the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation cartGiftCardCodesUpdate($cartId: ID!, $giftCardCodes: [String!]!) {
  cartGiftCardCodesUpdate(cartId: $cartId, giftCardCodes: $giftCardCodes) {
    cart {
      # Cart fields
    }
    userErrors {
      field
      message
    }
    warnings {
      # CartWarning fields
    }
  }
}
Hide code
Input
Copy
{
  "cartId": "gid://shopify/<objectName>/10079785100",
  "giftCardCodes": [
    "<your-giftCardCodes>"
  ]
}