MOR API credit notes get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

MOR API Credit notes list

[edit] Usage

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



[edit] Parametres

Parameters which are included into hash:

  • user_id - User ID in MOR database, whose credit notes we want to see. Optional.

Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key

Parameters which are not included into hash:

  • hash - SHA1 hash constructed using parameters above and API_Secret_Key ( More described in Constructing hash). Required (if setting Disable hash checking is not checked).
  • u - username for authentication. Required.
  • 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.



[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/credit_notes?u=username&credit_note_id=345&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441


* Note that username are not included in hash

[edit] Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <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_note> 
  ... 
  </credit_note>
 </credit_notes>
</page>

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.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>Credit note was not found</error> - credit note was not found using phonebook_id. Use correct phonebook id.



[edit] See also

Personal tools

Try MOR

Try M2