Difference between revisions of "M4 API payments get"
From Kolmisoft Wiki
Jump to navigationJump to search
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
=Description= | =Description= | ||
Retrieves Payments information | |||
<br><br> | <br><br> | ||
=Usage= | =Usage= | ||
* Call: '''/api/payments_get''' | * Call: '''/api/payments_get''' | ||
* Methods: POST, GET(if allowed, not | * Methods: POST, GET(if allowed, not recommended) | ||
<br><br> | <br><br> | ||
===Parametres=== | ===Parametres=== | ||
Line 12: | Line 12: | ||
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | * [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | ||
*user_id_s - payments user id. '''Optional'''. | *user_id_s - payments user id. '''Optional'''. | ||
*from_s - Unix timestamp of | *from_s - Unix timestamp of Payments period starting date. (Default: Today at 00:00). '''Optional'''. | ||
* | *till_s - Unix timestamp of Payments period end date. (Default: Today at 23:59). '''Optional'''. | ||
*username_s - users username. '''Optional'''. | *username_s - users username. '''Optional'''. | ||
*first_name_s - | *first_name_s - user's first name. '''Optional'''. | ||
*last_name_s - | *last_name_s - user's last name. '''Optional'''. | ||
*amount_min_s - amount starting from. '''Optional'''. | *amount_min_s - amount starting from. '''Optional'''. | ||
*amount_max_s - amount ending with. '''Optional'''. | *amount_max_s - amount ending with. '''Optional'''. | ||
*currency_s - payment currency. Example: USD. '''Optional'''. | *currency_s - payment currency. Example: USD. '''Optional'''. | ||
<br><br> | <br><br> | ||
===Request=== | ===Request=== | ||
Line 27: | Line 28: | ||
We send: | We send: | ||
HTML POST: http://<SERVER_IP>/billing/api/payments_get?u=username& | HTML POST: http://<SERVER_IP>/billing/api/payments_get?u=username&user_id_s=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441 | ||
'''NOTE that | '''NOTE that usernames are not included in hash''' | ||
<br><br> | <br><br> | ||
Line 47: | Line 48: | ||
<comment> ''payment comment'' </comment> | <comment> ''payment comment'' </comment> | ||
<currency> ''payment currency'' </currency> | <currency> ''payment currency'' </currency> | ||
<user_balance_before_payment> ''user's balance before payment'' </user_balance_before_payment> | |||
<user_balance_after_payment> ''user's balance after payment'' </user_balance_after_payment> | |||
</payment> | </payment> | ||
</payments> | </payments> | ||
Line 55: | Line 58: | ||
'''Errors''' | '''Errors''' | ||
* <error>Bad login</error> - User was not found by username. Use correct username. Make sure that username (u) | * <error>Bad login</error> - User was not found by username. Use the correct username. Make sure that username (u) is specified. | ||
* <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 62: | Line 65: | ||
=See also= | =See also= | ||
* [[ | * [[M4 API]] |
Latest revision as of 11:16, 28 November 2022
Description
Retrieves Payments information
Usage
- Call: /api/payments_get
- Methods: POST, GET(if allowed, not recommended)
Parametres
- u - username for authentication. Required.
- hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
- user_id_s - payments user id. Optional.
- from_s - Unix timestamp of Payments period starting date. (Default: Today at 00:00). Optional.
- till_s - Unix timestamp of Payments period end date. (Default: Today at 23:59). Optional.
- username_s - users username. Optional.
- first_name_s - user's first name. Optional.
- last_name_s - user's last name. Optional.
- amount_min_s - amount starting from. Optional.
- amount_max_s - amount ending with. Optional.
- currency_s - payment currency. Example: USD. Optional.
Request
We have s_user_id = 123, API Secret Key = 456789
We send:
HTML POST: http://<SERVER_IP>/billing/api/payments_get?u=username&user_id_s=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
NOTE that usernames are not included in hash
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <pagename> Payments_list </pagename> <payments> <payment> <user> payment user </user> <date> date added </date> <amount> payment amount </amount> <amount_with_tax> payment amount with tax </amount_with_tax> <comment> payment comment </comment> <currency> payment currency </currency> <user_balance_before_payment> user's balance before payment </user_balance_before_payment> <user_balance_after_payment> user's balance after payment </user_balance_after_payment> </payment> </payments> </page>
Errors
- <error>Bad login</error> - User was not found by username. Use the correct username. Make sure that username (u) is specified.
- <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.