# Companies Catalog

# Search all companies

To perform this operation, you must be authenticated by means of one of the following methods: sessionAuth

# GET /companies

Parameters

Name In Type Required Description
page query integer false Page
Default: 1
resultsPerPage query integer false Results per page
Default: 25
Maximum: 100
dateModifiedFrom query string(date-time) false Date modified from
Example: 2016-01-16 00:00:00
dateModifiedTo query string(date-time) false Date modified to
Example: 2016-02-16 23:59:59
clientCodes query string false Client codes in JSON format
Example: ["code1","code2"]
Maximum: 100

# Response example:

200 Response

{
  "totalResultsAvailable": 0,
  "firstResultPosition": 0,
  "resultsPerPage": 0,
  "results": [
    {
      "clientCode": "string",
      "name": "string",
      "statusCode": "ACTIVE",
      "companyRoles": [
        "string"
      ],
      "headOfficeName": "string",
      "headOfficeDescription": "string",
      "dateCreated": "string",
      "creator": "string",
      "dateModified": "string",
      "modifier": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK (opens new window) Successful response Companies

Code examples:

# You can also use wget
curl -X GET /api/rest/1.0/companies \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/rest/1.0/companies',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/rest/1.0/companies', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

# Get details of a contact company

To perform this operation, you must be authenticated by means of one of the following methods: sessionAuth

# GET /companies/contact/{clientCode}

Parameters

Name In Type Required Description
clientCode path string true Resource client code

Response examples:

200 Response

{
  "clientCode": "string",
  "name": "string",
  "statusCode": "ACTIVE",
  "companyRoles": [
    "string"
  ],
  "headOfficeName": "string",
  "headOfficeDescription": "string",
  "dateCreated": "string",
  "creator": "string",
  "dateModified": "string",
  "modifier": "string"
}

Responses

Status Meaning Description Schema
200 OK (opens new window) Successful response CompanyBase

Code examples:

# You can also use wget
curl -X GET /api/rest/1.0/companies/contact/{clientCode} \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/rest/1.0/companies/contact/{clientCode}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/rest/1.0/companies/contact/{clientCode}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

# Create or update a contact company and its head office

To perform this operation, you must be authenticated by means of one of the following methods: sessionAuth

# PUT /companies/{clientCode}

Parameters

Name In Type Required Description
clientCode path string true Resource client code
body body Company true none

# Response example:

200 Response

{
  "name": "string",
  "headOffice": {
    "name": "string",
    "description": "string",
    "contact": {
      "addresses": [
        {
          "isPreferred": true,
          "address": "string",
          "city": "string",
          "state": "string",
          "postalCode": "string",
          "countryCode": "US",
          "addressTypeCode": "WORK"
        }
      ],
      "emails": [
        {
          "isPreferred": true,
          "address": "string",
          "emailTypeCode": "WORK"
        }
      ],
      "urls": [
        {
          "isPreferred": true,
          "address": "string",
          "urlTypeCode": "WORK"
        }
      ],
      "phones": [
        {
          "isPreferred": true,
          "phoneNumber": "string",
          "phoneTypeCode": "WORK"
        }
      ]
    }
  }
}

Responses

Status Meaning Description Schema
200 OK (opens new window) Resource Updated Company
201 Created (opens new window) Resource Created Company

Code examples:

# You can also use wget
curl -X PUT /api/rest/1.0/companies/{clientCode} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

const inputBody = '{
  "name": "string",
  "headOffice": {
    "name": "string",
    "description": "string",
    "contact": {
      "addresses": [
        {
          "isPreferred": true,
          "address": "string",
          "city": "string",
          "state": "string",
          "postalCode": "string",
          "countryCode": "US",
          "addressTypeCode": "WORK"
        }
      ],
      "emails": [
        {
          "isPreferred": true,
          "address": "string",
          "emailTypeCode": "WORK"
        }
      ],
      "urls": [
        {
          "isPreferred": true,
          "address": "string",
          "urlTypeCode": "WORK"
        }
      ],
      "phones": [
        {
          "isPreferred": true,
          "phoneNumber": "string",
          "phoneTypeCode": "WORK"
        }
      ]
    }
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/api/rest/1.0/companies/{clientCode}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','/api/rest/1.0/companies/{clientCode}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

{
  "name": "string",
  "headOffice": {
    "name": "string",
    "description": "string",
    "contact": {
      "addresses": [
        {
          "isPreferred": true,
          "address": "string",
          "city": "string",
          "state": "string",
          "postalCode": "string",
          "countryCode": "US",
          "addressTypeCode": "WORK"
        }
      ],
      "emails": [
        {
          "isPreferred": true,
          "address": "string",
          "emailTypeCode": "WORK"
        }
      ],
      "urls": [
        {
          "isPreferred": true,
          "address": "string",
          "urlTypeCode": "WORK"
        }
      ],
      "phones": [
        {
          "isPreferred": true,
          "phoneNumber": "string",
          "phoneTypeCode": "WORK"
        }
      ]
    }
  }
}

# Delete or deactivate a contact company

To perform this operation, you must be authenticated by means of one of the following methods: sessionAuth

# DELETE /companies/{clientCode}

Parameters

Name In Type Required Description
clientCode path string true Resource client code

# Response example:

200 Response

{
  "clientCode": "string",
  "statusCode": "ACTIVE"
}

Responses

Status Meaning Description Schema
200 OK (opens new window) Successful response ResourceStatus

Code examples:

# You can also use wget
curl -X DELETE /api/rest/1.0/companies/{clientCode} \
  -H 'Accept: application/json'


const headers = {
  'Accept':'application/json'
};

fetch('/api/rest/1.0/companies/{clientCode}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/api/rest/1.0/companies/{clientCode}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...