Difference between revisions of "MOR API invoices get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 22: Line 22:
       <Quantity></Quantity>
       <Quantity></Quantity>
       <Price>10.0</Price>
       <Price>10.0</Price>
      <Date_added>2012.02.02</Date_added>
     </Product>
     </Product>
   </Invoice>
   </Invoice>
Line 29: Line 30:
       <Quantity>65</Quantity>
       <Quantity>65</Quantity>
       <Price>112.3324</Price>
       <Price>112.3324</Price>
      <Date_added>2010.01.01</Date_added>
     </Product>
     </Product>
   </Invoice>
   </Invoice>

Revision as of 14:01, 6 February 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 from="2007-09-01" till="2007-10-01">
 <Invoice agreementnumber="0000000000" user_id="0" clientid="240887380">
   <Product>
     <Name>Monthly fee - test</Name>
     <Quantity></Quantity>
     <Price>10.0</Price>
     <Date_added>2012.02.02</Date_added>
   </Product>
 </Invoice>
 <Invoice agreementnumber="0000000000" user_id="0" clientid="240887380">
   <Product>
     <Name>Calls</Name>
     <Quantity>65</Quantity>
     <Price>112.3324</Price>
     <Date_added>2010.01.01</Date_added>
   </Product>
 </Invoice>
</Invoices>

Errors

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