API - Delete Coupon

Delete Coupon

This API is used to delete a coupon by specifying the coupon id.

 

API Details

 

Signature of API call

connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);

See details about invoking API in general

 

Parameter 1 - URI

couponService.do

 

Parameter 2 - UserName

Username of the site admin

 

Parameter 3 - Request Parameters

Name Value
dispatch deleteCoupon
xml true
id Coupon id

 

Response

Response on successfully deleting the coupon

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">
   <msgs>
      <msg>
         <code>0089</code>
         <value>
            <![CDATA[Deleted Successfully]]>
         </value>
      </msg>
   </msgs>
</response>

 

Code Snippet

/* Check API Call for detail */

Map<String, String> parameters = new HashMap<String, String>();
populateMapForCouponDelete(parameters);
String result = connection.invokeApi("couponService.do", "adminusername", parameters);
System.out.println(result);
 
private void populateMapForCouponDelete(Map<String, String> parameters) {
    parameters.put("dispatch", "deleteCoupon");
    parameters.put("xml", String.valueOf(true));
    parameters.put("id", "xxxx-xxxx-xxxx-xxxx");
}

 


Rating: