Companies


API documentation for working with companies

Table with field descriptions:

Field Type Required? Description
id int No Unique company identifier (required when updating).
companyownerid int Yes Company owner ID. https://admin.ecom.md/ru/admin/users/user/
manager_id int No Company manager ID. https://admin.ecom.md/ru/admin/users/user/
company_name string Yes Company name.
vat_rate decimal No VAT rate.
vat_number string No VAT payer number.
legal_address string Yes Legal address of the company.
physical_address string No Physical address of the company.
bank_name string No Company bank name.
fiscal_code string No Unique fiscal code of the company.
bank_code string No Bank code.
iban string No Company bank account (IBAN).
cif string No Company CIF code.
registration_number string No Company registration number.
region string No Company region.
locality string No Localization of the company (for example, city).
use_vat boolean Yes Does the company use VAT?
credit_limit decimal No Company credit limit.
balance decimal No Company balance sheet.
groupcodeid string No Unique company ID in the client's system

1. Getting all companies

Method: GET
URL: {domain}/external/company/

Description:
Returns a list of all companies on the site.
A filter is available by the date of the last update last_update.

Example of a query with a filter:

GET {domain}/external/company/?last_update=1749798794

Example answer:

[
    {
        "id": 1,
        "company_owner_id": 177581,
        "manager_id": 177581,
        "company_name": "Test",
        "vat_rate": "55.55",
        "vat_number": "555555",
        "legal_address": "Socoleni 9",
        "physical_address": "",
        "bank_name": "MICB",
        "fiscal_code": "FISCAL_CODE_123",
        "bank_code": "BANK_CODE_123",
        "iban": "QWEWRTYU12345",
        "cif": "20000000000",
        "registration_number": "2900000000",
        "region": "Ciocana",
        "locality": "Chisinau",
        "use_vat": false,
        "credit_limit": "555.00",
        "balance": "55555.00"
    }
]

2. Receipt of one company

Method: GET
URL: {domain}/external/company/{id}/

Description:
Returns data for one company by its unique identifier.

Query example:

GET {domain}/external/company/1/

Example answer:

{
    "id": 1,
    "company_owner_id": 177581,
    "company_owner_id": 33333,
    "company_name": "Test",
    "vat_rate": "55.55",
    "vat_number": "555555",
    "legal_address": "Socoleni 9",
    "physical_address": "",
    "bank_name": "MICB",
    "fiscal_code": "FISCAL_CODE_123",
    "bank_code": "BANK_CODE_123",
    "iban": "QWEWRTYU12345",
    "cif": "20000000000",
    "registration_number": "2900000000",
    "region": "Ciocana",
    "locality": "Chisinau",
    "use_vat": false,
    "credit_limit": "555.00",
    "balance": "55555.00"
}

3. Creation of several companies

Method: POST
URL: {domain}/external/company/bulk-create/

Description:
Creates several companies at the same time.

Query example:

POST {domain}/external/company/bulk-create/
Content-Type: application/json

Request body:

[
    {
        "company_owner_id": 177582,
        "company_name": "New Company 1",
        "vat_rate": "50.00",
        "vat_number": "123456",
        "legal_address": "Str. Test 1",
        "physical_address": "Str. Test 1",
        "bank_name": "BANCA_1",
        "fiscal_code": "CODE_123",
        "bank_code": "BANK_CODE_1",
        "iban": "IBAN_1",
        "cif": "CIF_123",
        "registration_number": "REG_1",
        "region": "Buiucani",
        "locality": "Chisinau",
        "use_vat": true,
        "credit_limit": "2000.00",
        "balance": "100000.00"
    },
    {
        "company_owner_id": 177583,

"companyname": "New Company 2", "vatrate": "60.00", "vatnumber": "654321", "legaladdress": "Str. Test 2", "physicaladdress": "Str. Test 2", "bankname": "BANCA2", "fiscalcode": "CODE456", "bankcode": "BANKCODE2", "iban": "IBAN2", "cif": "CIF456", "registrationnumber": "REG2", "region": "Botanica", "locality": "Chisinau", "usevat": false, "creditlimit": "3000.00", "balance": "200000.00" } ]

Example answer:

[
    {
        "id": 2,
        "company_owner_id": 177582,
        "company_name": "New Company 1",
        "vat_rate": "50.00",
        "vat_number": "123456",
        "legal_address": "Str. Test 1",
        "physical_address": "Str. Test 1",
        "bank_name": "BANCA_1",
        "fiscal_code": "CODE_123",
        "bank_code": "BANK_CODE_1",
        "iban": "IBAN_1",
        "cif": "CIF_123",
        "registration_number": "REG_1",
        "region": "Buiucani",
        "locality": "Chisinau",
        "use_vat": true,
        "credit_limit": "2000.00",
        "balance": "100000.00"
    },
    {
        "id": 3,
        "company_owner_id": 177583,
        "company_name": "New Company 2",
        "vat_rate": "60.00",
        "vat_number": "654321",
        "legal_address": "Str. Test 2",
        "physical_address": "Str. Test 2",
        "bank_name": "BANCA_2",
        "fiscal_code": "CODE_456",
        "bank_code": "BANK_CODE_2",
        "iban": "IBAN_2",
        "cif": "CIF_456",
        "registration_number": "REG_2",
        "region": "Botanica",
        "locality": "Chisinau",
        "use_vat": false,
        "credit_limit": "3000.00",
        "balance": "200000.00"
    }
]

4. Multiple company update

Method: PUT
URL: {domain}/external/company/bulk-update/

Description:
Updates data for several companies simultaneously.

Query example:

PUT {domain}/external/company/bulk-update/
Content-Type: application/json

Request body:

[
    {
        "id": 1,
        "company_name": "Updated Company 1",
        "credit_limit": "7000.00",
        "balance": "150000.00"
    },
    {
        "id": 2,
        "company_name": "Updated Company 2",
        "credit_limit": "5000.20",
        "balance": "220000.00"
    }
]

Example answer:

[
    {
        "id": 1,
        "company_name": "Updated Company 1",
        "credit_limit": "7000.00",
        "balance": "150000.00"
    },
    {
        "id": 2,
        "company_name": "Updated Company 2",
        "credit_limit": "5000.20",
        "balance": "220000.00"
    }
]

Was the article helpful?

Yes, thank you! Unfortunately no

article.helpfulQuestion