Log in
 

Soap API documentation

Method: listInvoices

Lists invoices.

Request

Field Type Description  
query id integer Set this field to an array of invoice ids to be returned with or without other filter results. optional
query entityId integer Set this field to an array of entity ids to be returned with or without other filter results. optional
query ledger string sales or purchase. One of the other optional
query status string Invoice status: all invalid draft voided bad_debt valid paid unpaid credited credit_note refund recurring optional
query modifiedSince string DEPRECATED, does not work as described! Limit the response to only entities that have been added or modified since this date. Required format 'YYYY-MM-DD' optional
query offset integer The call only returns 100 invoices, use this to specify an offset optional

Response

Field Type Description  
invoices[] string Array of invoices optional
invoices[][id] integer Invoice Id optional
invoices[][dateCreated] string Date the invoice was created optional
invoices[][dateDue] string Date the invoice is due. optional
invoices[][creditTerms] integer Number of days credit given optional
invoices[][description] string Terms of credit optional
invoices[][entityId] integer Id of entity that the invoice is attached to optional
invoices[][reference] string An semantic invoice reference optional
invoices[][project] integer Project which the invoice is related to. optional
invoices[][status] string Invoice status eg. paid, unpaid optional
invoices[][invoice_prefix] string The prefix for the invoice optional
invoices[][invoice_number] string Invoice number optional
invoices[][external_id] integer Id used to link imported invoices optional
invoices[][statementPage] string A link to a printable invoice page with a link to download as a PDF ( top right corner). optional
invoices[][date_modified] string DEPRECATED, does not work as described! Date this invoice was last modified. optional
invoices[][items][] array Array of Invoice line items that make up the amount due optional
invoices[][items][][description] string Description of item optional
invoices[][items][][unitPrice] float Price per unit of this item optional
invoices[][items][][quantity] integer Quantity of this particular item optional
invoices[][items][][type] string Account code optional
invoices[][items][][vat] string Invoice line items that make up the amount due optional
invoices[][items][][vatRate] string Invoice line items that make up the amount due optional
invoices[][balance] float The unpaid amount of this invoice in the default currency of the company optional
invoices[][foreignCurrencyBalance] float The unpaid amount of this invoice in the currency of the invoice optional
invoices[][fxrate] float The exchange rate between the home currency and the invoice currency for multi-currency invoices. optional
invoices[][multicurrency] integer The currency ID for multicurrency invoices. A list of available currencies can be obtained by using the listCurrencies method. optional
invoices[][bankPaymentId] integer The account code of the bank which is displayed on the invoice. optional
invoices[][pdfUrl] string The publicly accessible PDF URL of the invoice. Please note, that in some cases the URL can change when the invoice is edited. In such cases the old URL will point to a voided invoice. optional

Examples

Request

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Header>
        <authenticate xmlns="https://secure.clearbooks.co.uk/api/accounting/soap/">
            <apiKey xmlns="">yourApiKey</apiKey>
        </authenticate>
    </Header>
    <Body>
        <listInvoices xmlns="https://secure.clearbooks.co.uk/api/accounting/soap/">
            <query ledger="sales" status="" offset="0">
                <ledger>sales</ledger>
                <id>
                    <xsd:int>1</xsd:int>
                    <xsd:int>2</xsd:int>
                </id>
            </query>
        </listInvoices>
    </Body>
</Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://secure.clearbooks.co.uk/api/accounting/soap/">
    <SOAP-ENV:Body>
        <ns1:listInvoicesResponse>
            <return>
                <ns1:Invoice invoice_id="1" invoice_prefix="" invoiceNumber="0" reference="" dateDue="2017-02-05 00:00:00" dateModified="2017-11-03 13:29:58" dateAccrual="2017-01-06 00:00:00" creditTerms="30" bankPaymentId="0" project="0" status="paid" statementPage="https://secure.clearbooks.co.uk/accounting/sales/invoice_html/?source=statement&amp;type=invoice&amp;c=2&amp;auth=eUw9i69syj7VY6KKUG6wDw" pdfUrl="https://secure.clearbooks.co.uk/accounting/sales/invoice_pdf/?type=invoice&amp;c=2&amp;auth=eUw9i69syj7VY6KKUG6wDw" vatTreatment="UK" multicurrency="1" fxrate="0" gross="141.4" net="141.4" vat="0" paid="141.4" balance="0" foreignCurrencyBalance="0">
                    <items>
                        <ns1:Item vat="0" quantity="1" vatRate="Manual" project="0">
                            <description>Interest income</description>
                            <unitPrice>141.4</unitPrice>
                            <type>1001002</type>
                        </ns1:Item>
                    </items>
                    <description></description>
                    <entityId>1</entityId>
                    <dateCreated>2017-01-06 00:00:00</dateCreated>
                    <type>S</type>
                </ns1:Invoice>
                <ns1:Invoice invoice_id="2" invoice_prefix="" invoiceNumber="0" reference="" dateDue="2017-01-31 00:00:00" dateModified="2017-11-03 13:29:58" dateAccrual="2017-01-01 00:00:00" creditTerms="30" bankPaymentId="0" project="0" status="paid" statementPage="https://secure.clearbooks.co.uk/accounting/sales/invoice_html/?source=statement&amp;type=invoice&amp;c=2&amp;auth=EKj_uPbsQNmCUVO0XLnAhw" pdfUrl="https://secure.clearbooks.co.uk/accounting/sales/invoice_pdf/?type=invoice&amp;c=2&amp;auth=EKj_uPbsQNmCUVO0XLnAhw" vatTreatment="UK" multicurrency="1" fxrate="0" gross="2158.59" net="1877.03" vat="281.56" paid="2158.59" balance="0" foreignCurrencyBalance="0">
                    <items>
                        <ns1:Item vat="281.56" quantity="1" vatRate="Manual" project="2">
                            <description>Advertising revenue for January</description>
                            <unitPrice>1877.03</unitPrice>
                            <type>1001002</type>
                        </ns1:Item>
                    </items>
                    <description></description>
                    <entityId>5</entityId>
                    <dateCreated>2017-01-01 00:00:00</dateCreated>
                    <type>S</type>
                </ns1:Invoice>
            </return>
        </ns1:listInvoicesResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ICB accreditation

Clear Books, accredited by The Institute of Certified Bookkeepers and registered with the Financial Conduct Authority (reg. no. 843585), delivers valued, comprehensive online accounting software for small businesses in the UK.