Create relation
Add a customer or supplier (relation) to a division.
POST https://cotlet.dev/api/v1/exact-online/relations
write
Creates a relation with a name, status and optional address and email. It returns the account_id to use in other tools. It sends nothing to anyone and moves no money, so it runs without asking first. Search with search_relations before creating to avoid a duplicate.
Parameters
| Name | Type | Description |
|---|---|---|
| division integer | integer | Division (company) code from list_divisions. Default: the account's current division. |
| name string required | string | Name of the company or person. |
| status enum | enum | customer or supplier. Default: customer. |
| email string | string | Email address for invoices. |
| city string | string | City. |
| country string | string | Two-letter country code. |
Request
curl -X POST https://cotlet.dev/api/v1/exact-online/relations \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Jane Doe"}' result = client.call("exact-online", "create_relation", {"name":"Jane Doe"}) const result = await cotlet.call('exact-online', 'create_relation', {"name":"Jane Doe"}); cotlet call exact-online create_relation --data '{"name":"Jane Doe"}' Example response
{
"account_id": "8a3f1c20-2b6e-4d44-9e0b-7f4c1d2a9002",
"code": "1043",
"name": "Van Dijk Design",
"status": "customer"
}