updateCoupon
Update an existing coupon's discount rules, conditions, or status.
Import
import { updateCoupon } from '@evershop/evershop/promotion/services';
Syntax
updateCoupon(uuid: string, data: Partial<CouponData>, context?: Record<string, any>): Promise<CouponRow>
Parameters
uuid — The UUID of the coupon to update.
data — Coupon fields to update (all optional):
coupon— Coupon codestatus— Active status (0or1)discount_amount— Discount valuediscount_type— Discount typedescription,free_shipping,start_date,end_date, etc.
context (optional) — Context object passed to hooks.
Examples
import { updateCoupon } from '@evershop/evershop/promotion/services';
await updateCoupon('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
discount_amount: 15,
status: 1
});
See Also
- createCoupon — Create a coupon