๐ผ CompaniesThis 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
Name Type Description Pagination property. Describing number of records to skip from beginning of result collection.
Pagination property. Maximum count of items to be returned.
Comma separated list of property names. Please see NData syntax.
If set to true
, response will not contain items
collection. Use to get resource count, not the resources themselves.
Name Type Description Authorization header with authorization token.
200: OK Successful response
Copy {
"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
Name Type Description Authorization header with authorization token.
200: OK Resource found. 404: Not Found Given resource was not found.
Copy {
"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
}
Copy {
"title" : "Zdroj nebol nรกjdenรฝ" ,
"status" : 404
}
Create company
POST
http://{server-address}/companies
Creates new company. Result is of type Company .
Required rights
Authorized user must have CompanyCreate
right assigned.
Name Type Description Authorization header with authorization token.
Request Body
201: Created Successfuly created.
Copy {
"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
Name Type Description Authorization header with authorization token.
Request Body
Name Type Description Model to create or update.
200: OK Successfuly created or updated.
Copy {
"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
Name Type Description Authorization header with authorization token.
200: OK Successfuly deleted. 404: Not Found Given resource was not found.
Copy {
"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
}
Copy {
"title" : "Zdroj nebol nรกjdenรฝ" ,
"status" : 404
}