Difference between revisions of "MOR API financial statements get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
<!---This functionality is available from MOR 12--->
<!---This functionality is available from MOR 12--->


 
[[MOR API]] Financial statements list
[[MOR API]]
 
Financial statements list
 
<br><br>
<br><br>
----
----

Revision as of 16:01, 21 February 2013


MOR API Financial statements list




  • Call: /api/financial_statements
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • 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 to login. Required.
    • p - password to login. Required.
    • hash - SHA1 hash constructed using user_id and API_Secret_Key ( More described in Constructing hash). Required.
  • Returns:
    • Success
      • <financial_statement currency='USD'>
      • <statement type='invoices'>
      • <status></status>
      • <count></count>
      • <price></price>
      • <price_with_vat></price_with_vat>
      • <price></price>
      • </statement>
      • ...
      • </financial_statement>

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.




  • Example:
    • We have user_id = 123, that has credit note(id=345) API Secret Key = 456789
    • Hash string to be converted: "123456789"
    • We might send:
      • /api/financial_statements?u=user&p=user1&date_till=234523&date_from=22354&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
      • /api/credit_notes?u=user&p=user1&status=paid&date_till=234523&date_from=22354&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

* Note that username and password are not included in hash