Difference between revisions of "MOR API subscription update"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Deescription=
=Description=
<!---This functionality is available from MOR x5--->
 
[[MOR API]] Update subscription
[[MOR API]] Update subscription
<br><br>
<br><br>
=Usage=
=Usage=


Line 8: Line 9:
* Methods: POST, GET(if allowed, not recomended)
* Methods: POST, GET(if allowed, not recomended)
<br><br>
<br><br>
===Parametres===
===Parameters===


Parameters which are '''included''' into hash:
Parameters which are '''included''' into hash:
Line 21: Line 22:
* subscription_activation_end - timestamp of Subscription activation end.  
* subscription_activation_end - timestamp of Subscription activation end.  
* subscription_memo - memo of Subscription.  
* subscription_memo - memo of Subscription.  
* subscription_until_canceled - subscription is until cancel (0 - off, 1 - on, default - off).  
* subscription_discount_percent - Subscription Discount Percent. Possible values are from 0 to 100.
* subscription_no_expiration_at_the_end_of_a_month - subscription has no expiration at the end of month. (0 - off, 1 - on, default - off). '''Only for Flat Rate'''.  
* subscription_start_period_day - Start Period on the day, possible values between 1 and 31.
* subscription_start_period_month - Start Period on the month, possible values between 1 and 12.
* subscription_charge_balance_on - Charge Balance on, possible values are 1,2,3 (where 1: Period Start, 2: Period End, 3: Every Day).
* subscription_until_canceled - subscription is until canceled (0 - off, 1 - on, default - off).  
* subscription_no_expiration_at_the_end_of_a_month - subscription has no expiration at the end of the month. (0 - off, 1 - on, default - off). '''Only for Flat Rate'''.  
<br><br>
<br><br>


Line 33: Line 38:
  HTML POST: http://<SERVER_IP>/billing/api/subscription_update?u=username&subscription_id=10&subscription_activation_start=1255132800&subscription_memo=acc_one&hash=e0f93111f867ca5d424c0f0ebb6b678159086d00
  HTML POST: http://<SERVER_IP>/billing/api/subscription_update?u=username&subscription_id=10&subscription_activation_start=1255132800&subscription_memo=acc_one&hash=e0f93111f867ca5d424c0f0ebb6b678159086d00


'''* Note that username are not included in hash'''
'''* Note that username is not included in hash'''
<br><br>
<br><br>
===Returns===
===Returns===


Line 49: Line 55:
----
----
'''Errors'''
'''Errors'''
* <error>Access Denied</error> - user does not exist or cannot use this functionality.  
* <error>Access Denied</error> - the user does not exist or cannot use this functionality.  
* <error>You are not authorised to use this functionality</error> - accountant does not have Manage Subscription permission.
* <error>You are not authorised to use this functionality</error> - accountant 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>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
Line 57: Line 63:
* <error>Activation start date must be earlier than end date</error> - self explanatory.  
* <error>Activation start date must be earlier than end date</error> - self explanatory.  
* <error>Service is not flat rate</error> - you are using subscription_no_expiration_at_the_end_of_a_month parameter with service which is not Flat-Rate type.  
* <error>Service is not flat rate</error> - you are using subscription_no_expiration_at_the_end_of_a_month parameter with service which is not Flat-Rate type.  
'''Info'''
* <info>Not possible to set activation end until canceled </info> - It is not possible to set activations to end until canceled, for subscription types: One Time fee, Dynamic Flat rate.
* <info>Not possible to change dates </info> - It is not possible to change dates, for subscription type Dynamic Flat rate and it is not possible to change the end date for subscription type One time fee.
<br><br>
<br><br>


Line 62: Line 71:


* [[MOR API]]
* [[MOR API]]
* [[MOR API subscription delete]]
* [[MOR API Subscriptions get]]
* [[MOR API subscription create]]

Latest revision as of 08:29, 15 March 2023

Description

MOR API Update subscription

Usage

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



Parameters

Parameters which are included into hash:

  • subscription_id - Subscription ID. Required.

Parameters which are not included into hash:

  • hash - SHA1 hash constructed using API_Secret_Key ( More described in Constructing hash). Required.
  • u - username for authentication. Required.
  • subscription_activation_start - timestamp of Subscription activation start.
  • subscription_activation_end - timestamp of Subscription activation end.
  • subscription_memo - memo of Subscription.
  • subscription_discount_percent - Subscription Discount Percent. Possible values are from 0 to 100.
  • subscription_start_period_day - Start Period on the day, possible values between 1 and 31.
  • subscription_start_period_month - Start Period on the month, possible values between 1 and 12.
  • subscription_charge_balance_on - Charge Balance on, possible values are 1,2,3 (where 1: Period Start, 2: Period End, 3: Every Day).
  • subscription_until_canceled - subscription is until canceled (0 - off, 1 - on, default - off).
  • subscription_no_expiration_at_the_end_of_a_month - subscription has no expiration at the end of the month. (0 - off, 1 - on, default - off). Only for Flat Rate.



Request

We have subscription_id = 10, subscription_activation_start = 1255132800, subscription_memo = acc_one, API Secret Key = 456789.

We send:

HTML POST: http://<SERVER_IP>/billing/api/subscription_update?u=username&subscription_id=10&subscription_activation_start=1255132800&subscription_memo=acc_one&hash=e0f93111f867ca5d424c0f0ebb6b678159086d00

* Note that username is not included in hash

Returns

Success

 <?xml version="1.0" encoding="UTF-8"?>
 <page>
   <status>
     <success>Subscription was successfully updated</success>
   </status>
 </page>




Errors

  • <error>Access Denied</error> - the user does not exist or cannot use this functionality.
  • <error>You are not authorised to use this functionality</error> - accountant 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 activation end date must be valid timestamp</error> - self explanatory.
  • <error>Subscription activation start date must be valid timestamp</error> - self explanatory.
  • <error>Subscription was not found</error> - Subscription with specified subscription_id was not found.
  • <error>Activation start date must be earlier than end date</error> - self explanatory.
  • <error>Service is not flat rate</error> - you are using subscription_no_expiration_at_the_end_of_a_month parameter with service which is not Flat-Rate type.

Info

  • <info>Not possible to set activation end until canceled </info> - It is not possible to set activations to end until canceled, for subscription types: One Time fee, Dynamic Flat rate.
  • <info>Not possible to change dates </info> - It is not possible to change dates, for subscription type Dynamic Flat rate and it is not possible to change the end date for subscription type One time fee.



See also