MOR API financial statements get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

MOR API Financial statements list

[edit] Usage

  • From MOR X4 call: /api/financial_statements_get
  • For Backwards-compatibility old name 'financial_statements' is also usable. Call: /api/financial_statements
  • Methods: POST, GET(if allowed, not recomended)



[edit] Parametres

  • user_id - User ID in MOR database, whose financial statement we want to see. Optional.
  • stauts - Credit note status. Valid values are 'paid', 'unpaid', 'all' if not supplied defaults to 'all'. Optional.
  • date_till - When filtering financial statements by date, this would be minimal date when invoice/credit note/payment was issued. Required
  • date_from - When filtering financial statements by date, this would be maximal date when invoice/credit note/payment was issued. Required
  • u - username for authentication. Required.
  • hash - SHA1 hash constructed using user_id and API_Secret_Key ( More described in Constructing hash). Required.



[edit] Request

We have user_id = 123, that has credit note(id=345) API Secret Key = 456789

We send:

HTML POST: http://<SERVER_IP>/billing/api/financial_statements?u=user&p=user1&date_till=234523&date_from=22354&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

NOTE that username are not included in hash

[edit] Returns

Success

<page>
 <financial_statement currency='USD'> 
  <statement type='type'> 
    <status></status>
    <count></count>
    <price></price>
    <price_with_vat></price_with_vat>
    <price></price>
  </statement>
  <statement type='type'> 
  ... 
  </statement>
 </financial_statement>
</page>

Note that 'currency' is system default currency code. Note that 'type' can be 'invoices', 'credit_notes' or 'payments'. Status might be 'paid' or 'unpaid'. Note that if user of type accountant does not have privileges to manage invoices, financial data, payments at least in read mode he cannot see any financial statements


Errors

  • <error>Bad login</error> - User supplied bad login or password.
  • <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