Difference between revisions of "MOR API subscription create"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: | Line 1: | ||
=Deescription= | =Deescription= | ||
<!---This functionality is available from MOR | <!---This functionality is available from MOR x5---> | ||
[[MOR API]] Create subscription | [[MOR API]] Create subscription | ||
<br><br> | <br><br> | ||
Line 19: | Line 19: | ||
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | * [[MOR API hash construction | hash]] - SHA1 hash constructed using '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | ||
* u - username for authentication. '''Required'''. | * u - username for authentication. '''Required'''. | ||
* subscription_activation_start - timestamp of Subscription activation start | * subscription_activation_start - timestamp of Subscription activation start. | ||
* 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_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 | * 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'''. | ||
<br><br> | <br><br> | ||
Revision as of 12:53, 29 October 2014
Deescription
MOR API Create subscription
Usage
- Call: /api/subscription_create
- Methods: POST, GET(if allowed, not recomended)
Parametres
Parameters which are included into hash:
- service_id - Service ID. Required.
- user_id - User 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 service_id = 10, user_id = 2, subscription_memo = acc_one, API Secret Key = 456789.
We send:
HTML POST: http://<SERVER_IP>/billing/api/subscription_create?u=username&service_id=10&user_id=2&subscription_memo=acc_one&hash=e0f93111f867ca5d424c0f0ebb6b678159086d00
* Note that username are not included in hash
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <success>Subscription was successfully created</success> </status> </page>
Errors
- <error>Access Denied</error> - Person trying to create Subscription does not exist or his user type is User.
- <error>You are not authorised to use this functionality</error> - Person trying to create 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>User has insufficient balance</error> - Subscription price is bigger than Subscription User balance.
- <error>Subscription was not found</error> - Subscription with specified subscription_id was not found.