Add Class Discount
Method : POST
Base URL : https://api.braincert.com
API Endpoint : /v2/addSpecials?apikey=YOUR_API_KEY_HERE
All requests are POST
and sent to https://api.braincert.com/v2/addSpecials?apikey=YOUR_API_KEY_HERE You will retrieve results assuming you have added your appKey, and require parameter.
Request parameters
Parameter | Type | Description | Example |
discount | required | Discount of class | 10 |
start_date | required | To Give Access for days of class | 2014-08-15 |
end_date | optional | Discount expires | 2014-08-15 |
discount_type | required | Discount type in class | 0 for fixed_amount, 1 for percentage |
discount_code | optional | Discount coupon code | Couponcode |
discount_limit | optional | How many times can this discount be used? | 20 |
format | optional | Response data format | xml for XML response, default JSON response |
Response XML Example
https://api.braincert.com/v2/addSpecials?apikey=WbMlO5sAx1fmV&format=xmlSuccess Response
<rsp status="ok">
<method>addDiscount</method>
<discount_id>12345</discount_id>
</rsp>
Error Response
<rsp status="error">
<method>addDiscount</method>
<message>error message</message >
</rsp>
Response JSON Example
https://api.braincert.com/v2/addSpecials?apikey=WbMlO5sAx1fmVSuccess Response
[{
"Status":"OK",
"method":"addDiscount",
"Discount id":40
}]
Error Response
[{
"status":"error",
"error":"Invalid API KEY"
}]