Click or drag to resize
Infosoft Logo

Subscription Invoices

This topic contains the following sections:

Its not uncommon for a subscriber to want his or her invoices presented online. This section presents the options you have to do just that.

Getting Invoice Details

Getting invoice details is as simple as issuing a request to the method GetSubscriptionInvoices with a customernumber and a title code. You must specify a start date but the end date is optional.

Example request for invoices for a year
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://tech.infosoft.no/schemas/2012/08">
<soapenv:Header/>
    <soapenv:Body>
      <ns:GetSubscriptionInvoicesRequest>
          <ns:SubscriptionIdentifier>
            <ns:CustomerNumber>1234</ns:CustomerNumber>
            <ns:TitleCode>IT</ns:TitleCode>
          </ns:SubscriptionIdentifier>
          <ns:StartDate>2013-01-01</ns:StartDate>
          <ns:EndDate>2014-01-01</ns:EndDate>
      </ns:GetSubscriptionInvoicesRequest>
    </soapenv:Body>
</soapenv:Envelope>

This will give you a list of all invoices produced between those dates including all invoice lines that makes up the invoice. Depending on the term of the subscriber this might add up to quite a few invoices, so consider narrowing your result to a year and let the customer input the dates.

You can either present the invoice in your website directly, or you can get the InvoiceNumber and use the Print Service to "print" a PDF file.

Here follows an example of a response from GetSubscriptionInvoices, with two invoices in the result. The first invoice is eliminated, as evidenced by the EliminationDate being set to 2015-05-05T00:00:00. The second invoice is ready to be paid by the customer.

Example response from GetSubscriptionInvoices
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <GetSubscriptionInvoicesResponse xmlns="http://tech.infosoft.no/schemas/2012/08">
         <SubscriptionInvoices xmlns:a="http://tech.infosoft.no/schemas/2011/10" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <a:SubscriptionInvoiceData>
               <a:InvoiceNumber>12345</a:InvoiceNumber>
               <a:InvoiceDate>2015-04-26T00:00:00</a:InvoiceDate>
               <a:DueDate>2015-05-01T00:00:00</a:DueDate>
               <a:InvoiceType>GIRO</a:InvoiceType>
               <a:TotalAmount>500</a:TotalAmount>
               <a:TaxBasis>0</a:TaxBasis>
               <a:NoTaxBasis>500</a:NoTaxBasis>
               <a:Tax>0</a:Tax>
               <a:FeeAmount>0</a:FeeAmount>
               <a:FeeAmountWithTax>0</a:FeeAmountWithTax>
               <a:CustomerIdentifier>00000000012344</a:CustomerIdentifier>
               <a:IsPaid>false</a:IsPaid>
               <a:DeliveryStartDate>2015-04-26T00:00:00</a:DeliveryStartDate>
               <a:DeliveryEndDate>2015-04-26T00:00:00</a:DeliveryEndDate>
               <a:CustomerNumber>1234</a:CustomerNumber>
               <a:TitleCode>IT</a:TitleCode>
               <a:InvoiceTransactions>
                  <a:SubscriptionInvoiceTransactionData>
                     <a:Amount>500</a:Amount>
                     <a:AmountWithTax>500</a:AmountWithTax>
                     <a:AmountPaid>0</a:AmountPaid>
                     <a:DeliveryStartDate>2015-04-26T00:00:00</a:DeliveryStartDate>
                     <a:DeliveryEndDate>2015-04-26T00:00:00</a:DeliveryEndDate>
                     <a:IsPaid>false</a:IsPaid>
                     <a:Text>Avis 6 dager</a:Text>
                     <a:CurrencyCode>NOK</a:CurrencyCode>
                  </a:SubscriptionInvoiceTransactionData>
               </a:InvoiceTransactions>
               <a:EliminationDate>2015-05-05T00:00:00</a:EliminationDate>
            </a:SubscriptionInvoiceData>
            <a:SubscriptionInvoiceData>
               <a:InvoiceNumber>6789</a:InvoiceNumber>
               <a:InvoiceDate>2015-04-27T00:00:00</a:InvoiceDate>
               <a:DueDate>2015-05-16T00:00:00</a:DueDate>
               <a:InvoiceType>GIRO</a:InvoiceType>
               <a:TotalAmount>500</a:TotalAmount>
               <a:TaxBasis>0</a:TaxBasis>
               <a:NoTaxBasis>500</a:NoTaxBasis>
               <a:Tax>0</a:Tax>
               <a:FeeAmount>0</a:FeeAmount>
               <a:FeeAmountWithTax>0</a:FeeAmountWithTax>
               <a:CustomerIdentifier>00000000012344</a:CustomerIdentifier>
               <a:IsPaid>false</a:IsPaid>
               <a:DeliveryStartDate>2015-04-27T00:00:00</a:DeliveryStartDate>
               <a:DeliveryEndDate>2016-04-26T00:00:00</a:DeliveryEndDate>
               <a:CustomerNumber>1234</a:CustomerNumber>
               <a:TitleCode>IT</a:TitleCode>
               <a:InvoiceTransactions>
                  <a:SubscriptionInvoiceTransactionData>
                     <a:Amount>500</a:Amount>
                     <a:AmountWithTax>500</a:AmountWithTax>
                     <a:AmountPaid>0</a:AmountPaid>
                     <a:DeliveryStartDate>2015-04-27T00:00:00</a:DeliveryStartDate>
                     <a:DeliveryEndDate>2016-04-26T00:00:00</a:DeliveryEndDate>
                     <a:IsPaid>false</a:IsPaid>
                     <a:Text>Avis 6 dager</a:Text>
                     <a:CurrencyCode>NOK</a:CurrencyCode>
                  </a:SubscriptionInvoiceTransactionData>
               </a:InvoiceTransactions>
               <a:EliminationDate i:nil="true"/>
            </a:SubscriptionInvoiceData>
         </SubscriptionInvoices>
      </GetSubscriptionInvoicesResponse>
   </s:Body>
</s:Envelope>
Important note  Important

Eliminated invoices (i.e. invoices where EliminationDate is not null) are retained by the system for legal reasons, but cannot be paid, and should probably not even be shown to the user.

PDF Invoices

If you use PDF invoices from within InfoSystems you might want to present the same PDF to the end user, or you might just want to provide a PDF online as a copy/backup in case the physical invoice disappears.

Whatever the reason you can generate the invoice on the fly, all you need is the invoicenumber and the title then you can do a request to GetPdfInvoice which generates a new PDF and returns it as a byte stream.

The use of this service requires that a PDF template is configured for the titles you want to print invoices for.

Example PDF Request
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://tech.infosoft.no/schemas/2012/08">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:GetPdfInvoiceRequest>
         <ns:TitleCode>IT</ns:TitleCode>
         <ns:InvoiceNumber>123456789</ns:InvoiceNumber>
      </ns:GetPdfInvoiceRequest>
   </soapenv:Body>
</soapenv:Envelope>
Security note  Security Note

Make sure you don't expose the generation in a way that allows the end user to enter invoice numbers as you thereby expose all invoices to the world at large.

Paying Invoices With Credit Card Agreements

It's possible for the user to pay for an invoice with a credit card, using the PerformInvoicePayment method. For more details, see the Standalone Subscription Payments article in the credit card documentation.

See Also