Anchor to section titled 'undefined'

cartDeliveryAddressesAdd
mutation

Adds delivery addresses to the cart.


A list of delivery addresses to add to the cart.

The input must not contain more than 250 values.

Anchor to cartId
cartId
required

The ID of the cart.


Was this section helpful?

The list of errors that occurred from executing the mutation.

A list of warnings that occurred during the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation cartDeliveryAddressesAdd($addresses: [CartSelectableAddressInput!]!, $cartId: ID!) {
cartDeliveryAddressesAdd(addresses: $addresses, cartId: $cartId) {
cart {
# Cart fields
}
userErrors {
field
message
}
warnings {
# CartWarning fields
}
}
}
Hide code
Input
Copy
{
"addresses": [
{
"address": {
"copyFromCustomerAddressId": "gid://shopify/<objectName>/10079785100",
"deliveryAddress": {
"address1": "<your-address1>",
"address2": "<your-address2>",
"city": "<your-city>",
"company": "<your-company>",
"countryCode": "AC",
"firstName": "<your-firstName>",
"lastName": "<your-lastName>",
"phone": "<your-phone>",
"provinceCode": "<your-provinceCode>",
"zip": "<your-zip>"
}
},
"oneTimeUse": true,
"selected": true,
"validationStrategy": "COUNTRY_CODE_ONLY"
}
],
"cartId": "gid://shopify/<objectName>/10079785100"
input CartSelectableAddressInput {
address: CartAddressInput!
oneTimeUse: Boolean
selected: Boolean
validationStrategy: DeliveryAddressValidationStrategy
}

input CartAddressInput {
copyFromCustomerAddressId: ID
deliveryAddress: CartDeliveryAddressInput
}