Difference between revisions of "MOR API credit note update"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
''This functionality is available from [[MOR 12| MOR 12]]''
<!---This functionality is available from MOR 12--->
[[MOR API]] Credit note update
<br><br>
=Usage=


* Call: /api/credit_note_update
* Methods: POST, GET(if allowed, not recomended)
<br><br>
===Parametres===


[[MOR API]]
* status - status of credit note, posible values are 'paid', 'unpaid'. '''Optional'''


Credit note update
'''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 parameters above and API_Secret_Key ([[MOR API hash construction | 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. '''Required'''.
* comment - unlimited length text. '''Optional'''
<br><br>
<br><br>
----
 
===Request===
 
We have credit_note_id = 123, API Secret Key = 456789
 
We send:
 
HTML POST: http://<SERVER_IP>/billing/api/credit_note_update?u=username&credit_note_id=123&status=paid&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
 
'''NOTE that username are not included in hash'''
<br><br>
<br><br>
===Returns===


* Call: /api/credit_note_update
'''Success'''
* Methods: POST, GET(if allowed, not recomended)
* Params:
** credit_note_id - Credit note ID in MOR database. '''Required'''.
** u - username to login. '''Required'''.
** p - password to login. '''Required'''.
** status - status of credit note, posible values are 'paid', 'unpaid'. '''Optional'''
** comment - unlimited length text. '''Optional'''
** [[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:
**Success
*** <status>Credit note updated</status>
** Errors:
*** <error>Credit note was not saved</error>
*** <error>Bad login</error>
*** <error>Credit note was not found</error> - credit note was not found using phonebook_id. Use correct phonebook id.
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.


<?xml version="1.0" encoding="UTF-8"?>
<page>
    <status>Credit note was updated</status>
</page>
<br><br>
<br><br>
----
----
*Example:
'''Errors'''
**We have credit_note_id = 123, API Secret Key = 456789
 
**Hash string to be converted: "123456789"
* <error>Credit note was not saved</error>
**We send:
* <error>Bad login</error>
***/api/credit_note_update?u=admin&p=admin&credit_note_id=123&status=paid&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
* <error>Credit note was not found</error> - credit note was not found using phonebook_id. Use correct phonebook id.
'''* Note that username and password are not included in hash'''
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
<br><br>
=See also=
 
* [[MOR API]]

Latest revision as of 06:48, 30 May 2014

MOR API Credit note update

Usage

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



Parametres

  • status - status of credit note, posible values are 'paid', 'unpaid'. 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. Required.
  • comment - unlimited length text. Optional



Request

We have credit_note_id = 123, API Secret Key = 456789

We send:

HTML POST: http://<SERVER_IP>/billing/api/credit_note_update?u=username&credit_note_id=123&status=paid&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

NOTE that username are not included in hash

Returns

Success

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




Errors

  • <error>Credit note was not saved</error>
  • <error>Bad login</error>
  • <error>Credit note was not found</error> - credit note was not found using phonebook_id. Use correct phonebook id.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.



See also