๐Ÿ’ผCompanies

This page provides a description of the available API routes for managing companies.

Suppliers and purchasers are commonly referred to as companies, and within the companies database, there exists an additional record marked as "default" that represents the merchant, owner or the cash register system.

Company is represented by Company class.

API methods

Get companies

GET http://{server-address}/companies

Returns all companies that matches query parameters. Result is of type QueryResult<Company>.

Query Parameters

NameTypeDescription

id

string

Supports NData syntax.

crn

string

Supports NData syntax.

$skip

int

Pagination property. Describing number of records to skip from beginning of result collection.

$take

int

Pagination property. Maximum count of items to be returned.

$sort

string[]

Comma separated list of property names. Please see NData syntax.

$count

bool

If set to true, response will not contain items collection. Use to get resource count, not the resources themselves.

discountRate

decimal

Supports NData syn

name

string

Supports NData syntax.

isDefault

bool

Supports NData syntax.

isActive

bool

Supports NData syntax.

isTaxPayer

bool

Supports NData syntax.

type

CompanyType

Supports NData syntax.

taxId

string

Supports NData syntax.

vatId

string

Supports NData syntax.

dueDays

int

Supports NData syntax.

search

string

Supports NData syntax.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "items":
    [
        {
            "id": "62db00718d4c4f2c700bbc5b",
            "isActive": true,
            "name": "My supplier",
            "crn": "123",
            "vatId": "SK1020304050",
            "taxId": "1020304050",
            "isTaxPayer": true,
            "register": "reg v OR OS Bratislava I, vl.ฤ. 12345/B",
            "dueDays": 0,
            "type": "Supplier",
            "discountRate": 0.0,
            "isDefault": false,
            "addresses":
            [
                {
                    "street": "Hlavnรก 4",
                    "city": "Bratislava",
                    "zipCode": "81101",
                    "country": "Slovensko",
                    "type": "Office"
                },
                {
                    "street": "Dodacia 11",
                    "city": "Bratislava",
                    "zipCode": "81102",
                    "country": "Slovensko",
                    "type": "Shipping"
                }
            ],
            "bankAccounts":
            [
                {
                    "bankCountry": "Slovensko",
                    "bankName": "Tatra banka, a.s.",
                    "iban": "SK0011000000000000000000",
                    "number": null,
                    "swift": "TATRSKBXXXX",
                    "isDefault": true
                }
            ],
            "contacts":
            [
                {
                    "fax": null,
                    "phone": null,
                    "mobile": "+421 900 123 123",
                    "email": "john.doe@suppliercompany.portos",
                    "isDefault": true,
                    "name": "John",
                    "surname": "Doe",
                    "note": null
                }
            ],
            "_v": 1
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get company

GET http://{server-address}/companies/{id}

Result is of type Company.

Path Parameters

NameTypeDescription

id*

string

Unique identifier.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "id": "62db00718d4c4f2c700bbc5b",
    "isActive": true,
    "name": "My supplier",
    "crn": "123",
    "vatId": "SK1020304050",
    "taxId": "1020304050",
    "isTaxPayer": true,
    "register": "reg v OR OS Bratislava I, vl.ฤ. 12345/B",
    "dueDays": 0,
    "type": "Supplier",
    "discountRate": 0.0,
    "isDefault": false,
    "addresses":
    [
        {
            "street": "Hlavnรก 4",
            "city": "Bratislava",
            "zipCode": "81101",
            "country": "Slovensko",
            "type": "Office"
        },
        {
            "street": "Dodacia 11",
            "city": "Bratislava",
            "zipCode": "81102",
            "country": "Slovensko",
            "type": "Shipping"
        }
    ],
    "bankAccounts":
    [
        {
            "bankCountry": "Slovensko",
            "bankName": "Tatra banka, a.s.",
            "iban": "SK0011000000000000000000",
            "number": null,
            "swift": "TATRSKBXXXX",
            "isDefault": true
        }
    ],
    "contacts":
    [
        {
            "fax": null,
            "phone": null,
            "mobile": "+421 900 123 123",
            "email": "john.doe@suppliercompany.portos",
            "isDefault": true,
            "name": "John",
            "surname": "Doe",
            "note": null
        }
    ],
    "_v": 1
}

Create company

POST http://{server-address}/companies

Creates new company. Result is of type Company.

Required rights

Authorized user must have CompanyCreate right assigned.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

Company

Model to create.

{
    "id": "62db00718d4c4f2c700bbc5b",
    "isActive": true,
    "name": "My supplier",
    "crn": "123",
    "vatId": "SK1020304050",
    "taxId": "1020304050",
    "isTaxPayer": true,
    "register": "reg v OR OS Bratislava I, vl.ฤ. 12345/B",
    "dueDays": 0,
    "type": "Supplier",
    "discountRate": 0.0,
    "isDefault": false,
    "addresses":
    [
        {
            "street": "Hlavnรก 4",
            "city": "Bratislava",
            "zipCode": "81101",
            "country": "Slovensko",
            "type": "Office"
        },
        {
            "street": "Dodacia 11",
            "city": "Bratislava",
            "zipCode": "81102",
            "country": "Slovensko",
            "type": "Shipping"
        }
    ],
    "bankAccounts":
    [
        {
            "bankCountry": "Slovensko",
            "bankName": "Tatra banka, a.s.",
            "iban": "SK0011000000000000000000",
            "number": null,
            "swift": "TATRSKBXXXX",
            "isDefault": true
        }
    ],
    "contacts":
    [
        {
            "fax": null,
            "phone": null,
            "mobile": "+421 900 123 123",
            "email": "john.doe@suppliercompany.portos",
            "isDefault": true,
            "name": "John",
            "surname": "Doe",
            "note": null
        }
    ],
    "_v": 1
}

Create or update company

PUT http://{server-address}/companies/{id}

Creates new or updates existing company. Result is of type Company.

Required rights

Authorized user must have assigned CompanyCreate or CompanyUpdate right.

Path Parameters

NameTypeDescription

id*

string

Unique identifier.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

Company

Model to create or update.

{
    "id": "62db00718d4c4f2c700bbc5b",
    "isActive": true,
    "name": "My supplier",
    "crn": "123",
    "vatId": "SK1020304050",
    "taxId": "1020304050",
    "isTaxPayer": true,
    "register": "reg v OR OS Bratislava I, vl.ฤ. 12345/B",
    "dueDays": 0,
    "type": "Supplier",
    "discountRate": 0.0,
    "isDefault": false,
    "addresses":
    [
        {
            "street": "Hlavnรก 4",
            "city": "Bratislava",
            "zipCode": "81101",
            "country": "Slovensko",
            "type": "Office"
        },
        {
            "street": "Dodacia 11",
            "city": "Bratislava",
            "zipCode": "81102",
            "country": "Slovensko",
            "type": "Shipping"
        }
    ],
    "bankAccounts":
    [
        {
            "bankCountry": "Slovensko",
            "bankName": "Tatra banka, a.s.",
            "iban": "SK0011000000000000000000",
            "number": null,
            "swift": "TATRSKBXXXX",
            "isDefault": true
        }
    ],
    "contacts":
    [
        {
            "fax": null,
            "phone": null,
            "mobile": "+421 900 123 123",
            "email": "john.doe@suppliercompany.portos",
            "isDefault": true,
            "name": "John",
            "surname": "Doe",
            "note": null
        }
    ],
    "_v": 2
}

Delete company

DELETE http://{server-address}/companies/{id}

Required rights

Authorized user must have CompanyDelete right assigned.

Path Parameters

NameTypeDescription

id*

string

Unique identifier.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "id": "62db00718d4c4f2c700bbc5b",
    "isActive": true,
    "name": "My supplier",
    "crn": "123",
    "vatId": "SK1020304050",
    "taxId": "1020304050",
    "isTaxPayer": true,
    "register": "reg v OR OS Bratislava I, vl.ฤ. 12345/B",
    "dueDays": 0,
    "type": "Supplier",
    "discountRate": 0.0,
    "isDefault": false,
    "addresses":
    [
        {
            "street": "Hlavnรก 4",
            "city": "Bratislava",
            "zipCode": "81101",
            "country": "Slovensko",
            "type": "Office"
        },
        {
            "street": "Dodacia 11",
            "city": "Bratislava",
            "zipCode": "81102",
            "country": "Slovensko",
            "type": "Shipping"
        }
    ],
    "bankAccounts":
    [
        {
            "bankCountry": "Slovensko",
            "bankName": "Tatra banka, a.s.",
            "iban": "SK0011000000000000000000",
            "number": null,
            "swift": "TATRSKBXXXX",
            "isDefault": true
        }
    ],
    "contacts":
    [
        {
            "fax": null,
            "phone": null,
            "mobile": "+421 900 123 123",
            "email": "john.doe@suppliercompany.portos",
            "isDefault": true,
            "name": "John",
            "surname": "Doe",
            "note": null
        }
    ],
    "_v": 1
}

Last updated