Card and company details
Client card
GET https://do.workzeal.com/company/get?id=368132
Returns the entire client in a single request: the main card fields, all emails and phones, company details, and contact persons with their contact information. This is convenient for checking what the record already has before adding to it.
Query Parameters
| Name | Type | Description |
|---|---|---|
| id | Int | Client ID |
Response
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "{
\"company\": { \"id\": 368132, \"name\": \"Prodstar\", \"person\": 1, \"address\": \"...\", \"url\": \"...\", \"user_id\": 37, \"type_id\": 1, \"status_id\": 3, ... },
\"emails\": [ { ...email... } ],
\"phones\": [ { ...phone... } ],
\"requisites\": [ { ...company details... } ],
\"contacts\": [ { ...contact person with Phones/Emails... } ]
}"
}
// status "Error" - the client was not found or has been deleted
The company fields match the columns of the list of clients. emails and phones also include the addresses and phones of contact persons: those entries have id_contact_man filled in.
Adding company details
POST https://do.workzeal.com/company/requisites/insert
Adds company details to a legal entity: codes, addresses, the director, the bank. The client's first set of company details becomes the primary one, and the tax_id filter in the list of clients works by it.
Request Body
| Name | Type | Description |
|---|---|---|
| id_company* | Int | Client ID |
| inn, kpp, ogrn_client, okpo, okved, oktmo, okato | String | Codes |
| kr_name, full_name | String | Short and full name with the form of ownership |
| adres_yur, adres_fact, pocht_adr | String | Legal, actual, and mailing addresses |
| dir_name, dir_status | String | Director and position |
| gl_buh | String | Chief accountant |
| bank_name, bik, ks, rs | String | Bank, BIK, correspondent and settlement accounts |
| requis_prim | String | Note |
| use_default | String | True means primary company details. If not passed: True for the client's first set of company details, otherwise False |
{
"id_company": 368132,
"inn": "7801234567",
"kpp": "780101001",
"ogrn_client": "1027800000000",
"kr_name": "Prodstar LLC",
"full_name": "Prodstar Limited Liability Company",
"adres_yur": "1 Sample St, New York, NY",
"dir_name": "John Smith",
"dir_status": "CEO"
}
The same fields are accepted by the Paymentdetails block when adding a client: the company details are created together with the company.
Example
curl --location --request POST 'https://do.workzeal.com/company/requisites/insert' \
--header 'Authorization: Bearer XXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"id_company": 368132,
"inn": "7801234567",
"kpp": "780101001",
"kr_name": "Prodstar LLC"
}'
Response
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "5120"
}
// value - ID of the new company details, 0 - error (the text is in the error field)