Difference between revisions of "MOR API invoices get"

From Kolmisoft Wiki
Jump to navigationJump to search
(New page: Retrieves list of invoices in selected time period. ====Request==== HTML POST: http://<SERVER IP>/mor/api/invoices?u=username&p=password&from=1188604800&till=1191196799&lang=en Here: *...)
 
 
(27 intermediate revisions by 7 users not shown)
Line 1: Line 1:
=Description=
[[MOR API]] Retrieves a list of invoices in the selected time period.


Retrieves list of invoices in selected time period.
If a user has 'admin' rights, he will get '''ALL''' invoices from the selected period. If a user has 'accountant' rights and can see only assigned users, he will get only assigned users invoices from the selected period. If user has 'user' rights, he will get only '''HIS''' invoices from the selected period.
<br><br>


====Request====
=Usage=


HTML POST: http://<SERVER IP>/mor/api/invoices?u=username&p=password&from=1188604800&till=1191196799&lang=en
* From '''MOR X4''' call: '''/api/invoices_get'''
* For Backwards-compatibility old name 'invoices' is also usable. Call: '''/api/invoices'''
* Methods: POST, GET(if allowed, not recomended)
<br><br>
===Parametres===


Here:
* u - username username of user which can view invoices. '''Required'''.
* username/password - of the user who is asking for the invoices. If user has 'admin' rights - he will get all invoices from selected period, if user has 'user' rights - he will get only his invoices in selected period.
* from/till - time period for invoices in [http://en.wikipedia.org/wiki/Unix_time Unix Epoch Time] format. Invoice's '''period start''' should be >= '''from''' and '''period end''' <= '''till'''.
* from/till - time period for invoices in [http://en.wikipedia.org/wiki/Unix_time Unix Epoch Time] format. Invoice's '''period start''' should be >= '''from''' and '''period end''' <= '''till'''.
** http://www.epochconverter.com/ can help to convert time for testing
** http://www.epochconverter.com/ can help to convert time for testing.
* lang - choose in which language do you want to get invoice details (mainly 'Calls').
* lang - choose the language in which you want to get invoice details (mainly 'Calls').
<br><br>
===Request===


====Example result====
HTML POST: http://<SERVER IP>/billing/api/invoices_get?u=username&from=1188604800&till=1191196799&lang=en
<br><br>
===Returns===


  <Invoices from="2007-09-01" till="2007-10-01">
'''Success'''
  <Invoice agreementnumber="0000000000" user_id="0" clientid="240887380">
  <Invoices from="2019-05-01" till="2019-05-31">
    <Product>
<Invoice user_id="2" agreementnumber="" clientid="" number="INV1905011">
      <Name>Monthly fee - test</Name>
<id>5</id>
      <Quantity></Quantity>
<paid>0</paid>
      <Price>10.0</Price>
<Product>
    </Product>
<Name>Test_periodic_service - 1</Name>
  </Invoice>
<Quantity>1</Quantity>
  <Invoice agreementnumber="0000000000" user_id="0" clientid="240887380">
<Price>10.0000</Price>
    <Product>
<Discount>0.0000</Discount>
      <Name>Calls</Name>
<Sum>10.0000</Sum>
      <Quantity>65</Quantity>
<Date_added/>
      <Price>112.3324</Price>
<Issue_date>2019-06-27</Issue_date>
    </Product>
<Time/>
  </Invoice>
<Service_id>1</Service_id>
<Prefix></Prefix>
</Product>
<Product>
<Name>Test_periodic_service - 2</Name>
<Quantity>1</Quantity>
<Price>10.0000</Price>
<Discount>2.0000</Discount>
<Sum>8.0000</Sum>
<Date_added/>
<Issue_date>2019-06-27</Issue_date>
<Time/>
<Service_id>2</Service_id>
<Prefix></Prefix>
</Product>
<Total_time/>
</Invoice>
  </Invoices>
  </Invoices>
----


====Errors====
'''Errors'''
 
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>Incorrect hash</error>
</status>


  <Error>user not found</Error>
  <Error>user not found</Error>


  <Error>no invoices found</Error>
  <Error>no invoices found</Error>
<br><br>
=See also=
* [[MOR API]]

Latest revision as of 11:08, 20 September 2022

Description

MOR API Retrieves a list of invoices in the selected time period.

If a user has 'admin' rights, he will get ALL invoices from the selected period. If a user has 'accountant' rights and can see only assigned users, he will get only assigned users invoices from the selected period. If user has 'user' rights, he will get only HIS invoices from the selected period.

Usage

  • From MOR X4 call: /api/invoices_get
  • For Backwards-compatibility old name 'invoices' is also usable. Call: /api/invoices
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • u - username username of user which can view invoices. Required.
  • from/till - time period for invoices in Unix Epoch Time format. Invoice's period start should be >= from and period end <= till.
  • lang - choose the language in which you want to get invoice details (mainly 'Calls').



Request

HTML POST: http://<SERVER IP>/billing/api/invoices_get?u=username&from=1188604800&till=1191196799&lang=en



Returns

Success

<Invoices from="2019-05-01" till="2019-05-31">
<Invoice user_id="2" agreementnumber="" clientid="" number="INV1905011">
<id>5</id>
<paid>0</paid>
<Product>
<Name>Test_periodic_service - 1</Name>
<Quantity>1</Quantity>
<Price>10.0000</Price>
<Discount>0.0000</Discount>
<Sum>10.0000</Sum>
<Date_added/>
<Issue_date>2019-06-27</Issue_date>

Errors

<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>Incorrect hash</error>
</status>
<Error>user not found</Error>
<Error>no invoices found</Error>



See also