Skip to content

Create Customer

POST /v2/tms-api/customers

Create a new customer in your organization.

API Reference

Request Body

Required Fields

external_reference_idstringrequired
Your unique identifier for this customer (must be unique within your organization)
namestringrequired
Customer name

Optional Fields

reference_numberstring
Additional reference number (max 100 characters)
domainstring
Customer domain/website (max 255 characters)
phonestring
Phone number (max 50 characters)
is_activebooleandefault: true
Whether the customer is active
customer_typestring
Customer type/category (max 50 characters)

Request Examples

bash
curl -X POST "https://api.mentium.io/v2/tms-api/customers" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "external_reference_id": "CUST-ACME-001",
    "name": "Acme Corporation",
    "reference_number": "ACME-REF-001",
    "phone": "312-555-0100",
    "domain": "acme.com",
    "is_active": true,
    "customer_type": "Enterprise"
  }'
python
import requests

response = requests.post(
    "https://api.mentium.io/v2/tms-api/customers",
    headers={
        "X-API-Key": "your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "external_reference_id": "CUST-ACME-001",
        "name": "Acme Corporation",
        "reference_number": "ACME-REF-001",
        "phone": "312-555-0100",
        "domain": "acme.com",
        "is_active": True,
        "customer_type": "Enterprise"
    }
)
print(response.json())

Response

201 Created

json
{
  "id": "cust_abc123def456",
  "external_reference_id": "CUST-ACME-001",
  "name": "Acme Corporation",
  "reference_number": "ACME-REF-001",
  "domain": "acme.com",
  "phone": "312-555-0100",
  "is_active": true,
  "customer_type": "Enterprise",
  "created_at": "2026-01-29T10:30:00Z",
  "updated_at": "2026-01-29T10:30:00Z"
}

422 Validation Error

json
{
  "detail": [
    {
      "type": "missing",
      "loc": ["body", "name"],
      "msg": "Field required"
    }
  ]
}

409 Conflict

json
{
  "detail": "Customer with external_reference_id 'CUST-ACME-001' already exists"
}

Notes

  • Required Fields: Only external_reference_id and name are required
  • Uniqueness: external_reference_id must be unique within your organization
  • Phone Number: Used in email templates and customer communication

Mentium TMS API Documentation