Skip to main content

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

ParameterTypeRequiredDescription
idstringYesCustomer ID

Request Body

FieldTypeWho Can UpdateDescription
company_namestringCustomer, AnalystCompany name
contact_namestringCustomer, AnalystPrimary contact
contact_emailstringCustomer, AnalystContact email
contact_phonestringCustomer, AnalystContact phone
verification_statusstringAnalyst onlyverified or rejected
verification_notesstringAnalyst onlyNotes 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:

FromToEffect
pendingverifiedCustomer can create collections
pendingrejectedCustomer cannot access platform
rejectedverifiedCustomer access restored
verifiedrejectedActive 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"
}
}