List Class Discount

Method : POST

Base URL : https://api.braincert.com

API Endpoint : /v2/listdiscount?apikey=YOUR_API_KEY_HERE

All requests are POST and sent to https://api.braincert.com/v2/listdiscount?apikey=YOUR_API_KEY_HERE You will retrieve results assuming you have added your appKey, and require parameter.

Request parameters

ParameterTypeDescriptionExample
class_idrequiredClass id10
formatoptionalResponse data formatxml for XML response, default JSON response
searchoptionalClass titlestring

Response XML Example

https://api.braincert.com/v2/listdiscount?apikey=WbMlO5sAx1fmV&format=xml

Success Response

<xml>
 <classid>528</classid>
  <discount>
   <discountid>14</discountid>
   <discount>10</discount>
   <discount_code>dfdfdf</discount_code>
   <discount_limit>0</discount_limit>  <discount_type>percentage</discount_type>
  <start_date>2014-05-27</start_date>
  <end_date>Unlimited</end_date>
 </discount>
</xml>

Error Response

<rsp status="error">
   <errors> error </errors>
</rsp>

Response JSON Example

https://api.braincert.com/v2/listdiscount?apikey=WbMlO5sAx1fmV

Success Response

[{
   "id":"37",
   "class_id":"598",
   "discount_code":"100code",
   "is_use_discount_code":"1",
   "discount_limit":"55",
   "is_no_limit":"0",
   "discount_type":"fixed_amount",
   "special_price":"100",
   "start_date":"2014-09-01 00:00:00",
   "end_date":"0000-00-00 00:00:00",
   "is_never_expire":"1"
}]

Error Response

[{
  "status":"error",
  "error":"Invalid API KEY"
}]