Skip to content

Update a Coupon

Endpoint: https://api.youcan.shop/coupons/{id}

Method: PUT

Required Scopes

  • edit-coupons

Parameters

Param NameParam TypeDescriptionRequired
codestringCode in alpha numericyes
descriptionstringDescriptionyes
valuefloatCoupon value in fixed price or percentageyes
typeintValue type 1: percentage, 2: Fixedyes
start_dateDatetimeStart date of coupon validityyes
end_dateDatetimeEnd date of coupon validityno
max_usageintHow many times the coupon can be usedno
product_idsstring[]List of product IDs the coupon is valid foryes

Response

[200] Ok

json
{
    "id": "2e62a766-af79-49b1-b57b-0a2fdbaeec65",
    "code": "code03323",
    "description": "coupoun 02 from api updated",
    "value": 5,
    "type": 1,
    "type_text": "percentage",
    "start_date": 1619308800,
    "end_date": 1619395200,
    "max_usage": 55,
    "status": "Expired"
}