Difference between revisions of "M4 API payments get"

From Kolmisoft Wiki
Jump to navigationJump to search
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 calls period starting date. (Default: Today at 00:00).  '''Optional'''.
*from_s - Unix timestamp of Payments period starting date. (Default: Today at 00:00).  '''Optional'''.
*till_ - Unix timestamp of calls period end date. (Default: Today at 23:59). '''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 - users first name.  '''Optional'''.
*first_name_s - users first name.  '''Optional'''.
Line 21: Line 21:
*currency_s - payment currency. Example: USD. '''Optional'''.
*currency_s - payment currency. Example: USD. '''Optional'''.
<br><br>
<br><br>
===Request===
===Request===



Revision as of 07:07, 13 June 2017

Description

M2 API Payments get

Usage

  • Call: /api/payments_get
  • Methods: POST, GET(if allowed, not recomended)



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 - users first name. Optional.
  • last_name_s - users 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 username 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>
  </payment>
 </payments>
</page>




Errors

  • <error>Bad login</error> - User was not found by username. Use correct username. Make sure that username (u) are specified.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.



See also