M4 API payments get
From Kolmisoft Wiki
Jump to navigationJump to search
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.