# checkoutShippingAddressUpdateV2 - storefront - MUTATION
Version: 2024-04

## Description
Updates the shipping address of an existing checkout.

### Access Scopes
`unauthenticated_write_checkouts` access scope.


## Arguments
* [checkoutId](/docs/api/storefront/2024-04/scalars/ID): ID! - The ID of the checkout.
* [shippingAddress](/docs/api/storefront/2024-04/input-objects/MailingAddressInput): MailingAddressInput! - The shipping address to where the line items will be shipped.


## Returns
* [checkout](/docs/api/storefront/2024-04/objects/Checkout): Checkout The updated checkout object.
* [checkoutUserErrors](/docs/api/storefront/2024-04/objects/CheckoutUserError): CheckoutUserError! The list of errors that occurred from executing the mutation.
* [userErrors](/docs/api/storefront/2024-04/objects/UserError): UserError! The list of errors that occurred from executing the mutation.


## Examples
### Update the shipping address of an existing checkout.
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/2024-04/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"mutation updateShippingAddress($checkoutId: ID!, $shippingAddress: MailingAddressInput!) { checkoutShippingAddressUpdateV2(checkoutId: $checkoutId, shippingAddress: $shippingAddress) { checkout { shippingAddress { address1 address2 city company country firstName lastName province zip } } userErrors { field message } checkoutUserErrors { field message code } } }\"\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: `mutation updateShippingAddress($checkoutId: ID!, $shippingAddress: MailingAddressInput!) {\n    checkoutShippingAddressUpdateV2(checkoutId: $checkoutId, shippingAddress: $shippingAddress) {\n      checkout {\n        shippingAddress {\n          address1\n          address2\n          city\n          company\n          country\n          firstName\n          lastName\n          province\n          zip\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n      checkoutUserErrors {\n        field\n        message\n        code\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 updateShippingAddress($checkoutId: ID!, $shippingAddress: MailingAddressInput!) {\n    checkoutShippingAddressUpdateV2(checkoutId: $checkoutId, shippingAddress: $shippingAddress) {\n      checkout {\n        shippingAddress {\n          address1\n          address2\n          city\n          company\n          country\n          firstName\n          lastName\n          province\n          zip\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n      checkoutUserErrors {\n        field\n        message\n        code\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation updateShippingAddress($checkoutId: ID!, $shippingAddress: MailingAddressInput!) {\n  checkoutShippingAddressUpdateV2(checkoutId: $checkoutId, shippingAddress: $shippingAddress) {\n    checkout {\n      shippingAddress {\n        address1\n        address2\n        city\n        company\n        country\n        firstName\n        lastName\n        province\n        zip\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n    checkoutUserErrors {\n      field\n      message\n      code\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "checkoutShippingAddressUpdateV2": {
      "checkout": {
        "shippingAddress": {
          "address1": "204 rue de l'Hopital",
          "address2": "#204",
          "city": "Montreal",
          "company": "Shopify",
          "country": "Canada",
          "firstName": "John",
          "lastName": "Smith",
          "province": "Quebec",
          "zip": "G1Q1Q9"
        }
      },
      "userErrors": [],
      "checkoutUserErrors": []
    }
  }
}