Coupons API

Current version: v1.1 beta

List all coupons

GET
/coupons/list.json
[
	{
		"uid": 49076,
		"code": "sYjvNtEqej7UyollX7Fv",
		"name": "Win from Guess a Number",
		"type": "1",
		"value": "50",
		"min_sum": 0,
		"stopDate": {
			"sec": 4132249199,
			"usec": 0
		},
		"active": 1,
		"unlimited": false,
		"count": 10,
		"startDate": {
			"sec": 1532383200,
			"usec": 0
		},
		"coupon_id": "525e8672be85f1ba37000003",
		"iso": {
			"startDate": "2018-07-24T00:00:00+0200",
			"stopDate": "2100-12-11T23:59:59+0100"
		}
	}
...
]
					

Get coupon details

Fetch single coupon details from coupon uid

GET
/coupons/coupon.json?uid={coupon-uid}
uid required (int) Unique uid of coupon
{
    "uid": 49076,
    "code": "sYjvNtEqej7UyollX7Fv",
    "name": "Win from Guess a Number",
    "type": "1",
    "value": "50",
    "min_sum": 0,
    "stopDate": {
        "sec": 4132249199,
        "usec": 0
    },
    "active": 1,
    "unlimited": false,
    "count": 10,
    "startDate": {
        "sec": 1532383200,
        "usec": 0
    },
    "rules": {
        "remove_shipping_country": "",
        "remove_shipping_state": "",
        "remove_shipping_ship": "",
        "brand": "NULL",
        "customattribute": {
            "583ff96d16f46a5b3bd6c44c": "",
            "58caa59b16f46a8723d0505d": ""
        },
        "tags": []
    },
    "coupon_id": "525e8672be85f1ba37000003",
    "iso": {
        "startDate": "2018-07-24T00:00:00+0200",
        "stopDate": "2100-12-11T23:59:59+0100"
    }
}
					

Create new coupon

POST
/coupons/coupon.json
code required (string) Coupon Code, must be unique on your e-commerce
name required (string) Coupon Name, useful to identify which coupon has been used by customers
type required (int) Coupon Type 1 = Percentage Discount 0 => Fixed amount discount
value required (float) Coupon amount
min_sum required (float) Min Checkout total to apply discount, Must be >= 0
active required (int) 1 = Discount Code active, 0 = Discount Code deactive
start_time required (timestamp) Validity Coupon Start Date
end_time required (timestamp) Validity Coupon End Date
unlimited required (int) 1 = Coupon usage unlimited, 0 = Coupon usage limited by "count" field
count required (int) Max coupon usage
rules[users_email] required (array|string) Email address(es) of users that can use coupon
{
    "coupon_code": "Coupon2018BlackFriday",
    "uid": 1227830,
    "unique_id": "5c366ae816f46a0912a92aa5",
    "endpoint": "https://connect.storeden.com/v1.1/coupons/coupon.json?uid=1227830"
}
					

Remove Coupon

Remove single coupon from availables coupon list

DELETE
/coupons/coupon.json
uid required (int) Unique uid of coupon
{
    "ok": 1,
    "n": 1,
    "err": null,
    "errmsg": null
}