--- title: cartDeliveryAddressesReplace - Storefront API description: Replaces delivery addresses on the cart. api_version: 2025-10 api_name: storefront type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesReplace md: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesReplace.md --- # cart​Delivery​Addresses​Replace mutation Replaces delivery addresses on the cart. ## Arguments * addresses [\[Cart​Selectable​Address​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartSelectableAddressInput) required A list of delivery addresses to replace on 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​Replace​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 * ### cartDeliveryAddressesReplace reference ## Mutation Reference ```graphql mutation cartDeliveryAddressesReplace($cartId: ID!, $addresses: [CartSelectableAddressInput!]!) { cartDeliveryAddressesReplace(cartId: $cartId, addresses: $addresses) { cart { # Cart fields } userErrors { field message } warnings { # CartWarning fields } } } ``` ## Input ```json { "cartId": "gid://shopify//10079785100", "addresses": [ { "address": { "deliveryAddress": {}, "copyFromCustomerAddressId": "gid://shopify//10079785100" }, "selected": true, "oneTimeUse": true, "validationStrategy": "COUNTRY_CODE_ONLY" } ] } ``` ##### Variables ``` { "cartId": "gid://shopify//10079785100", "addresses": [ { "address": { "deliveryAddress": {}, "copyFromCustomerAddressId": "gid://shopify//10079785100" }, "selected": true, "oneTimeUse": true, "validationStrategy": "COUNTRY_CODE_ONLY" } ] } ``` ##### Schema ``` input CartSelectableAddressInput { address: CartAddressInput! selected: Boolean oneTimeUse: Boolean validationStrategy: DeliveryAddressValidationStrategy } input CartAddressInput { deliveryAddress: CartDeliveryAddressInput copyFromCustomerAddressId: ID } ```