# Relations

> A company or person Fledge deals with (relatie), shared by all administrations: customers, suppliers, prospects, employees, manufacturers.

Subject: Relations.

A company or person Fledge deals with (relatie), shared by all administrations: customers, suppliers, prospects, employees, manufacturers. A relation is not a customer: the customer is its Debtors row in one administration, the supplier its Creditors row.

Label in Fledge: Relaties.

| | |
| --- | --- |
| URL | `https://odata-api.fledge.nl/v2-8/Relations` |
| Key | `relation_id` |
| Administration-specific | no |
| Operations | GET list, GET one, POST, PATCH, DELETE |
| Read licenses | BASIS, BASISAPP, URENPC |
| Write licenses | BASIS, BASISAPP |
| Scopes | FLEDGE_PORTAL, FLEDGE_TERMINAL |

> **Watch out:** is_debtor can be out of date. To find customers, query Debtors (per administration) or filter relations with Debtors/any(d: d/administration_id eq <administration>).

> **Watch out:** is_creditor can be out of date. To find suppliers, query Creditors (per administration) or filter relations with Creditors/any(c: c/administration_id eq <administration>).

> **Watch out:** has_invoices means "active relation?", not whether the relation has invoices.

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/Relations?$select=relation_id,city,company_name_1,country_code_id&$top=50
GET https://odata-api.fledge.nl/v2-8/Relations({relation_id})
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `relation_id` (key) | Int32, not null | Relatie |
| `agent_id` | Int32 | verwijzing naar de tabel agnt (agent) |
| `budget_id` | Int32 | Budgetnummer |
| `chamber_of_commerce_number` | String | kvk-nummer: Kamer van koophandel nummer |
| `city` | String | Plaats. A copy of the city of the primary visit address. Use RelationAddresses for addresses. |
| `company_name_1` | String | Bedrijfsnaam. The name. company_name_2 and company_name_3 continue it. |
| `company_name_2` | String | Bedrijfsnaam |
| `company_name_3` | String | Bedrijfsnaam |
| `country_code_id` | Int32 | Landcode. A copy of the country of the primary visit address. |
| `custom_field_1` | String | Vrije veld 1 |
| `custom_field_10` | String | Vrije veld 10 |
| `custom_field_2` | String | Vrije veld 2 |
| `custom_field_3` | String | Vrije veld 3 |
| `custom_field_4` | String | Vrije veld 4 |
| `custom_field_5` | String | Vrije veld 5 |
| `custom_field_6` | String | Vrije veld 6 |
| `custom_field_7` | String | Vrije veld 7 |
| `custom_field_8` | String | Vrije veld 8 |
| `custom_field_9` | String | Vrije veld 9 |
| `date_first_contact` | Date | Datum eerste kontakt |
| `date_last_contact` | Date | Datum laatste kontakt |
| `email` | String | e-mail |
| `staff_size_id` | Int32 | Pers. grootte: Personeels grootte |
| `employees_quantity` | Int32 | Aantal medewerkers |
| `fax` | String | Faxnummer |
| `has_invoices` | Boolean | Actief: Actieve relatie?. Despite its name, a second "active relation?" flag tied to financial activity (an open item, a lifted sales blockage). Not whether the relation has invoices. |
| `has_service` | Boolean | Service/dienstverlening (j/n) |
| `has_telemarketing_preference` | Boolean | Voorkeur relatie van een TM agent (ja/nee) |
| `helpdesk_status` | Int32 | HD-status van de relatie. |
| `internal_agent` | Int32 | interne agent |
| `is_active` | Int32 | Actief: Actieve relatie. Whether the relation is archived: 0 is archived, anything else (also empty) is active. Filter is_active ne 0 for active relations. |
| `is_creditor` | Boolean | Is relatie een crediteur. Can be out of date. Whether the relation is a supplier is whether it has a Creditors row. |
| `is_dealer` | Boolean | vertegenwoordiger/dealer (j/n) |
| `is_debtor` | Boolean | Is relatie een debiteur. Can be out of date. Whether the relation is a customer is whether it has a Debtors row. |
| `is_employee` | Boolean | Is relatie een medewerker. Employees are relations too; leave them out (is_employee eq false) when listing companies. |
| `is_manufacturer` | Boolean | fabrikant (ja/nee) |
| `is_used_external` | Int32 | Extern in gebruik (0/1) |
| `is_wholesaler` | Boolean | groothandel/importeur (ja/nee) |
| `language_code` | Int32 | Taalkode |
| `legal_form_id` | Int32 | Rechtsvorm nummer |
| `mailing_id` | Int32 | Mailingkode |
| `origin_id` | Int32 | Herkomst relatie |
| `parent_relation` | Int32 | Moeder relatie |
| `postal_code` | String | Postcode van het primaire bezoekadres. A copy of the postal code of the primary visit address. Use RelationAddresses for addresses. |
| `reason_not_active_id` | Int32 | Reden niet actief nummer |
| `relation_id_char` | String | Relatienummer |
| `search_name` | String | Zoeknaam. A search key, kept apart from the name: it can be shorter, abbreviated or older. To find a record by name, use query's search, which looks in all text fields. |
| `selection` | String | Selecties. A generated search string. Don't filter or parse it. |
| `source_id` | Int32 | Bronnummer |
| `status` | Int32 | Status van de relatie |
| `suspect_number` | String | Suspectnr.: Suspectnummer (koppeling met bcd) |
| `telemarketing_agent` | Int32 | TM-agent: Telemarketing agent |
| `telemarketing_or_sales` | Boolean | Telemarketing/Verkoop: Telemarketing of verkoop |
| `telephone` | String | Telefoonnummer |
| `use_contact_person_fax` | Boolean | Gebruik eigen fax.nr.: Gebruik persoonlijk faxnummer van contactpersoon |
| `use_contact_person_telephone` | Boolean | Gebruik perdoonlijk tel.nr.: Gebruik persoonlijk telefoonnummer van contactpersoon |
| `website` | String | Website |
| `workplaces` | Int32 | Aantal werkplekken |

