Log in
 

Soap API documentation

Method: createEntity

How to create a new Customer or Supplier.

Request

Field Type Description  
entity company_name string optional
entity contact_name string optional
entity building string optional
entity address1 string optional
entity address2 string optional
entity town string optional
entity county string optional
entity country string Enter a country code as found here. optional
entity postcode string optional
entity email string optional
entity phone1 string optional
entity phone2 string optional
entity fax string optional
entity website string optional
entity external_id integer optional
supplier default_account_code string optional
supplier default_vat_rate string optional
supplier default_credit_terms integer optional
customer default_account_code string optional
customer default_vat_rate string optional
customer default_credit_terms integer optional
entity bankAccount array Optional bank details for the customer or supplier. optional
bankAccount bankName string The name of the bank. optional
bankAccount name string The name of the bank account. optional
bankAccount sortcode string The sort code of the bank. optional
bankAccount accountNumber string The bank account number. optional

Response

Field Type Description  
The return value integer The internal id of the entity optional

Examples

Request

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="https://secure.clearbooks.local/api/accounting/soap/">
  <SOAP-ENV:Header>
    <ns1:authenticate>
      <apiKey>yourApiKey</apiKey>
    </ns1:authenticate>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:createEntity>
        <entity
            country="GB"
            building="12"
            address2="address2"
            phone2="phone2"
            fax="fax"
            website="website"
            external_id="1234"
            vat_number=""
            company_number="">
            <customer
                default_account_code="1001001"
                default_vat_rate="0.20"
                default_credit_terms="30"/>
            <supplier
                default_account_code="2001001"
                default_vat_rate="0.20"
                default_credit_terms="30"/>
            <company_name>A new company</company_name>
            <contact_name>Mr Contact Person</contact_name>
            <address1>address1</address1>
            <town>town</town>
            <county>county</county>
            <postcode>postcode</postcode>
            <email>email@address.com</email>
            <phone1>01234 567890</phone1>
        </entity>
    </ns1:createEntity>
  </SOAP-ENV:Body>
</SOAP-ENV: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.local/api/accounting/soap/">
    <SOAP-ENV:Body>
        <ns1:createEntityResponse>
            <return>58</return>
        </ns1:createEntityResponse>
    </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.