PORTOS Developers
  • πŸ‘‹Introduction
  • πŸ“–Glossary
  • HTTP Status codes
  • Error models
  • Error codes
  • Validation constraints
  • Resource names
  • πŸ”’User rights
  • Device environments
  • 🌍Localization
  • πŸ”NData query syntax
  • OpenAPI specification
  • Data models
  • Authentication
    • πŸ”Authentication schemes
      • JWT Bearer Authentication
      • HMAC Authentication
  • ⚑Notifications
    • SignalR
    • Webhooks
  • API reference
    • πŸ”‘API keys
    • πŸ›οΈArticle categories
    • πŸ’ΌCompanies
    • πŸ’±Currencies
    • πŸ‘«Customers
    • πŸ“ˆDaily sales reports
    • πŸ–₯️Devices
    • πŸ–¨οΈFiscals
    • ❀️Health check
    • πŸ“ƒLicense
    • 🎚️Modifiers
    • πŸ‘¨β€πŸ³Order endpoints
    • πŸ›ŽοΈOrders
    • πŸͺ™Payment types
    • β˜•Plus
    • πŸ”Roles
    • πŸ”Sessions
    • βš™οΈSettings
    • πŸ”ŽStock takings
    • πŸ”’Stock transfer numbering
    • 🚚Stock transfers
    • πŸ“¦Stocks
    • 🧾Tickets
      • Ticket Model States
      • Ticket Operations and User Rights
      • Ticket Model Mathematics
    • πŸ‘¨β€πŸ’ΌUsers
    • βš–οΈVats
    • πŸͺ‘Zones
  • 3rd Party Integrations
    • Introduction
    • Online orders API
    • Rewards API
    • PDA Files
  • Previous versions
    • Migration to V4.1
    • Migration to V4
    • Legacy documentation
Powered by GitBook
On this page
  • API methods
  • Get companies
  • Get company
  • Create company
  • Create or update company
  • Delete company

Was this helpful?

  1. API reference

Companies

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

PreviousArticle categoriesNextCurrencies

Last updated 1 year ago

Was this helpful?

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 class.

API methods

Get companies

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

Returns all companies that matches query parameters. Result is of type .

Query Parameters

Name
Type
Description

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

Name
Type
Description

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}

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

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
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Create company

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

Required rights

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(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}

Required rights

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(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

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

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
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Result is of type .

Creates new company. Result is of type .

Authorized user must have CompanyCreate assigned.

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

Authorized user must have assigned CompanyCreate or CompanyUpdate .

Authorized user must have CompanyDelete assigned.

πŸ’Ό
right
right
right
Company
QueryResult<Company>
Company
Company
Company