MOR API subscription update

From Kolmisoft Wiki
Jump to navigationJump to search

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_until_canceled - subscription is until cancel (0 - off, 1 - on, default - off).
  • 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.



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> - 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 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 date, for subscription type Dynamic Flat rate and it is not possible to change end date for subscription type One time fee.



See also