2

To simulate an accountancy environment, I need to create at least 100 of Exact Online companies (divisions, administraties, dossiers). This can be achieved using a manual action, repeated 100 times. And repeated across 7 countries. In totaal 700 times approximately one minute.

Is there a way to create these numbers of companies automatically through either the REST or XML API?

The documentation on REST API does not list POST possibilities; the XML API does not describe anything about what upload/download features are applicable.

Guido Leenders
  • 4,232
  • 1
  • 23
  • 43

1 Answers1

2

Exact Online support explained me that there is a way, used by portals of large accountants.

The Administrations topic on XML supports to some extent the creation of companies. It does not matter into which company you upload the XML for a new Exact Online company, it gets added as an independent company.

Code sample to create 100 companies, having a human number 501..600:

insert into UploadXMLTopics 
( topic
, payload
, division_code
, orig_system_reference
, orig_system_group
)
select 'Administrations'
,      '<?xml version="1.0" encoding="utf-8"?>
<eExact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="eExact-XML.xsd">
    <Administrations>
        <Administration number="' || 500+id || '">
            <Name>Leeg ' || id || '</Name>
            <AddressLine1>Harm Buiterplein ' || id || '</AddressLine1>
            <Postcode>2501 TH</Postcode>
            <City>Den Haag</City>
            <State code="ZH" />
            <Country code="NL" />
            <Currency code="EUR" />
            <Phone>0351448695</Phone>
            <Fax>0351448690</Fax>
            <Email>info@leeg' || id || '.nl</Email>
            <HomePage>www.leeg.nl</HomePage>
            <ChamberOfCommerce>12411369</ChamberOfCommerce>
            <COCEstablishmentNumber>99</COCEstablishmentNumber>
            <ActivitySector code="A" />
            <ActivitySubSector code="01" />
            <SBICode code="014" />
            <CompanySize code="G" />
            <BusinessType code="51" />
            <StartDate>2015-05-13</StartDate>
            <BlockingStatus>0</BlockingStatus>
        </Administration>
    </Administrations>
</eExact>'
,      sdn.code
,      'Create-admin-' || id
,      'Create-admin'
from   exactonlinexml..calendar clr
join   ( select min(code) code from exactonlinerest..systemdivisions ) sdn
where  clr.id between 1 and 100
Guido Leenders
  • 4,232
  • 1
  • 23
  • 43