MOR API invoice update

From Kolmisoft Wiki
Revision as of 17:30, 19 September 2017 by Robert (talk | contribs) (→‎Description)
Jump to navigationJump to search

Description

MOR API for invoice update, only for admin and reseller.

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