docs
  1. SCAYLE Resource Center
  2. Developer Guides
  3. Multiple Legal Entities
  4. Manage Legal Entities

Manage Legal Entities

General

A company in SCAYLE represents a legal entity within your business system. Each shop you create is linked to a company.

By default, your SCAYLE account starts with just one company. But, if needed, you can add more.

Admin API

Create a Company

It is only required to provide a name to create a new company.

let company = {
    name: "My Company"
};

let response = await adminApi.apis.Companies.createCompany({}, {requestBody: company});
company = response.body;

console.log(company.id);

Update a Company

SCAYLE allows you to change the company name.

ParameterDetails
id

Integer READ-ONLY

The ID of the company created by SCAYLE.

name

String

Name of the company.

let response = await adminApi.apis.Companies.getCompany({companyId: 1});
let company = response.body;

company.name = "My Company";

response = await adminApi.apis.Companies.updateCompany({companyId: company.id}, {requestBody: company});
company = response.body;

console.log(company.name);

Get a Company

This method can be used to get an existing company by its ID.

ParameterDetails
id

Integer READ-ONLY

The ID of the company created by SCAYLE.

name

String

Name of the company.

let response = await adminApi.apis.Companies.getCompany({companyId: 1});
let company = response.body;

Get a Collection of Companies

You can configure number of companies returned by SCAYLE.

Options

ParameterDetails
limit

Integer

Maximum number of items in the result. (default: 100, maximum: 1000)

filters[id]

String

Comma-separated list of company IDs that should be used for filtering.

filters[minId]

Integer

Minimum ID of companies that should be returned.

filters[maxId]

Integer

Maximum ID of companies that should be returned.

ParameterDetails
entities

Company

A collection of companies.

cursor

Cursor

An object containing information for use in pagination.

Examples

let response = await adminApi.apis.Companies.getCompanies({limit: 10});
let companies = response.body.entities;

companies.forEach(
  company => console.log(company.name)
);