MOR API credit notes get

From Kolmisoft Wiki
Revision as of 09:21, 23 January 2013 by Aisteb (talk | contribs)
Jump to navigationJump to search

MOR API Credit notes list




  • Call: /api/credit_notes
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • user_id - User ID in MOR database, whose credit notes we want to see. Optional.
    • credit_note_id - Credit note ID in MOR database which we want to see. if supplied, credit_note_id has precedence over user_id Optional.
    • 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
      • <credit_notes>
      • <credit_note>
      • <user_id><user_id>
      • <issue_date></issue_date>
      • <number></number>
      • <comment></comment>
      • <price></price>
      • <price_with_vat></price_with_vat>
      • <pay_date></pay_date>
      • </credit_note>
      • ...
      • </credit_notes>

Note that if user of type accountant does not have privileges to manage invoices at least in read mode he cannot see any credit notes. if he does have this priviledge, but does note have privilege to see financial data, accountant will see only user_id, price, issue_date, number and comment.

    • 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/credit_notes?u=user&p=user1&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
      • /api/credit_notes?u=user&p=user1&credit_note_id=345&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
      • /api/credit_notes?u=user&p=user1&user_id=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
      • /api/credit_notes?u=user&p=user1&user_id=123&credit_note_id=345&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

* Note that username and password are not included in hash