Update a product discount

POST https://api.tamio.com/v2/discounts/product-discount/update/{uuid}

Updates an existing product discount. The discount condition cannot be changed (e.g., a coupon discount cannot be changed to an automatic discount).

Path Parameters

uuid string*

Body Parameters

uuid string*
label string*
condition string
all_ordersitem_subtotalitem_quantitycouponvouchers
applies_to string*
selected_productsselected_categoriesall_products
currency string*
amount_off integer*
percent_off number*
shipping_percent_off number*
shipping_amount_off integer*
active boolean
coupon string
coupon_max_redemptions integer
block_affiliates boolean
voucher_method string
autogeneratedlist
number_of_vouchers integer
voucher_prefix string
vouchers array of string
rule_amount integer
order_condition string
order_subtotalorder_shippingorder_quantity
expiry_date string
subscription_discount_duration string
onceforeverrepeating
number_of_months integer
duration integer
products array of string
categories object
destinations array of string
payments array of string

Responses

200 Product discount updated successfully

Product discount updated successfully

status integer
discount Discount
400 Validation or business-logic error. Possible `error_code` values:
401 Unauthorized – invalid or missing Bearer token
/discounts/product-discount/update/{uuid}
1const response = await fetch("https://api.tamio.com/v2/discounts/product-discount/update/{uuid}", {
2 method: "POST",
3 headers: {
4 "Authorization": "Bearer YOUR_API_KEY",
5 "Content-Type": "application/json"
6 },
7 body: JSON.stringify({
8 // ... request body
9 })
10});
11const data = await response.json();
Responses
{
  "status": 200,
  "discount": {
    "id": "string",
    "object": "discount",
    "label": "Summer Sale 10% Off",
    "currency": "EUR",
    "percent_off": 10,
    "amount_off": 0,
    "shipping_percent_off": 0,
    "shipping_amount_off": 0,
    "active": true,
    "type": "product_discount",
    "condition": "coupon",
    "applies_to": "all_products",
    "rule_amount": null,
    "order_condition": "order_subtotal",
    "block_affiliates": false,
    "destinations": [
      "worldwide"
    ],
    "payments": [
      "all"
    ],
    "expiry_date": 0,
    "subscription_discount_duration": "once",
    "number_of_months": 0,
    "domain": 0,
    "customer": "string",
    "products": [],
    "categories": {},
    "coupon": "SUMMER10",
    "coupon_max_redemptions": 100,
    "coupon_times_redeemed": 45,
    "vouchers": [],
    "voucher_method": "string",
    "voucher_prefix": "string",
    "number_of_vouchers": 0,
    "created_at": 1700000000
  }
}