---
title: "Update a cart rule"
method: PUT
path: "/marketing/cart-rules/{id}"
tags: ["Admin Marketing: Promotions"]
---

# Update a cart rule

`PUT /marketing/cart-rules/{id}`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/marketing/cart-rules/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/marketing/cart-rules/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Partial update — send only the fields you change. channels / customer_groups, when supplied, fully replace the current set.

## Path parameters

- `id` integer, required

## Request body

- object
  - `name` string
  - `description` string
  - `channels` integer[]
  - `customer_groups` integer[]
  - `coupon_type` 0 | 1
  - `use_auto_generation` 0 | 1
  - `coupon_code` string
  - `uses_per_coupon` integer
  - `usage_per_customer` integer
  - `condition_type` 1 | 2
  - `conditions` object[]
  - `action_type` 'by_percent' | 'by_fixed' | 'cart_fixed' | 'buy_x_get_y'
  - `discount_amount` number
  - `discount_quantity` integer
  - `discount_step` integer
  - `apply_to_shipping` 0 | 1
  - `free_shipping` 0 | 1
  - `end_other_rules` 0 | 1
  - `sort_order` integer
  - `starts_from` string, date-time
  - `ends_till` string, date-time
  - `status` 0 | 1

## Response `200`

Cart rule updated; returns the updated detail.

## Other responses

- `400`: Invalid input
- `404`: Cart rule not found.
- `422`: Validation failure.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
