Difference between revisions of "MOR API credit notes get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 10: Line 10:
<br><br>
<br><br>
===Parametres===
===Parametres===
Parameters which are '''included''' into hash:


* user_id - User ID in MOR database, whose credit notes we want to see. '''Optional'''.
* 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'''
<br><br>
Parameters which are '''not included''' into hash:
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''user_id''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
* 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'''.
* 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'''.
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''user_id''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
<br><br>
<br><br>
===Request===
===Request===



Revision as of 13:25, 28 May 2014

Description

MOR API Credit notes list

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)



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



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