Connecting to the Cin7 Core API

Connecting to the Cin7 Core API

Cin7 Core API is part of Cin7 Core web application at https://inventory.dearsystems.com. You will need to create an account there before you can use the API. Trial accounts are also allowed to access the API.

Note: Cin7 Core API V2 has been released! Please consider migrating to V2 version as it has more advanced functionality and covers all recent system changes. You can find documentation for API V2 at https://dearinventory.docs.apiary.io/#

To use the API you will need your Cin7 Core Account ID and API Application key. These can be created on the API setup page inside Cin7 Core application: https://inventory.dearsystems.com/ExternalAPI.

Each company that you have access to in Cin7 Core will have a different Cin7 Core Account ID. You can have multiple API Applications created on the same Cin7 Core account. This allows you to link different applications/add-ons to Cin7 Core, since API limits are applied on per API Application basis.

IMPORTANT! Your Account ID and API Application Key are equivalent to a login and password. They must be kept secret and not shared in any way.

Each request to the API must include these two values sent as HTTP headers:

api-auth-accountid - You must send your Account ID in this header.

api-auth-applicationkey - You must send API Application Key in this header.

PHP sample:

$account_id = 'youraccountid';
$application_key = 'applicationkey'; $naked_dear_url = 'https://inventory.dearsystems.com/ExternalApi/SaleList'; $data = array ('Page' => '1', 'Limit' => '100');
$data = http_build_query($data); $context_options = array (
        'http' => array (
            'method' => 'GET',
            'header'=> "Content-type: application/json\r\n"
                . "Content-Length: " . strlen($data) . "\r\n"
                . "api-auth-accountid: " . $account_id . "\r\n"
                . "api-auth-applicationkey: " . $application_key . "\r\n",
            'content' => $data
            )
        );

C# sample:

using (var httpClient = new HttpClient{ BaseAddress = "https://inventory.dearsystems.com/ExternalApi" })
{
  httpClient.DefaultRequestHeaders.Add("api-auth-accountid", "your_key");   
httpClient.DefaultRequestHeaders.Add("api-auth-applicationkey", "your_key");

  using(var response = await httpClient.GetAsync("SaleList"))
  {
    string responseData = await response.Content.ReadAsStringAsync();
  }
}

Was this article helpful?

Have more questions? Submit a request