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

# updateCartSellerPromotionsWorkflow

> Apply, remove, or replace promotion codes on a cart with seller-scoped adjustments.

Seller-aware variant of Medusa's `updateCartPromotionsWorkflow`. Computes promotion actions for the requested codes, then prepares line-item and shipping-method adjustments so each promotion only discounts the owning seller's items, before creating/removing adjustments and syncing the cart's applied promotions. Optionally refreshes the payment collection. Triggered by `POST /store/carts/:id/promotions`.

## Usage

```ts theme={null}
import { updateCartSellerPromotionsWorkflow } from "@mercurjs/core/workflows"

await updateCartSellerPromotionsWorkflow(container).run({
  input: {
    cart_id: "cart_123",
    promo_codes: ["SUMMER10"],
    action: "add",
  },
})
```

## Input

<ParamField body="cart_id" type="string" required>The cart to update promotions on.</ParamField>
<ParamField body="promo_codes" type="string[]">Promotion codes to apply; defaults to `[]`.</ParamField>
<ParamField body="action" type="string">One of `add`, `remove`, `replace`; defaults to `add`.</ParamField>
<ParamField body="cart" type="object">Preloaded cart data; skips the internal cart fetch when provided.</ParamField>
<ParamField body="force_refresh_payment_collection" type="boolean">Refresh the cart's payment collection after adjustments change.</ParamField>

## Result

<ResponseField name="result" type="void">No return value; the cart's adjustments and applied promotions are updated as a side effect.</ResponseField>

## Hooks

* `validate` — runs after the cart is loaded with `{ input, cart }`.

```ts theme={null}
updateCartSellerPromotionsWorkflow.hooks.validate(async ({ input, cart }) => {
  // throw to reject the promotion change
})
```
