> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transaction.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Customer

> Edit a customer

Edit customer information.

<ParamField path="customerId" type="string" required>
  Customer ID to edit
</ParamField>

<ParamField path="email" type="string">
  Updated email address
</ParamField>

<ParamField path="metadata" type="object">
  Updated customer metadata
</ParamField>

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  Updated customer data
</ResponseField>

## Example Request

```bash theme={null}
curl -X PATCH https://api.transaction.gg/merchant/customer/edit \
  -H "Authorization: Bearer jwt_token" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "cus_V6n6SN2KnsIFCuQU",
    "email": "newemail@example.com",
    "metadata": {
      "name": "Jane Doe"
    }
  }'
```

## Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "id": "cus_V6n6SN2KnsIFCuQU",
    "email": "newemail@example.com",
    "metadata": {
      "name": "Jane Doe"
    },
    "updatedAt": "2024-01-01T00:00:00Z"
  }
}
```

## Error Responses

<ResponseExample name="Customer Not Found">
  ```json theme={null}
  {
    "success": false,
    "error": {
      "status": 404,
      "code": "CUSTOMER_NOT_FOUND",
      "message": "Customer not found"
    },
    "data": null
  }
  ```
</ResponseExample>
