update_cart
Perform updates to a cart, including adding/removing/updating line items, buyer information, shipping details, discount codes, gift cards and notes in one consolidated call. Shipping options become available after adding items and delivery address. When creating a new cart, only addItems is required.
11,743verified stores declare the update_cart tool
57.9%of the verified stores we check
By store platform
Shopify 92%Jumpseller 3%Salla 2% others 3%
By release
Each store has its own status page. To find more, search the directory.
Input schema
inputSchema
{
"type": "object",
"properties": {
"note": {
"type": "string",
"description": "A note or special instructions for the cart. Optional - can ask if customer wants to add special instructions."
},
"cart_id": {
"type": "string",
"description": "Identifier for the cart being updated. If not provided, a new cart will be created."
},
"add_items": {
"type": "array",
"items": {
"type": "object",
"required": [
"product_variant_id",
"quantity"
],
"properties": {
"quantity": {
"type": "integer",
"minimum": 1
},
"product_variant_id": {
"type": "string"
}
}
},
"required": [
"items"
],
"description": "Items to add to the cart. Required when creating a new cart."
},
"update_items": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"quantity"
],
"properties": {
"id": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": 0
}
}
},
"required": [
"items"
],
"description": "Existing cart line items to update quantities for. Use quantity 0 to remove an item."
},
"buyer_identity": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email"
},
"phone": {
"type": "string"
},
"country_code": {
"type": "string",
"description": "ISO country code, used for regional pricing."
}
},
"description": "Information about the buyer including email, phone, and delivery address.",
"additionalProperties": false
},
"discount_codes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Discount or promo codes to apply to the cart. Only prompt if customer mentions having a discount code."
},
"gift_card_codes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Gift card codes to apply to the cart. Only prompt if customer mentions having a gift card."
},
"remove_line_ids": {
"type": "array",
"items": {
"type": "string"
},
"required": [
"items"
],
"description": "List of line item IDs to remove explicitly."
},
"delivery_addresses_to_add": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected": {
"type": "boolean",
"description": "Optional - should this address be selected for delivery (first address defaults true)."
},
"delivery_address": {
"type": "object",
"properties": {
"zip": {
"type": "string"
},
"city": {
"type": "string"
},
"phone": {
"type": "string"
},
"address1": {
"type": "string"
},
"address2": {
"type": "string"
},
"last_name": {
"type": "string"
},
"first_name": {
"type": "string"
},
"country_code": {
"type": "string",
"description": "ISO country code, used for regional pricing."
},
"province_code": {
"type": "string"
}
}
}
}
},
"description": "Information about the delivery addresses to add."
},
"selected_delivery_options": {
"type": "array",
"items": {
"type": "object",
"required": [
"group_id",
"option_handle"
],
"properties": {
"group_id": {
"type": "string",
"description": "The ID of the delivery group to select."
},
"option_handle": {
"type": "string",
"description": "The handle of the delivery option to select."
}
}
},
"description": "The delivery options to select for the cart."
},
"delivery_addresses_to_replace": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected": {
"type": "boolean",
"description": "Optional - should this address be selected for delivery (first address defaults true)."
},
"delivery_address": {
"type": "object",
"properties": {
"zip": {
"type": "string"
},
"city": {
"type": "string"
},
"phone": {
"type": "string"
},
"address1": {
"type": "string"
},
"address2": {
"type": "string"
},
"last_name": {
"type": "string"
},
"first_name": {
"type": "string"
},
"country_code": {
"type": "string",
"description": "ISO country code, used for regional pricing."
},
"province_code": {
"type": "string"
}
}
}
}
},
"description": "Delivery addresses to apply to the cart, replaces all existing cart delivery addresses. Removes all delivery addresses when empty."
}
},
"additionalProperties": false
}
