Difference between revisions of "MOR API invoice update"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Description=
=Description=
<!---This functionality is available from MOR x11--->
<!---This functionality is available from MOR x11--->
[[MOR API]] for invoice update.
[[MOR API]] for invoice update.<br>
If a user has 'accountant' rights and can see only assigned users, he will be able to update only for assigned users invoices.
<br><br>
<br><br>
=Usage=
=Usage=


Line 29: Line 31:
* comment - Comment
* comment - Comment
* name - User Details name
* name - User Details name
* invoice_sent_manually - Invoice sent manually setting.
* invoice_sent_manually - Invoice sent manually setting. (to change status, the value must be 1)
* pay - paid status setting.
* pay - paid status setting. (to change status, the value must be 1)


<br><br>
<br><br>

Latest revision as of 08:08, 2 October 2017

Description

MOR API for invoice update.
If a user has 'accountant' rights and can see only assigned users, he will be able to update only for assigned users invoices.

Usage

  • From MOR X11 call: /api/invoice_update
  • Methods: POST, GET(if allowed, not recomended)



Parametres

Parameters which are included into hash:

  • id - Inovice ID in MOR database, which we want to change. Required.

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.
  • u - username to login. Required.
  • address - User Details address
  • city - User Details city
  • postcode - User Details postcode
  • state - User Details state
  • country_id - User Details Country (Direction id)
  • phone - User Details phone
  • tax_reg_number - User Details TAX Registration Number
  • comment - Comment
  • name - User Details name
  • invoice_sent_manually - Invoice sent manually setting. (to change status, the value must be 1)
  • pay - paid status setting. (to change status, the value must be 1)



Request

If API Secret Key = secret

You send:

HTML POST: http://<SERVER IP>/billing/api/invoice_update?u=admin&id=2&hash=38282ca5e65e63746498ef5b39a2fe71c6448df4

* Note that username (u) is not included in the hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <status>
   <success>Invoice successfully updated</success>
 </status>
</page>




Errors

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <status>
   <error>Invoice was not found</error>
 </status>
</page>
<?xml version="1.0" encoding="UTF-8"?>
<status>
 <error>Incorrect hash</error>
</status>
<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>
     <error>Access denied</error>
   </status>
</page>


See also