# cartDeliveryAddressesAdd - storefront - MUTATION Version: 2025-07 ## Description Adds delivery addresses to the cart. ### Access Scopes ## Arguments * [addresses](/docs/api/storefront/2025-07/input-objects/CartSelectableAddressInput): CartSelectableAddressInput! - A list of delivery addresses to add to the cart. The input must not contain more than `250` values. * [cartId](/docs/api/storefront/2025-07/scalars/ID): ID! - The ID of the cart. ## Returns * [cart](/docs/api/storefront/2025-07/objects/Cart): Cart The updated cart. * [userErrors](/docs/api/storefront/2025-07/objects/CartUserError): CartUserError! The list of errors that occurred from executing the mutation. * [warnings](/docs/api/storefront/2025-07/objects/CartWarning): CartWarning! A list of warnings that occurred during the mutation. ## Examples ### Adds a delivery address to a cart Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2025-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"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 } } } } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Cart/c1-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2\",\n \"addresses\": [\n {\n \"selected\": true,\n \"address\": {\n \"deliveryAddress\": {\n \"address1\": \"131 Greene Street\",\n \"city\": \"New York\",\n \"provinceCode\": \"NY\",\n \"countryCode\": \"US\",\n \"zip\": \"10012\"\n }\n }\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Storefront({\n domain: 'your-development-store.myshopify.com',\n storefrontAccessToken,\n});\nconst data = await client.query({\n data: {\n \"query\": `mutation CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) {\n cartDeliveryAddressesAdd(cartId: $id, addresses: $addresses) {\n userErrors {\n message\n code\n field\n }\n warnings {\n message\n code\n target\n }\n cart {\n id\n delivery {\n addresses {\n id\n selected\n oneTimeUse\n address {\n ... on CartDeliveryAddress {\n firstName\n lastName\n company\n address1\n address2\n city\n provinceCode\n zip\n countryCode\n }\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Cart/c1-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2\",\n \"addresses\": [\n {\n \"selected\": true,\n \"address\": {\n \"deliveryAddress\": {\n \"address1\": \"131 Greene Street\",\n \"city\": \"New York\",\n \"provinceCode\": \"NY\",\n \"countryCode\": \"US\",\n \"zip\": \"10012\"\n }\n }\n }\n ]\n },\n },\n});\n" Ruby example: null Remix example: "const { storefront } = await unauthenticated.storefront(\n 'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n `#graphql\n mutation CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) {\n cartDeliveryAddressesAdd(cartId: $id, addresses: $addresses) {\n userErrors {\n message\n code\n field\n }\n warnings {\n message\n code\n target\n }\n cart {\n id\n delivery {\n addresses {\n id\n selected\n oneTimeUse\n address {\n ... on CartDeliveryAddress {\n firstName\n lastName\n company\n address1\n address2\n city\n provinceCode\n zip\n countryCode\n }\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Cart/c1-145e58da76bbee55b288ea50b81810d3?key=0068c4788cbb29555c10c3acc3b2ffc2\",\n \"addresses\": [\n {\n \"selected\": true,\n \"address\": {\n \"deliveryAddress\": {\n \"address1\": \"131 Greene Street\",\n \"city\": \"New York\",\n \"provinceCode\": \"NY\",\n \"countryCode\": \"US\",\n \"zip\": \"10012\"\n }\n }\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation CartDeliveryAddressesAdd($id: ID!, $addresses: [CartSelectableAddressInput!]!) {\n cartDeliveryAddressesAdd(cartId: $id, addresses: $addresses) {\n userErrors {\n message\n code\n field\n }\n warnings {\n message\n code\n target\n }\n cart {\n id\n delivery {\n addresses {\n id\n selected\n oneTimeUse\n address {\n ... on CartDeliveryAddress {\n firstName\n lastName\n company\n address1\n address2\n city\n provinceCode\n zip\n countryCode\n }\n }\n }\n }\n }\n }\n}" #### Graphql Input { "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" } } } ] } #### Graphql Response { "data": { "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" } } ] } } } }, "extensions": { "cart": { "serialized": { "c1-145e58da76bbee55b288ea50b81810d3": "eNq1U0GL20YUlmxn4yh7cH0KPplt6GHBYWZkydJ11xp7tba8K3kkWxTKzEiqs5Zlra21vTrm0EPpKeQXpIdCCqX0VNKeCoUmUNpzoZf01J56XihUySlQcuxh3rw3733fm-_Bk97nsAXbSqhoAe2ojIWhojCkaSFVANOgBkEg1x798mK_8UnZic0TnmPgyGYaYn9tk_TaXsD-AMV4Cu2t4-KBk9vxqZzSQJ7CqRvY7sRf0Tjwxj3z2JqkOV1sN1NijsL4ZOMSPLByNyWJkQ-QnQ8APCNdG9BxfDUFu-tzT09Gxq5vTwoebGYeHgKem7LX08H4gu98A1Nv4p6eE-VyDIbIxvOc913Tz31z3D26tCZHI2b4wMauS0lKCXbnIfFJcOH3Rt6ua0FjM03SZLzAkPVn1Erc3JLTBZ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