Skip to main content
This section covers endpoints for updating and managing customer-related resources including contact emails, phone numbers, and company names (razones sociales).

Contact Emails

Manage email addresses associated with a customer.

Add Email

Add a new email address for a customer.

Path Parameters

id
integer
required
The customer ID

Request Body

email
string
required
The email address to add
is_for_invoicing
boolean
default:"false"
Whether this email should be used for invoicing
notes
string
Additional notes about this email
name
string
Contact person’s name for this email
role
string
Contact person’s role or position
curl --location 'https://api.example.com/api/customers/1/emails' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "email": "[email protected]",
    "is_for_invoicing": true,
    "name": "John Doe",
    "role": "Finance Manager",
    "notes": "Primary contact for billing"
  }'
{
  "email_id": 1,
  "customer_id": 1,
  "email": "[email protected]",
  "is_for_invoicing": true,
  "name": "John Doe",
  "role": "Finance Manager",
  "notes": "Primary contact for billing",
  "is_locked": false,
  "created_at": "2024-01-15T10:30:00Z"
}

Update Email

Update an existing email address for a customer.

Path Parameters

id
integer
required
The customer ID
emailId
integer
required
The email record ID to update

Request Body

email
string
The updated email address
is_for_invoicing
boolean
Whether this email should be used for invoicing
notes
string
Updated notes about this email
curl --location --request PUT 'https://api.example.com/api/customers/1/emails/1' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "email": "[email protected]",
    "is_for_invoicing": false,
    "notes": "Updated contact email"
  }'
{
  "email_id": 1,
  "customer_id": 1,
  "email": "[email protected]",
  "is_for_invoicing": false,
  "notes": "Updated contact email",
  "updated_at": "2024-01-15T10:30:00Z"
}

Toggle Email Lock

Toggle the locked status of an email address.

Path Parameters

id
integer
required
The customer ID
emailId
integer
required
The email record ID to toggle
curl --location 'https://api.example.com/api/customers/1/emails/1/toggle-lock' \
  --header 'Authorization: Bearer YOUR_TOKEN'

Contact Phones

Manage phone numbers associated with a customer.

Add Phone

Add a new phone number for a customer.

Path Parameters

id
integer
required
The customer ID

Request Body

phone
string
required
The phone number to add
extension
string
Phone extension if applicable
is_whatsapp
boolean
default:"false"
Whether this number has WhatsApp enabled
notes
string
Additional notes about this phone
name
string
Contact person’s name for this phone
role
string
Contact person’s role or position
curl --location 'https://api.example.com/api/customers/1/phones' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "phone": "+1234567890",
    "extension": "123",
    "is_whatsapp": true,
    "name": "Jane Smith",
    "role": "Sales Manager",
    "notes": "Available 9-5 EST"
  }'
{
  "phone_id": 1,
  "customer_id": 1,
  "phone": "+1234567890",
  "extension": "123",
  "is_whatsapp": true,
  "name": "Jane Smith",
  "role": "Sales Manager",
  "notes": "Available 9-5 EST",
  "is_locked": false,
  "created_at": "2024-01-15T10:30:00Z"
}

Update Phone

Update an existing phone number for a customer.

Path Parameters

id
integer
required
The customer ID
phoneId
integer
required
The phone record ID to update

Request Body

phone
string
The updated phone number
extension
string
Updated phone extension
is_whatsapp
boolean
Whether this number has WhatsApp enabled
notes
string
Updated notes about this phone
curl --location --request PUT 'https://api.example.com/api/customers/1/phones/1' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "phone": "+1234567899",
    "extension": "456",
    "is_whatsapp": false
  }'
{
  "phone_id": 1,
  "customer_id": 1,
  "phone": "+1234567899",
  "extension": "456",
  "is_whatsapp": false,
  "updated_at": "2024-01-15T10:30:00Z"
}

Toggle Phone Lock

Toggle the locked status of a phone number.

Company Names (Razones Sociales)

Manage legal company names and billing information for a customer.

List Company Names

Retrieve all company names associated with a customer.

Path Parameters

id
integer
required
The customer ID
curl --location 'https://api.example.com/api/customers/1/company-names' \
  --header 'Authorization: Bearer YOUR_TOKEN'
{
  "success": true,
  "company_names": [
    {
      "company_name_id": 1,
      "customer_id": 1,
      "name": "Acme Corp Ltd.",
      "tax_id": "ABC123456789",
      "billing_email": "[email protected]",
      "address": "123 Main St",
      "billing_address": "PO Box 456",
      "is_active": true,
      "is_default": true,
      "created_at": "2024-01-15T10:30:00Z"
    }
  ]
}

Create Company Name

Add a new company name (razón social) for a customer.

Path Parameters

id
integer
required
The customer ID

Request Body

name
string
required
The company legal name
tax_id
string
required
Tax identification number
billing_email
string
Email address for billing purposes
address
string
Company physical address
billing_address
string
Billing address (if different from physical address)
is_active
boolean
Whether this company name is active
is_default
boolean
Whether this is the default company name for the customer
curl --location 'https://api.example.com/api/customers/1/company-names' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "name": "Acme Corp Ltd.",
    "tax_id": "ABC123456789",
    "billing_email": "[email protected]",
    "address": "123 Main St, City",
    "billing_address": "PO Box 456, City",
    "is_active": true,
    "is_default": true
  }'
{
  "company_name_id": 1,
  "customer_id": 1,
  "name": "Acme Corp Ltd.",
  "tax_id": "ABC123456789",
  "billing_email": "[email protected]",
  "address": "123 Main St, City",
  "billing_address": "PO Box 456, City",
  "is_active": true,
  "is_default": true,
  "created_at": "2024-01-15T10:30:00Z"
}

Update Company Name

Update an existing company name for a customer.

Path Parameters

id
integer
required
The customer ID
companyNameId
integer
required
The company name ID to update

Request Body

All fields from the create endpoint are available for update.
curl --location --request PUT 'https://api.example.com/api/customers/1/company-names/1' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "name": "Acme Corporation Ltd.",
    "tax_id": "ABC123456789",
    "billing_email": "[email protected]"
  }'
{
  "company_name_id": 1,
  "customer_id": 1,
  "name": "Acme Corporation Ltd.",
  "tax_id": "ABC123456789",
  "billing_email": "[email protected]",
  "updated_at": "2024-01-15T10:30:00Z"
}

Set Default Company Name

Mark a company name as the default for a customer.

Path Parameters

id
integer
required
The customer ID
companyNameId
integer
required
The company name ID to set as default
curl --location 'https://api.example.com/api/customers/1/company-names/1/set-default' \
  --header 'Authorization: Bearer YOUR_TOKEN'

Toggle Company Name Active Status

Activate or deactivate a company name.

Path Parameters

id
integer
required
The customer ID
companyNameId
integer
required
The company name ID to toggle

Request Body

is_active
boolean
required
The desired active status
curl --location 'https://api.example.com/api/customers/1/company-names/1/toggle-active' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --data-raw '{
    "is_active": false
  }'
{
  "company_name_id": 1,
  "is_active": false,
  "updated_at": "2024-01-15T10:30:00Z"
}

Build docs developers (and LLMs) love