Create a company

Add a connectable company to your office. Before making a POST request to create a company in your office, you might find it useful to look at the accounting systems that are connected to it and list the available connectable companies.

POST companies

Request details

The post request will contain all the required information to create a company in your office.

Request properties

Property Type Description Optional
AccountingSystemId Guid Unique identifier of the accounting system. No
ExternalId string Unique identifier of the company in the accounting system. No
LocalPartEmailCode string Local part email code used for creating an email account to upload documents (the default email address is constructed as "officecode.LocalPartEmailCode", or "officecode.companycode" if none is specified, with Basecone specific domain.). Maximum length is 10 characteres. Yes
Code string Company Code (only used for Stand Alone accounting systems). Maximum length is 100 characteres. Yes (except for StandAlone accounting systems, which is mandatory)
Name string Company Code (only used for Stand Alone accounting systems). Maximum length is 100 characteres. Yes (except for StandAlone accounting systems, which is mandatory)

Example request

{
  "accountingSystemId": "2c8a828d-179a-403d-82cd-926d37aba8bb",
  "externalId": "1",
  "localPartEmailCode": "email code",
  "Code": "code",
  "Name": "name"
}

Response

Upon successful creation of a company in the Basecone system, a 201 http status code will be returned together with the newly created CompanyId unique identifier. If something goes wrong, an error message with failure details will be given together with a suitable http error status code.

Example response

{
  "companyId": "52a4471b-8cb4-4a13-981f-86a30b72feff"
}

Possible error responses

Status code Error code Details
400 invalid_request_payload Create company request cannot be null
400 invalid_request_payload Office id cannot be empty
400 invalid_request_payload Accounting System ID doesn't exist in the office.
400 invalid_request_payload ExternalId doesn't exist in the accounting system.
403 forbidden User is not allowed to the office
403 forbidden User is not allowed to create company