Difference between revisions of "MOR API invoices get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 16: Line 16:
==Example result==
==Example result==


<Invoices from="2007-09-01" till="2007-10-01">
<Invoices till="2015-08-22" from="2005-04-21">
   <Invoice agreementnumber="0000000000" user_id="0" clientid="240887380">
   <Invoice clientid="" number="INV0706221" agreementnumber="" user_id="0">
     <Product>
     <Product>
       <Name>Monthly fee - test</Name>
       <Name>Calls</Name>
       <Quantity></Quantity>
       <Quantity>2</Quantity>
       <Price>10.0</Price>
       <Price>5.0000</Price>
       <Date_added>2012.02.02</Date_added>
       <Date_added></Date_added>
       <Issue_date>2012.02.02</Issue_date>
       <Issue_date>2012-06-22</Issue_date>
     </Product>
     </Product>
   </Invoice>
   </Invoice>
   <Invoice agreementnumber="0000000000" user_id="0" clientid="240887380">
   <Invoice clientid="" number="INV0706222" agreementnumber="" user_id="2">
     <Product>
     <Product>
       <Name>Calls</Name>
       <Name>Calls</Name>
       <Quantity>65</Quantity>
       <Quantity>4</Quantity>
       <Price>112.3324</Price>
       <Price>20.0000</Price>
       <Issue_date>2010.01.01</Issue_date>
       <Date_added></Date_added>
      <Issue_date>2012-06-22</Issue_date>
    </Product>
    <Product>
      <Name>Test_periodic_service - Test_preriodic_service_memo</Name>
      <Quantity>1</Quantity>
      <Price>390.5591</Price>
      <Date_added></Date_added>
      <Issue_date>2012-06-22</Issue_date>
    </Product>
  </Invoice>
  <Invoice clientid="" number="INV0706223" agreementnumber="0000000001" user_id="3">
    <Product>
      <Name>Calls</Name>
      <Quantity>2</Quantity>
      <Price>11.0000</Price>
      <Date_added></Date_added>
      <Issue_date>2012-06-22</Issue_date>
    </Product>
    <Product>
      <Name>Calls from Users</Name>
      <Quantity>7</Quantity>
      <Price>52.0000</Price>
      <Date_added></Date_added>
      <Issue_date>2012-06-22</Issue_date>
     </Product>
     </Product>
   </Invoice>
   </Invoice>
</Invoices>
</Invoices>


==Errors==
==Errors==

Revision as of 12:39, 4 July 2012

MOR API

Retrieves a list of invoices in the selected time period.

Request

If a user has 'admin' rights, he will get ALL invoices from the selected period. If user has 'user' rights, he will get only HIS invoices from the selected period.

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

Here:

  • 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').

Example result

<Invoices till="2015-08-22" from="2005-04-21">

 <Invoice clientid="" number="INV0706221" agreementnumber="" user_id="0">
   <Product>
     <Name>Calls</Name>
     <Quantity>2</Quantity>
     <Price>5.0000</Price>
     <Date_added></Date_added>
     <Issue_date>2012-06-22</Issue_date>
   </Product>
 </Invoice>
 <Invoice clientid="" number="INV0706222" agreementnumber="" user_id="2">
   <Product>
     <Name>Calls</Name>
     <Quantity>4</Quantity>
     <Price>20.0000</Price>
     <Date_added></Date_added>
     <Issue_date>2012-06-22</Issue_date>
   </Product>
   <Product>
     <Name>Test_periodic_service - Test_preriodic_service_memo</Name>
     <Quantity>1</Quantity>
     <Price>390.5591</Price>
     <Date_added></Date_added>
     <Issue_date>2012-06-22</Issue_date>
   </Product>
 </Invoice>
 <Invoice clientid="" number="INV0706223" agreementnumber="0000000001" user_id="3">
   <Product>
     <Name>Calls</Name>
     <Quantity>2</Quantity>
     <Price>11.0000</Price>
     <Date_added></Date_added>
     <Issue_date>2012-06-22</Issue_date>
   </Product>
   <Product>
     <Name>Calls from Users</Name>
     <Quantity>7</Quantity>
     <Price>52.0000</Price>
     <Date_added></Date_added>
     <Issue_date>2012-06-22</Issue_date>
   </Product>
 </Invoice>

</Invoices>

Errors

<Error>user not found</Error>
<Error>no invoices found</Error>