> Documentation index: https://www.xekta.com/llms.txt

# cart_set_shipping

> Set the delivery address and shipping option for a cart from a shop that ships.

Only for shops that ship. It returns the shipping options for the address with their fees and latest delivery dates.

| | |
| - | - |
| Type | Write: changes a cart or an order |
| Needs a cart the buyer approved | No |
| Moves money | No |

**Tool description (what the assistant sees)**

```text
Sets where a cart from a shop that ships goes: a delivery address (or saved_home: true), the recipient, and the shipping option. Returns the options for that address with their fees and latest delivery dates, the selected one, and the items, shipping, tax and total. option_code pickup picks collecting at the shop where the shop allows it, with no address. PO boxes, military addresses, states the shop does not ship to and addresses outside the US are refused with the field to fix. Any change clears the buyer's approval of the cart. Nothing is reserved or charged.
```

## Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| `cart_id` | `uuid` | Yes | The cart. |
| `address` | `object` | No | Where the shop ships the order: `line1`, `city`, `state` and `zip`, with an optional `line2`. Leave out with `saved_home: true`, or to change only the option on a cart that already has an address. |
| `saved_home` | `boolean` | No | `true` ships to the buyer's saved home address. Do not send `address` with it. |
| `recipient` | `object` | No | Who receives the order: `name` and `phone`. Leave out when it is the buyer; their name and verified phone are used. |
| `option_code` | `string` | No | `standard`, `express`, `same_day` or `pickup`. Left out: the cheapest option for this address. `pickup` means the buyer collects at the shop, only where the shop allows it, and needs no address. |

## What to call next

Tell the buyer the shipping fee and the latest delivery date, then [`cart_approve`](https://www.xekta.com/docs/tools/cart-approve.md).
