Update Customer
Update customer account information.
PATCH /api/customers/{id}
Authorization
- Customer: Can update their own profile
- Analyst: Can update any customer + verification status
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Customer ID |
Request Body
| Field | Type | Who Can Update | Description |
|---|---|---|---|
company_name | string | Customer, Analyst | Company name |
contact_name | string | Customer, Analyst | Primary contact |
contact_email | string | Customer, Analyst | Contact email |
contact_phone | string | Customer, Analyst | Contact phone |
verification_status | string | Analyst only | verified or rejected |
verification_notes | string | Analyst only | Notes about verification decision |
Request Example: Customer Update
{
"company_name": "Acme Corporation Inc.",
"contact_phone": "+1-555-987-6543"
}
Request Example: Analyst Verification
{
"verification_status": "verified",
"verification_notes": "Verified via phone call with legal department"
}
Response
{
"id": "cus_xyz789",
"message": "Customer updated successfully"
}
note
verification_status accepts pending, verified, or rejected (analyst-only). The side effects in the table below describe product intent; the route itself just persists the field changes.
Verification Status Changes
When an analyst changes verification status:
| From | To | Effect |
|---|---|---|
pending | verified | Customer can create collections |
pending | rejected | Customer cannot access platform |
rejected | verified | Customer access restored |
verified | rejected | Active collections paused |
Example: Update Profile (Customer)
curl -X PATCH "https://api.traces.io/api/customers/cus_xyz789" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"contact_name": "Jane Doe",
"contact_email": "jane.doe@acme.com"
}'
Example: Verify Customer (Analyst)
curl -X PATCH "https://api.traces.io/api/customers/cus_xyz789" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"verification_status": "verified",
"verification_notes": "Identity confirmed via video call"
}'
Example: Reject Customer (Analyst)
curl -X PATCH "https://api.traces.io/api/customers/cus_xyz789" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"verification_status": "rejected",
"verification_notes": "Unable to verify business identity"
}'
Error Responses
403 Forbidden
Customer trying to set an analyst-only field (verification_status / verification_notes):
{
"error": {
"code": "FORBIDDEN",
"message": "Only analysts can update verification status and notes"
}
}
Customer updating another customer:
{
"error": {
"code": "FORBIDDEN",
"message": "Access denied"
}
}
404 Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Customer not found"
}
}