Create Coupon

HTTP Request

POST https://commerce.zoho.com/store/api/v1/coupons 

 

OAuth Scope

ZohoCommerce.coupons.CREATE

 

Parameters

ParameterDescription
coupon_code*string: Code for the coupon.
coupon_name*string: Name of the coupon.
activation_time*boolean: if true, guest user cannot apply this coupon
minimum_order_value*string: Order total must be greater than this amount in order to apply this coupon.
discount_type*string: Type of coupon, either "Flat" or "Percentage".
discount_value*string: Value of the coupon.
max_redemption_count*integer: Coupon limit for store.
max_redemption_count_per_user*integer: Coupon limit per customer.
eligible_productsjson: Coupon applicable for the mentioned products.
eligible_shipping_zonesjson: Coupon applicable for the mentioned shipping zones.
eligible_customersjson: Coupon applicable for the mentioned customers.

 

Request Example

Copiedcurl -i -L -X POST
-H 'Content-Type: application/json'
-H "Authorization:Zoho-oauthtoken ***"
-H "X-com-zoho-store-organizationid:58927961"
-d
'{
"coupon_code":"3JTRJYKUS9GO",
"coupon_name":"WINTER SALE",
"activation_time":"2019-12-18 04:29",
"expiry_time":"2019-12-31 10:30",
"restrict_for_guest_user":true,
"minimum_order_value":"10",
"discount_value":"100",
"max_redemption_count":25,
"max_redemption_count_per_user":10,
"eligible_products":{
"products": [
{
"product_id":"1706707000000068515"
},
{
"product_id":"1706707000000068543"
}
]
},
"eligible_shipping_zones":{},
"eligible_customers":{},
"discount_type":"flat"
}'
'https://commerce.zoho.com/store/api/v1/coupon

Success Response

Copied{
"code": 0,
"message": "success",
"coupon": {
"coupon_id": "1706707000000544002",
"couponset_id": "1706707000000544002",
"restrict_for_guest_user": true,
"coupon_name": "WINTER SALE",
"coupon_code": "3JTRJYKUS9GO",
"coupon_codes": [
{
"coupon_id": "1706707000000544002",
"coupon_code": "3JTRJYKUS9GO"
}
],
"is_active": true,
"status": "active",
"discount_type": "flat",
"discount_type_formatted": "Flat",
"discount_value": 100,
"minimum_order_value": 10,
"max_redemption_count": 25,
"max_redemption_count_per_user": 10,
"activation_time": "2019-12-18 04:29",
"activation_time_formatted": "18 Dec 2019 04:29 AM",
"expiry_time": "2019-12-31 10:30",
"expiry_time_formatted": "31 Dec 2019 10:30 AM",
"eligible_products": {
"collections": [],
"categories": [],
"products": [
{
"product_id": "1706707000000068515",
"name": "Green Dress with Lace"
},
{
"product_id": "1706707000000068543",
"name": "High Neck Bodycon Dress"
}
]
},
"buy_products": {},
"get_products": {},
"eligible_customers": {
"customers": []
},
"eligible_shipping_zones": {
"shipping_zones": []
}
}
}

Failure Response

Copied{
"code": 1130308,
"message": "Expiry time should be greater than activation time and current time"
}
Use this API to create a coupon for a store in Zoho Commerce.