---
title: cartDeliveryAddressesAdd - Storefront API
description: |-
  Adds delivery addresses to a
  [`Cart`](/docs/api/storefront/2026-04/objects/Cart). A cart
  can have up to 20 delivery addresses. One address can be marked as selected
  for checkout, and addresses can optionally be marked as one-time use so they
  aren't saved to the customer's account.
api_version: 2026-04
source_url:
  html: >-
    https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd
  md: >-
    https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd.md
api_name: storefront
api_type: graphql
type: mutation
---

# cart​Delivery​Addresses​Add

mutation

Adds delivery addresses to a [`Cart`](https://shopify.dev/docs/api/storefront/2026-04/objects/Cart). A cart can have up to 20 delivery addresses. One address can be marked as selected for checkout, and addresses can optionally be marked as one-time use so they aren't saved to the customer's account.

## Arguments

* addresses

  [\[Cart​Selectable​Address​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartSelectableAddressInput)

  required

  A list of delivery addresses to add to the cart.

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

* cart​Id

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

  required

  The ID of the cart.

***

## Cart​Delivery​Addresses​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

* ### Adds a delivery address to a cart

  #### Description

  Add a delivery address to a cart

  #### Query

  ```graphql
  mutation CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) {
    cartDeliveryAddressesAdd(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-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2",
    "addresses": [
      {
        "selected": true,
        "address": {
          "deliveryAddress": {
            "address1": "131 Greene Street",
            "city": "New York",
            "provinceCode": "NY",
            "countryCode": "US",
            "zip": "10012"
          }
        }
      }
    ]
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/api/2026-04/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
  -d '{
  "query": "mutation CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) { cartDeliveryAddressesAdd(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-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2",
      "addresses": [
        {
          "selected": true,
          "address": {
            "deliveryAddress": {
              "address1": "131 Greene Street",
              "city": "New York",
              "provinceCode": "NY",
              "countryCode": "US",
              "zip": "10012"
            }
          }
        }
      ]
    }
  }'
  ```

  #### 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 CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) {
      cartDeliveryAddressesAdd(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-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2",
          "addresses": [
              {
                  "selected": true,
                  "address": {
                      "deliveryAddress": {
                          "address1": "131 Greene Street",
                          "city": "New York",
                          "provinceCode": "NY",
                          "countryCode": "US",
                          "zip": "10012"
                      }
                  }
              }
          ]
      },
    },
    );
    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 CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) {
        cartDeliveryAddressesAdd(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-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2",
          "addresses": [
              {
                  "selected": true,
                  "address": {
                      "deliveryAddress": {
                          "address1": "131 Greene Street",
                          "city": "New York",
                          "provinceCode": "NY",
                          "countryCode": "US",
                          "zip": "10012"
                      }
                  }
              }
          ]
      },
    },
  });
  ```

  #### Response

  ```json
  {
    "cartDeliveryAddressesAdd": {
      "userErrors": [],
      "warnings": [],
      "cart": {
        "id": "gid://shopify/Cart/c1-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2",
        "delivery": {
          "addresses": [
            {
              "id": "gid://shopify/CartSelectableAddress/59168936-5627-4056-b460-9c2ca1dff094",
              "selected": true,
              "oneTimeUse": false,
              "address": {
                "firstName": null,
                "lastName": "",
                "company": null,
                "address1": "131 Greene Street",
                "address2": null,
                "city": "New York",
                "provinceCode": "NY",
                "zip": "10012",
                "countryCode": "US"
              }
            }
          ]
        }
      }
    }
  }
  ```

* ### cartDeliveryAddressesAdd reference
