Contacts
Agenda de contacte / clienți.
Returns a paginated list of clients (agendă firme rows where is_client = 1).
Standard filters: modifiedafter, modifiedthrough, id, minid, page (date filters use lastupdated).
Search filters (use them to find a client before adding a document for it):
- contact_vat_id:{CUI} — matches on the digits of the VAT / CUI code (RO123 and 123 both match).
- contact_email:{email} — exact e-mail match (URL-encode it).
- contact_phone:{phone} — exact match on phone 1 or phone 2, as sent or normalised (+40… → 0040…).
- contact_name:{text} — name contains the text (URL-encode it).
Include:
- pricelist — adds pricelist_id and pricelist_name to each row. Falls back to the client's group pricelist when the contact has no direct pricelist.
- address — adds addresses[] array (all non-deleted delivery/invoice addresses).
- contacts — adds contacts[] array (linked contact persons).
- banks — adds bank_accounts[] array (linked bank accounts with currency).
Example: /contacts/list/modifiedafter:2024-01-01/include:address,pricelist/
Responses
| Status | Description |
|---|---|
200 |
OK — response uses the shared envelope. |
400 |
Request is malformed or a required field is missing / invalid. |
401 |
Missing or invalid Basic Auth credentials. |
Returns the client to use as client_id when adding a document (for example POST /devize/).
An existing contact is returned unchanged (created: 0) when:
- vat_id has more than 5 characters and a non-deleted contact has the same CUI, or
- no vat_id is sent and a contact matches every word of name together with the same email, or with the same phone (0040…, 40…, +40… and 0… forms all match).
Otherwise a new contact is created from the request (created: 1). Send email or phone for private persons so that a retry finds the client instead of creating a duplicate. In both cases the contact is marked as a client, so it appears in /contacts/list/.
Permission: the API key needs an explicit POST grant on the contacts route (Integrări → BOCP REST API → key → routes). Keys without it receive 403.
Request body (JSON)
{
"name": "Exemplu SRL",
"vat_id": "RO12345678",
"registration_number": "J40/123/2020",
"email": "office@exemplu.ro",
"phone": "+40721000000",
"is_company": 1,
"invoice_address": {
"street": "Strada Exemplu",
"number": "10",
"city": "Cluj-Napoca",
"zip": "400001",
"county": "Cluj",
"country": "Romania"
}
}
Responses
| Status | Description |
|---|---|
200 |
OK. `data` = {`bocp_id`, `name`, `vat_id`, `created`, plus `invoice_address_id` / `delivery_address_id` when those blocks were sent}. |
400 |
Request is malformed or a required field is missing / invalid. |
401 |
Missing or invalid Basic Auth credentials. |
Returns the details of one contact (agendă firme row), formatted using the shared client-data helper.
Include:
- pricelist — adds pricelist_id and pricelist_name to the response. Falls back to the client's group pricelist.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
contact_id |
path | integer | yes |
Responses
| Status | Description |
|---|---|
200 |
OK — response uses the shared envelope. |
404 |
The requested resource does not exist. |
This page is generated from openapi.json.