Apply Discount Coupon

Method : POST

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

API Endpoint : /v2/applycoupon

All requests are POST and sent to https://api.braincert.com/v2/applycoupon You will retrieve class discount applied or not.

Post parameters

ParameterTypeDescriptionExample
apikeyrequiredYour api keystring
class_idrequiredClass idinteger
discount_coderequiredClass discount codestring
formatoptionalResponse data format- xml for XML response, default JSON response

Response XML Example

https://api.braincert.com/v2/applycoupon

Success Response

<rsp error="0">
  <method>applycoupon</method>
  <discount_id>88</discount_id>
  <discount_value>2</discount_value>
  <discount_type>percentage</discount_type>
</rsp>

Error Response

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

Response JSON Example

https://api.braincert.com/v2/applycoupon

Success Response

[{
   "error":"0",
   "discount_id":"88"
   "discount_value":"2"
   "discount_type":"percentage"
}]

Error Response


[{
   "status":"error",
   "error":"error message"
}]