thirdParty¶
Represents a customer or supplier (third-party entity). Used by both the Customers and Suppliers endpoints.
Schema¶
| Field | Type | Required | Read-only | Description |
|---|---|---|---|---|
id |
integer | — | ✓ | Internal record ID |
code |
string (max 15) | — | — | Entity code; may be supplied when creating a customer or supplier. If omitted, Gestix assigns a code. |
name |
string (1–40) | Yes | — | Primary name; not a reliable unique identifier. Different real entities may share the same name. |
name_2 |
string (max 40) | — | — | Secondary name or trading name |
vat_id |
string (max 20) | Conditional | — | Identifying data: supply VAT ID or email where either is accepted. Applicable entity/tenant rules may specifically require VAT ID; supplied values are validated. |
country_iso |
string | Yes, on creation | — | Two-letter ISO 3166-1 alpha-2 country code (e.g., PT, ES, GB). |
phone |
string (max 20) | — | — | Phone number |
mobile |
string (max 20) | — | — | Mobile number |
fax |
string (max 20) | — | — | Fax number |
email |
string (email) | Conditional | — | Identifying data: an alternative to VAT ID where either is accepted. Email is not universally mandatory; applicable entity/tenant rules determine required data and duplicate validation. |
url_link |
string (uri) | — | — | Website URL |
discount_group |
string | — | — | Assigned discount group |
salesperson |
string | — | — | Associated salesperson code |
electronic_document_interchange |
string | — | — | EDI flag or identifier |
edi_identifier |
string (max 40) | — | — | EDI identifier |
inactive |
string | — | — | Marks the entity as inactive |
comments |
string | — | — | Free-text comments |
billing_address |
postalAddress | — | — | Billing address |
shipping_address |
postalAddress | — | — | Shipping / delivery address |
Creation requirements¶
New customers and suppliers require name and top-level country_iso. Omitting country_iso was live-verified to fail validation with Especifique por favor País (CEF). Include it even when an address contains country. See Error Handling for validation messages conveyed through the HTTP status reason.
A third party created through the API must also provide sufficient identifying data according to the applicable entity/tenant validation rules. In the creation workflow where either identifier is accepted, supply vat_id or email; both are not universally required. name alone is not a reliable unique identifier because different real entities may share the same name. Supplying country_iso does not replace this identification requirement.
code is accepted on creation and can serve as a lookup key in the current implementation. A supplied code does not bypass applicable entity/tenant validation rules. Older v4 schema material marking it read-only does not describe this supported behavior.
Foreign customers¶
A foreign customer needs code, vat_id or email (without any of them: 400 Please specify VATID or email to identify the customer). A customer without a VAT number can be created with code or email; vat_id is stored as sent (for example JO126299).
{"code": "CA-0001", "name": "Example Canada Inc", "email": "billing@example.com", "country_iso": "CA",
"billing_address": {"postal_address": "1 Example Street", "city": "Ottawa", "zip_code": "K1A 0B1", "country": "CA"}}
An invoice above EUR 1,000 requires the customer's address and postal code (art. 36 CIVA), for every country. Before 7.2.03, send them in the invoice's customer.billing_address. From 7.2.03, store them on the customer, or send them in the invoice's customer.billing_address, which updates the customer; see POST /invoices.
Additional validation and current supplier routing limitation¶
Identification and record validation are separate steps. handleCustomer uses a supplied code, or otherwise VAT ID/email, to look up an entity; it does not use name as a unique lookup key.
Additional validation depends on the entity, tenant policy and deployed validation path. Some paths require email or apply email duplicate checks; customer VAT policy can also require vat_id. An email-required rejection on one path does not establish a universal email requirement, and an accepted lookup key does not guarantee that all record validation will pass. For the creation workflow accepting either identifier, provide VAT ID or email and satisfy any additional applicable rules.
EDI modes O and P also require edi_identifier when selected. Currency defaults are supplied by the application. Empty billing/shipping address objects are not saved; this path does not require telephone numbers, postal addresses or personal contacts.
Supplier routing caveat: the inspected forms_home.cpp dispatcher starts with the customer entity type and switches to supplier only for nouns beginning with purchase; suppliers is not included. Both /customers and /suppliers then invoke apiCustomers with that selected entity. Consequently, the current source routes /suppliers through customer validation/storage. The native supplier OnRowSave path would skip customer-only email/VAT checks. This is an implementation defect, not a reason to redefine suppliers as customers. Confirm the deployed routing is corrected before supplier writes; a successful response or empty GET lists alone do not establish the correct entity role.
Source evidence: external/lib_app/start_app.cpp REST version setup; executables/gnet-forms/forms_home.cpp dispatcher; web-api.cpp apiCustomers, parseCustomer, handleCustomer; external/lib_docs/doc_document.cpp entity construction; external/lib_data/data_entity.cpp OnRowSave and onCheckVATID; external/lib_data/company.cpp mandatoryVATID. No production code was changed for this documentation update.
postalAddress¶
Embedded address object used in billing_address and shipping_address.
| Field | Type | Required | Description |
|---|---|---|---|
id |
integer | — | Internal address ID (read-only) |
postal_address |
string (max 40) | — | Street address |
city |
string (max 40) | — | City |
zip_code |
string (max 40) | — | Postal / ZIP code |
country |
string | — | Country (ISO code or name) |
Example¶
{
"id": 1,
"code": "C0001",
"name": "Acme Corporation",
"name_2": "Acme",
"vat_id": "PT123456789",
"country_iso": "PT",
"phone": "+351211234567",
"mobile": "+351921234567",
"email": "billing@acme.com",
"url_link": "https://www.acme.com",
"salesperson": "JOHN",
"comments": "Key account",
"billing_address": {
"postal_address": "Rua da Liberdade 1",
"city": "Lisboa",
"zip_code": "1250-001",
"country": "PT"
},
"shipping_address": {
"postal_address": "Parque Industrial, Lote 5",
"city": "Setúbal",
"zip_code": "2900-001",
"country": "PT"
}
}