M2 API payments get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

M2 API Payments get

[edit] Usage

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



[edit] 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.



[edit] 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

[edit] 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.



[edit] See also

Personal tools

Try MOR

Try M2