---
title: cartDeliveryAddressesUpdate - Storefront API
description: >
  Updates one or more delivery addresses on a
  [`Cart`](/docs/api/storefront/2025-07/objects/Cart). Each address can be
  modified to change its details, set it as the pre-selected address for
  checkout, or mark it for one-time use so it isn't saved to the customer's
  account.
api_version: 2025-07
api_name: storefront
type: mutation
api_type: graphql
source_url:
  html: >-
    https://shopify.dev/docs/api/storefront/2025-07/mutations/cartDeliveryAddressesUpdate
  md: >-
    https://shopify.dev/docs/api/storefront/2025-07/mutations/cartDeliveryAddressesUpdate.md
---

# cart​Delivery​Addresses​Update

mutation

Updates one or more delivery addresses on a [`Cart`](https://shopify.dev/docs/api/storefront/2025-07/objects/Cart). Each address can be modified to change its details, set it as the pre-selected address for checkout, or mark it for one-time use so it isn't saved to the customer's account.

## Arguments

* addresses

  [\[Cart​Selectable​Address​Update​Input!\]!](https://shopify.dev/docs/api/storefront/2025-07/input-objects/CartSelectableAddressUpdateInput)

  required

  The delivery addresses to update.

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

* cart​Id

  [ID!](https://shopify.dev/docs/api/storefront/2025-07/scalars/ID)

  required

  The ID of the cart.

***

## Cart​Delivery​Addresses​Update​Payload returns

* cart

  [Cart](https://shopify.dev/docs/api/storefront/2025-07/objects/Cart)

  The updated cart.

* user​Errors

  [\[Cart​User​Error!\]!](https://shopify.dev/docs/api/storefront/2025-07/objects/CartUserError)

  non-null

  The list of errors that occurred from executing the mutation.

* warnings

  [\[Cart​Warning!\]!](https://shopify.dev/docs/api/storefront/2025-07/objects/CartWarning)

  non-null

  A list of warnings that occurred during the mutation.

***

## Examples

* ### Updates a delivery address on a cart

  #### Description

  Updates a delivery address on a cart

  #### Query

  ```graphql
  mutation CartDeliveryAddressesUpdate($id: ID!, $addresses: [CartSelectableAddressUpdateInput!]!) {
    cartDeliveryAddressesUpdate(cartId: $id, addresses: $addresses) {
      userErrors {
        message
        code
        field
      }
      warnings {
        message
        code
        target
      }
      cart {
        id
        delivery {
          addresses {
            id
            selected
            oneTimeUse
            address {
              ... on CartDeliveryAddress {
                firstName
                lastName
                company
                address1
                address2
                city
                provinceCode
                zip
                countryCode
              }
            }
          }
        }
      }
    }
  }
  ```

  #### Variables

  ```json
  {
    "id": "gid://shopify/Cart/c1-36e8477271a658e2ec3ebd1bf2506686?key=ba72b8f664bfb53a09522a0e789123de",
    "addresses": [
      {
        "id": "gid://shopify/CartSelectableAddress/delivery-address-1",
        "selected": true,
        "address": {
          "copyFromCustomerAddressId": "gid://shopify/MailingAddress/544365967?model_name=CustomerAddress"
        }
      }
    ]
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/api/2025-07/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
  -d '{
  "query": "mutation CartDeliveryAddressesUpdate($id: ID!, $addresses: [CartSelectableAddressUpdateInput!]!) { cartDeliveryAddressesUpdate(cartId: $id, addresses: $addresses) { userErrors { message code field } warnings { message code target } cart { id delivery { addresses { id selected oneTimeUse address { ... on CartDeliveryAddress { firstName lastName company address1 address2 city provinceCode zip countryCode } } } } } } }",
   "variables": {
      "id": "gid://shopify/Cart/c1-36e8477271a658e2ec3ebd1bf2506686?key=ba72b8f664bfb53a09522a0e789123de",
      "addresses": [
        {
          "id": "gid://shopify/CartSelectableAddress/delivery-address-1",
          "selected": true,
          "address": {
            "copyFromCustomerAddressId": "gid://shopify/MailingAddress/544365967?model_name=CustomerAddress"
          }
        }
      ]
    }
  }'
  ```

  #### React Router

  ```javascript
  import { unauthenticated } from "../shopify.server";

  export const loader = async () => {
    const { storefront } = await unauthenticated.storefront(
      'your-development-store.myshopify.com'
    );
    const response = await storefront.graphql(
      `#graphql
    mutation CartDeliveryAddressesUpdate($id: ID!, $addresses: [CartSelectableAddressUpdateInput!]!) {
      cartDeliveryAddressesUpdate(cartId: $id, addresses: $addresses) {
        userErrors {
          message
          code
          field
        }
        warnings {
          message
          code
          target
        }
        cart {
          id
          delivery {
            addresses {
              id
              selected
              oneTimeUse
              address {
                ... on CartDeliveryAddress {
                  firstName
                  lastName
                  company
                  address1
                  address2
                  city
                  provinceCode
                  zip
                  countryCode
                }
              }
            }
          }
        }
      }
    }`,
    {
      variables: {
          "id": "gid://shopify/Cart/c1-36e8477271a658e2ec3ebd1bf2506686?key=ba72b8f664bfb53a09522a0e789123de",
          "addresses": [
              {
                  "id": "gid://shopify/CartSelectableAddress/delivery-address-1",
                  "selected": true,
                  "address": {
                      "copyFromCustomerAddressId": "gid://shopify/MailingAddress/544365967?model_name=CustomerAddress"
                  }
              }
          ]
      },
    },
    );
    const json = await response.json();
    return json.data;
  }
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Storefront({
    domain: 'your-development-store.myshopify.com',
    storefrontAccessToken,
  });
  const data = await client.query({
    data: {
      "query": `mutation CartDeliveryAddressesUpdate($id: ID!, $addresses: [CartSelectableAddressUpdateInput!]!) {
        cartDeliveryAddressesUpdate(cartId: $id, addresses: $addresses) {
          userErrors {
            message
            code
            field
          }
          warnings {
            message
            code
            target
          }
          cart {
            id
            delivery {
              addresses {
                id
                selected
                oneTimeUse
                address {
                  ... on CartDeliveryAddress {
                    firstName
                    lastName
                    company
                    address1
                    address2
                    city
                    provinceCode
                    zip
                    countryCode
                  }
                }
              }
            }
          }
        }
      }`,
      "variables": {
          "id": "gid://shopify/Cart/c1-36e8477271a658e2ec3ebd1bf2506686?key=ba72b8f664bfb53a09522a0e789123de",
          "addresses": [
              {
                  "id": "gid://shopify/CartSelectableAddress/delivery-address-1",
                  "selected": true,
                  "address": {
                      "copyFromCustomerAddressId": "gid://shopify/MailingAddress/544365967?model_name=CustomerAddress"
                  }
              }
          ]
      },
    },
  });
  ```

  #### Response

  ```json
  {
    "cartDeliveryAddressesUpdate": {
      "userErrors": [],
      "warnings": [],
      "cart": {
        "id": "gid://shopify/Cart/c1-36e8477271a658e2ec3ebd1bf2506686?key=ba72b8f664bfb53a09522a0e789123de",
        "delivery": {
          "addresses": [
            {
              "id": "gid://shopify/CartSelectableAddress/delivery-address-1",
              "selected": true,
              "oneTimeUse": true,
              "address": {
                "firstName": "Bob",
                "lastName": "Bobsen",
                "company": null,
                "address1": "123 Amoebobacterieae St",
                "address2": null,
                "city": "Ottawa",
                "provinceCode": "ON",
                "zip": "K2P0V6",
                "countryCode": "CA"
              }
            }
          ]
        }
      }
    }
  }
  ```

* ### cartDeliveryAddressesUpdate reference
