Features
Accountants
Pricing
Support
Log in
 

Soap API documentation

Method: listEntities

Returns a list of customers and/or suppliers.

Request

Field Type Description  
query id integer Set this field to an array of entity ids to be returned with or without other filter results. optional
query type string Customers or suppliers. Leave empty for both optional
query modifiedSince string Limit the response to only entities that have been added or modified since this date optional
query offset integer The call only returns 1000 entities, use this to specify an offset optional

Response

Field Type Description  
entities[] array See entity from updateEntity optional
entities[][statement_url] string The URL the customer/supplier can access to view statements optional

Examples

Request

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
  xmlns:cb="https://secure.clearbooks.co.uk/api/soap/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
  <env:Header>
    <cb:authenticate apiKey="yourApiKey" />
  </env:Header>
  <env:Body>
    <env:listEntities env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
      <query type="customer" offset="0" modifiedSince="2010-01-01 12:00:00" offset="0" xsi:type="cb:EntityQuery" >
       <id><xsd:integer>59</xsd:integer></id>
      </query>
    </env:listEntities>
  </env:Body>
</env:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
  xmlns:cb="https://secure.clearbooks.co.uk/api/soap/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
  <env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
    <env:listEntitiesResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
      <entities enc:itemType="cb:Entity" enc:arraySize="22"
        xsi:type="cb:ArrayOfEntities">
        <entity id="59" company_name="A new company" contact_name="Mr Contact Person"
          address1="address1" town="town" county="county" postcode="postcode"
          email="email@address.com" phone1="01234 567890" building=""
          address2="" phone2="" fax="" website="" xsi:type="ns1:Entity">
          <supplier default_account_code="30" default_vat_rate="0.15"
            default_credit_terms="30" xsi:type="cb:EntityExtra" />
        </entity>
      </entities>
    </env:createEntityResponse>
  </env:Body>
</env:Envelope>

Clear Books is proudly registered with the Financial Conduct Authority as an Account Information Services Provider (register no. 843585).