Difference between revisions of "MOR API credit notes create"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
=Description=
<!---This functionality is available from MOR 12--->
<!---This functionality is available from MOR 12--->
[[MOR API]] Create credit note
[[MOR API]] Create credit note
<br><br>
<br><br>
----
=Usage=
<br><br>


* Call: /api/credit_note_create
* Call: /api/credit_note_create
* Methods: POST, GET(if allowed, not recomended)
* Methods: POST, GET(if allowed, not recomended)
* Params:
<br><br>
** user_id - User ID in MOR database, for which user device should be created. '''Required'''.
===Parametres===
** price - credit note price in system currency. '''Required'''.
** issue_date - date credit note was issued(unix timestamp). '''Required'''.
** comment - unlimited length text. '''Optional'''.
** number - number of credit note. '''Optional'''.
** u - username to login. '''Required'''.
** p - password to login. '''Required'''.
** [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.


Note that if user of type accountant does not have privileges to manage invoices at least in read mode or does note have privilege to see financial data in edit mode, accountant cannot create credit note.  
* user_id - User ID in MOR database, for which user device should be created. '''Required'''.
* price - credit note price in system currency. '''Required'''.
* issue_date - date credit note was issued(unix timestamp). '''Required'''.
* comment - unlimited length text. '''Optional'''.
* number - number of credit note. '''Optional'''.
* u - username for authentication. '''Required'''.
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.


* Returns:
Note that if user of type accountant does not have privileges to manage invoices at least in read mode or does note have privilege to see financial data in edit mode, accountant cannot create credit note.
**Success
<br><br>  
*** <status>Credit note was created</status>
===Request===
** Errors:
*** <error>User was not found</error> - User was not found using user_id. Use correct user id.
*** <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 created</error>
*** <error>Bad login</error>


We have user_id = 123, price=100 and API Secret Key = 456789\
We send:
HTML POST: http://<SERVER_IP>/billing/api/credit_note_create?u=username&user_id=123&price=100&issue_date=214543&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
'''NOTE that username are not included in hash'''
<br><br>
===Returns===
'''Success'''
<?xml version="1.0" encoding="UTF-8"?>
<page>
    <status>Credit note was created</status>
</page>
<br><br>
<br><br>
----
----
*Example:
'''Errors'''
**We have user_id = 123, API Secret Key = 456789
 
**Hash string to be converted: "123456789"
* <error>User was not found</error> - User was not found using user_id. Use correct user id.
**We send:
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
***/api/credit_note_create?u=admin&p=admin&user_id=123&price=100&issue_date=214543&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
* <error>Credit note was not created</error>
'''* Note that username and password are not included in hash'''
* <error>Bad login</error>
<br><br>
=See also=
 
* [[MOR API]]

Revision as of 04:29, 27 May 2013

Description

MOR API Create credit note

Usage

  • Call: /api/credit_note_create
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • user_id - User ID in MOR database, for which user device should be created. Required.
  • price - credit note price in system currency. Required.
  • issue_date - date credit note was issued(unix timestamp). Required.
  • comment - unlimited length text. Optional.
  • number - number of credit note. Optional.
  • u - username for authentication. Required.
  • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.

Note that if user of type accountant does not have privileges to manage invoices at least in read mode or does note have privilege to see financial data in edit mode, accountant cannot create credit note.

Request

We have user_id = 123, price=100 and API Secret Key = 456789\

We send:


HTML POST: http://<SERVER_IP>/billing/api/credit_note_create?u=username&user_id=123&price=100&issue_date=214543&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

NOTE that username are not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>Credit note was created</status>
</page>




Errors

  • <error>User was not found</error> - User was not found using user_id. Use correct user id.
  • <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 created</error>
  • <error>Bad login</error>



See also