M4 API payments get

From Kolmisoft Wiki
Revision as of 09:12, 9 May 2016 by Tomas (talk | contribs) (Created page with '=Description= M2 API Payments get <br><br> =Usage= * Call: '''/api/payments_get''' * Methods: POST, GET(if allowed, not recomended) <br><br> ===Parametres=== * u - username…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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.
  • from_s - Unix timestamp of calls period starting date. (Default: Today at 00:00).
  • till_ - Unix timestamp of calls period end date. (Default: Today at 23:59).
  • username_s - users username.
  • first_name_s - users first name.
  • last_name_s - users last name
  • amount_min_s - amount starting from.
  • amount_max_s - amount ending with.
  • currency_s - payment currency. Example: USD



Request

We have s_user_id = 123, API Secret Key = 456789

We send:

HTML POST: http://<SERVER_IP>/billing/api/payments_get?u=username&s_user_id=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