Difference between revisions of "MOR API user balance get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
<!---This functionality is available from MOR 10, but was also backported to MOR 9--->  
<!---This functionality is available from MOR 10, but was also backported to MOR 9--->  
=About=
=Description=
This feature enables you to check the balance over http.
This feature enables you to check the balance over http.
<br><br>
<br><br>
==Enable check balance over http feature==
=Configuration=


1. Go to '''SETTINGS - Setup -> Settings'''
1. Go to '''SETTINGS –> Setup > Settings'''
<br><br>  
<br><br>  
[[File:settings_path.png]]
[[File:settings_path.png]]
Line 13: Line 13:
[[File:Settings_various_balance_over_http.png]]
[[File:Settings_various_balance_over_http.png]]
<br><br>
<br><br>
==Request==
=Usage=


  HTML POST: http://<SERVER_IP>/billing/api/balance?username=USERNAME
* Call: /billing/api/user_balance_get
* For Backwards-compatibility old name 'balance' is also usable. Call: /billing/api/balance
* Methods: POST, GET(if allowed, not recomended)
<br><br>
===Parametres===
 
* username – username of user whose balance you want to get.
* currency – currency code.
<br><br>
===Request===
 
  HTML POST: http://<SERVER_IP>/billing/api/user_balance_get?username=USERNAME


Optionaly you can specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)  
Optionaly you can specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)  


  HTML POST: http://<SERVER_IP>/billing/api/balance?username=USERNAME&currency={USER|CURRENCY_CODE}
  HTML POST: http://<SERVER_IP>/billing/api/user_balance_get?username=USERNAME&currency={USER|CURRENCY_CODE}
<br><br>
<br><br>
==Result==
===Returns===


-349282.18
'''Success''' returns balance of user.


returns balance of user.
<?xml version="1.0" encoding="UTF-8"?>
<page>
  <balance> user balance </balance>
</page>
<br><br>
<br><br>
==Erros==
----
 
'''Errors'''
 
When hash is incorrect.
 
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>Incorrect hash</error>
</status>


When user is not found.
When user is not found.
  User not found
  <?xml version="1.0" encoding="UTF-8"?>
<page>
  <error>User was not found</error>
</page>


When feature is off.
When feature is off.
  Feature disabled
  <?xml version="1.0" encoding="UTF-8"?>
<page>
  <error>Feature disabled</error>
</page>
<br><br>
<br><br>
=See Also=
=See Also=


* [[MOR API]]
* [[MOR API]]

Revision as of 15:50, 23 May 2013

Description

This feature enables you to check the balance over http.

Configuration

1. Go to SETTINGS –> Setup –> Settings

Settings path.png

2. In Various tab check the marked option (in MOR 12 this option was moved to API tab):

Settings various balance over http.png

Usage

  • Call: /billing/api/user_balance_get
  • For Backwards-compatibility old name 'balance' is also usable. Call: /billing/api/balance
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • username – username of user whose balance you want to get.
  • currency – currency code.



Request

HTML POST: http://<SERVER_IP>/billing/api/user_balance_get?username=USERNAME

Optionaly you can specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)

HTML POST: http://<SERVER_IP>/billing/api/user_balance_get?username=USERNAME&currency={USER|CURRENCY_CODE}



Returns

Success returns balance of user.

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <balance> user balance </balance>
</page>




Errors

When hash is incorrect.

<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>Incorrect hash</error>
</status>

When user is not found.

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <error>User was not found</error>
</page>

When feature is off.

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <error>Feature disabled</error>
</page>



See Also