MOR API subscription delete

From Kolmisoft Wiki
Jump to navigationJump to search

Deescription

MOR API Delete subscription

Usage

  • Call: /api/subscription_delete
  • Methods: POST, GET(if allowed, not recomended)



Parametres

Parameters which are included into hash:

  • subscription_id - ID of Subscription you want to delete. Required.
  • subscription_delete_action - number of action that you wish to choose. Numbers meaning: 1 - Delete without money return, 2 - Disable Subscriptions, 3 - Delete with whole money return. Required.

Parameters which are not included into hash:



Request

We have subscription_id = 123, API Secret Key = 456789 and we want to Subscription to be deleted with whole money return.

We send:

HTML POST: http://<SERVER_IP>/billing/api/subscription_delete?u=username&subscription_id=123&subscription_delete_action=3&hash=e0f93111f867ca5d424c0f0ebb6b678159086d00

* Note that username are not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>
     <success>Subscription deleted and money returned</success>
   </status>
</page>
 <?xml version="1.0" encoding="UTF-8"?>
 <page>
   <status>
     <success>Subscription disabled</success>
   </status>
 </page>
 <?xml version="1.0" encoding="UTF-8"?>
 <page>
   <status>
     <success>Subscription deleted</success>
   </status>
 </page>




Errors

  • <error>Access Denied</error> - Person trying to delete Subscription does not exist or his user type is User.
  • <error>You are not authorised to use this functionality</error> - Person trying to delete subscription does not have Manage Subscription permission.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>Subscription disabled</error> - Subscription was successfully disabled.
  • <error>Subscription was not found</error> - Subscription with specified subscription_id was not found.
  • <error>Subscription delete action was not found</error> - Specified subscription_delete_action was not found should be in (1,2,3).



See also