Difference between revisions of "MOR API credit notes get"

From Kolmisoft Wiki
Jump to navigationJump to search
(No difference)

Revision as of 04:08, 27 May 2013

Description

MOR API Credit notes list

Usage

  • 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)



Parametres

  • 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 for authentication. Required.
  • hash - SHA1 hash constructed using user_id and API_Secret_Key ( More described in Constructing hash). Required.



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

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.



See also