## Relations

- `Agent` → [Agents](https://docs.fledge.nl/en/api/reference/Agents.md) (one)
- `Budget` → [Budgets](https://docs.fledge.nl/en/api/reference/Budgets.md) (one)
- `CountryCode` → [CountryCodes](https://docs.fledge.nl/en/api/reference/CountryCodes.md) (one)
- `LanguageCodes` → [LanguageCodes](https://docs.fledge.nl/en/api/reference/LanguageCodes.md) (one)
- `LegalForms` → [LegalForms](https://docs.fledge.nl/en/api/reference/LegalForms.md) (one)
- `MailingCodes` → [MailingCodes](https://docs.fledge.nl/en/api/reference/MailingCodes.md) (one)
- `NotActiveReasons` → [NotActiveReasons](https://docs.fledge.nl/en/api/reference/NotActiveReasons.md) (one)
- `Source` → [Sources](https://docs.fledge.nl/en/api/reference/Sources.md) (one)
- `StaffSize` → [StaffSizes](https://docs.fledge.nl/en/api/reference/StaffSizes.md) (one)
- `CreditInsurances` → [CreditInsurances](https://docs.fledge.nl/en/api/reference/CreditInsurances.md) (many)
- `Creditors` → [Creditors](https://docs.fledge.nl/en/api/reference/Creditors.md) (many)
- `Debtors` → [Debtors](https://docs.fledge.nl/en/api/reference/Debtors.md) (many)
- `DocumentLinks` → [DocumentLinks](https://docs.fledge.nl/en/api/reference/DocumentLinks.md) (many)
- `Employees` → [Employees](https://docs.fledge.nl/en/api/reference/Employees.md) (many)
- `ProductionOrderHeaders` → [ProductionOrderHeaders](https://docs.fledge.nl/en/api/reference/ProductionOrderHeaders.md) (many)
- `RelationAddresses` → [RelationAddresses](https://docs.fledge.nl/en/api/reference/RelationAddresses.md) (many)
- `RelationBranches` → [RelationBranches](https://docs.fledge.nl/en/api/reference/RelationBranches.md) (many)
- `RelationContactPeople` → [RelationContactPeople](https://docs.fledge.nl/en/api/reference/RelationContactPeople.md) (many)
- `RelationInterests` → [RelationInterests](https://docs.fledge.nl/en/api/reference/RelationInterests.md) (many)
- `RelationStatusLinks` → [RelationStatusLinks](https://docs.fledge.nl/en/api/reference/RelationStatusLinks.md) (many)
- `SalesQuotationHeaders` → [SalesQuotationHeaders](https://docs.fledge.nl/en/api/reference/SalesQuotationHeaders.md) (many)
- `ServiceObjects` → [ServiceObjects](https://docs.fledge.nl/en/api/reference/ServiceObjects.md) (many)

---

Source: https://docs.fledge.nl/en/api/reference/Relations
