Customers
Create a customer contact
Creates a new row in customer_contacts.
URL forms (both accepted, code is $customerId = (int)($id ?? ($body['customer_id'] ?? 0))):
- POST /admin/customers/customer-contacts — customer_id in the body (shown here).
- POST /admin/customers/customer-contacts/{customer_id} — customer_id in the URL path. Canonical form used by the FE / generated SDK / CustomerContactsCest::addEmail(). When using this form, the body customer_id is ignored. OpenAPI does not allow declaring this as a separate path entry because /customer-contacts/{customer_id} is structurally equivalent to the existing /customer-contacts/{id} (the latter targets a contact id for GET/PUT/DELETE).
Validation: contact_type must be email or phone; label must be one of primary, billing, additional, home, work, mobile, internal; country_code/is_whatsapp are only valid for phone rows. When is_primary=true, the previous primary for the same (customer_id, contact_type, label) tuple is demoted atomically. When the partner's authentication_field === 'email', primary emails must be unique across customers.
post/admin/customers/customer-contacts
Request
- Base URL: https://demo.splynx.com/api/2.0
- URL: https://demo.splynx.com/api/2.0/admin/customers/customer-contacts
- Auth: HTTP basic
Request body
Example request
{
"customer_id": 1,
"contact_type": "email",
"contact_value": "alpha@example.com",
"label": "primary",
"is_primary": true,
"country_code": "UA",
"contact_person_id": 1,
"metadata": {}
}Response
Example response
{
"id": 1
}Changes
No recorded changes to this operation across all 1 revision of this API.