# RevCent MCP Guide: `EditCustomer`

AI/MCP-focused guide for editing a RevCent Customer.

---

## Related Documentation

| Guide | Link | Why It Matters |
|---|---|---|
| Customer Overview | `https://revcent.com/documentation/markdown/mcp/operation/OverviewCustomer.md` | Broad overview of Customer records, customer lifecycle, related records, customer cards, groups, and customer-facing AI safety. |
| GetCustomer | `https://revcent.com/documentation/markdown/mcp/operation/GetCustomer.md` | Retrieve the Customer before and after customer mutation operations. |
| SearchCustomers | `https://revcent.com/documentation/markdown/mcp/operation/SearchCustomers.md` | Locate a Customer when the Customer ID is unknown. |
| GetCustomers | `https://revcent.com/documentation/markdown/mcp/operation/GetCustomers.md` | Bounded operational Customer retrieval. Not for reporting/metrics. |
| BigQueryRunQuery | `https://revcent.com/documentation/markdown/mcp/operation/BigQueryRunQuery.md` | Correct operation for customer reporting, metrics, aggregation, and data mining. |


---

## Operation Summary

Operation:

```text
EditCustomer
```

Title:

```text
Edit A Customer
```

Purpose:

```text
Edit a specific Customer using the Customer ID.
```

Use `EditCustomer` to update contact, company, address, email, or phone details for an existing Customer.

---

## When to Use

Use `EditCustomer` when the user wants to update:

- first name,
- last name,
- address,
- city/state/zip/country,
- company,
- email,
- phone.

Recommended workflow:

```text
GetCustomer
    ↓
Confirm exact customer and fields to change
    ↓
EditCustomer
    ↓
GetCustomer to verify
```

---

## Input Schema

Required top-level fields:

| Field | Type | Required | Description |
|---|---:|---:|---|
| `customer_id` | string | Yes | 20-character Customer ID. |
| `customer` | object | Yes | Customer details to modify. |

Editable fields inside `customer`:

```text
first_name
last_name
address_line_1
address_line_2
city
state
zip
country
company
email
phone
```

Example:

```json
{
  "customer_id": "CCCCCCCCCCCCCCCCCCCC",
  "customer": {
    "email": "new-email@example.com",
    "phone": "555-555-5555"
  }
}
```

---

## Partial Edit Guidance

Best practice:

```text
Only include fields that should change.
```

Do not send unchanged customer fields unless required by the schema or explicitly intended. This reduces accidental overwrites.

---

## Output Schema

Successful output can include:

| Field | Description |
|---|---|
| `api_call_id` | 20-character API call ID. |
| `api_call_unix` | Unix timestamp when the API call was initiated. |
| `code` | API response code. `1` indicates success. |
| `customer_id` | 20-character ID returned by the operation. |
| `result` | Result message. |


---

## Recommended Workflow

```text
1. Use GetCustomer to retrieve the current record.
2. Verify the correct Customer.
3. Confirm the exact fields to edit.
4. In customer-facing flows, verify the visitor using a secondary value from the retrieved Customer.
5. Call EditCustomer with only intended fields.
6. Use GetCustomer again to verify.
```

---

## Customer-Facing AI Verification Warning

Customer operations can expose or modify sensitive customer, contact, address, payment, group, purchase, subscription, trial, refund, fraud, chargeback, note, and lifecycle context.

If this operation is used inside a customer-facing AI flow, such as:

- AI Voice Agent,
- public chatbot,
- customer portal assistant,
- SMS assistant,
- any visitor-facing AI workflow,

AI/MCP should verify that the visitor is actually the customer, or is otherwise authorized, before providing information, modifying customer data, adding cards, changing status, or changing group membership.

Recommended rule:

```text
Do not act on a Customer record in a public-facing flow based only on visitor-provided input.
```

Use a secondary value from the retrieved RevCent Customer record, such as customer email, customer phone, or another record-backed value.

Safe customer-facing flow:

```text
Visitor provides customer/account input
    ↓
AI locates/retrieves the Customer
    ↓
AI verifies a secondary value from the retrieved Customer record
    ↓
AI confirms the requested action
    ↓
Only then performs the operation
```

For consequential actions, require explicit confirmation immediately before running the operation.


---

## Reporting Guidance

This operation is not a reporting or analytics operation.

Do not use customer mutation operations or customer lookup/search operations for:

- reporting,
- metrics,
- aggregation,
- data mining,
- segmentation reports,
- customer lifetime value reports,
- customer counts,
- broad analysis,
- bulk retrieval.

Use:

```text
BigQueryRunQuery
```

for those purposes.

If AI/MCP intended to use operational customer actions or lookup actions for reporting and then realizes `BigQueryRunQuery` is correct, it does not need to tell the user. It should simply run `BigQueryRunQuery`.


---

## Common Mistakes to Avoid

Do not:

- edit a customer without verifying the correct record,
- overwrite fields by sending stale values,
- update email/phone/address from a public visitor without verification,
- use `EditCustomer` to add a card; use `AddCardToCustomer`,
- use `EditCustomer` to enable/disable a customer; use `EnableCustomer` or `DisableCustomer`,
- use `EditCustomer` for group membership; use `AddCustomerToGroup` or `RemoveCustomerFromGroup`.

---

## Final AI/MCP Instruction

Use `EditCustomer` for targeted customer detail updates. Always include `customer_id` and a `customer` object containing only fields that should change.


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.