Create Company
POST https://api.codat.io/companies
Company creation should occur the moment an SMB of yours initiates the process to connect their accounting software.
- Populate the name value with the ID that you use for the company in your internal system so that it’s easier to identify the Codat company that corresponds to your record of the merchant.
- You can specify which accounting package they are using through the
platformKey
e.g.gbol
for Xero andqhyg
for QuickBooks Online - Retain the
companyId
(hereafter referred to as companyId) from the response. It is crucial that you retain this value as you will need it for directing your customers to Link and managing their connections. - Subscribe to an alert for new company connections or use a redirect parameter such as the status code to listen for a successful connection for the company once the user has been successfully authenticated.
You can read a guide on how to create a Codat company here.
Request Body
{"name"=>"{{$randomCompanyName}}", "platformType"=>"qhyg"}
RESPONSES
status: OK
{"id":"bf1e0242-5b7a-418b-a307-9e09dbf9f39a","name":"Pagac LLC","platform":"QuickBooks Online","redirect":"https://link.codat.io/company/bf1e0242-5b7a-418b-a307-9e09dbf9f39a","dataConnections":[{"id":"77238676-7bb7-49c5-b17d-b2bcc862614a","integrationId":"adeb7fe9-4c64-4848-9e0d-175317876b6f","integrationKey":"qhyg","sourceId":"d3a7993f-8165-46ef-8c61-f3c06c3ef88a","platformName":"QuickBooks Online","linkUrl":"https://link-api.codat.io/companies/bf1e0242-5b7a-418b-a307-9e09dbf9f39a/connections/77238676-7bb7-49c5-b17d-b2bcc862614a/start","status":"PendingAuth","created":"2023-02-02T10:14:56.6278146Z","sourceType":"Accounting"}],"created":"2023-02-02T10:14:56.6143407Z"}