List Realtime Coupon Endpoints
GET
/realtimecoupons/list.json
The Real Time Discount API allows applications to generate a custom coupon code and its relative value.
An example of the answer to be provided is available here: File Example.
GET
/realtimecoupons/list.json
$storeden = new Storeden\Storeden($config);
$rtdiscount_list = $storeden->get('/realtimecoupons/list.json');
[
{
"id": "5d7954c616f46aa22f7b23c6",
"name": "Fixed Coupon",
"url": "https://cdn.storeden.net/coupon.json",
"instance": "569772b116f46aff081f4858"
},
...
]
POST
/realtimecoupons/realtimecoupon.json
Create a new endpoint that will be called by Storeden to validate a coupon code.
url required (string) | A valid endpoint url. Must be in https. |
name required (string) | Your real time coupon endpoint name |
$data = array();
$data['url'] = 'https://cdn.storeden.net/coupon.json';
$data['name'] = 'Custom Coupon Endpoint';
$storeden = new Storeden\Storeden($config);
$webhook_list = $storeden->post('/realtimecoupons/realtimecoupon.json', $data);
{
"id": "5d7954c616f46aa22f7b23c6",
"name": "Custom Coupon Endpoint",
"url": "https://cdn.storeden.net/coupon.json",
"instance": "569772b116f46aff081f4858"
}
DELETE
/realtimecoupons/realtimecoupon.json
id required (StoredenID) | Real Time Coupon Endpoint id you want to remove |
$data = array();
$data['id'] = '5d7954c616f46aa22f7b23c6';
$storeden = new Storeden\Storeden($config);
$webhook_list = $storeden->delete('/realtimecoupons/realtimecoupon.json', $data);
{
"ok": 1,
"err": null,
"errmsg": null,
"nRemoved": 1
}