> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# buy_set_substitution

> Set the out-of-stock preference for an item in a placed order

Sets what should happen if one item in a placed order turns out to be out of stock: substitute something similar, refund it, or have the shopper contact you.

<Note>Not advertised in `tools/list` by default — the [buy](/companies/mcp/tools/buy) tool covers this conversationally. Expert integrations can still call it by name.</Note>

## Parameters

| Parameter    | Type   | Required | Description                              |
| ------------ | ------ | -------- | ---------------------------------------- |
| `merchant`   | string | Yes      | Merchant slug (for example `doordash`)   |
| `order_id`   | string | Yes      | The order id from `buy_order_history`    |
| `item_msid`  | string | Yes      | The item msid from `buy_search_products` |
| `preference` | string | Yes      | One of `similar`, `refund`, or `contact` |

## Returns

A confirmation of the saved preference for that item, for example "Substitution set: if out of stock, refund". Failures return a short error message.

## Example

```json theme={null}
{ "name": "buy_set_substitution", "arguments": { "merchant": "doordash", "order_id": "ord_9f2k1", "item_msid": "msid_442", "preference": "refund" } }
```
