Skip to content

Create a Coupon

Endpoint: https://api.youcan.shop/coupons

Method: POST

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

[201] Created

json
 {
    "id": "5913f1f7-f14d-4046-8a7d-701ab8189f11",
    "code": "code0332",
    "description": "coupoun 02 from api",
    "value": 5,
    "type": 1,
    "type_text": "percentage",
    "start_date": 1619308800,
    "end_date": 1619395200,
    "max_usage": 55,
    "status": "Expired"
}