## Update a Contact

Update an existing contact. The contact_id can be either the internal UID
(starting with 'ctc_') or the external ID.
The service will check for conflicts with other contacts if the new values already exist.

## Endpoint signature

```http
POST https://api.reservepay.com/merchants/update-contact HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

{
  contact_id: string,
  contact_email: string?,
  contact_mobile: string?,
  contact_name: string?,
  favorite: boolean?,
}
```

Returns: boolean

## Request arguments

### `contact_id` (string)

**Required**. The contact ID (either internal UID or external ID) to update.

### `contact_email` (string)

_Optional_. The new email address for the contact. Optional but must be unique if provided.

### `contact_mobile` (string)

_Optional_. The new mobile number for the contact. Optional but must be unique if provided. Dashes and spaces are accepted and will be stripped automatically.

### `contact_name` (string)

_Optional_. The name of the contact. Optional.

### `favorite` (boolean)

_Optional_. Whether the contact is a favorite. Optional.

## Errors specific to this endpoint

### `NOT_FOUND`

No contact found with the provided contact_id.
The contact may not exist or may belong to a different merchant.

### `CONFLICT`

A contact with the same email or mobile number already exists.
Each contact must have unique values for these fields.

### `VALIDATION_ERROR`

Validation failed. At least one of contact_email or contact_mobile must be provided.
If contact_email is provided, it must be a valid email format.

## Errors common to all endpoints

### `UNHANDLED_ERROR`

This error occurs when the server encounters an unexpected internal error that
it cannot handle gracefully. This typically happens due to bugs, infrastructure
issues, or edge cases that weren't anticipated during development.

### `INVALID_ARGUMENTS`

This error occurs when the request contains invalid or missing parameters.
Common cases include missing required fields, or values that don't match the
expected format or type.

### `BAD_VERSION`

This error occurs when making requests to an API version that does not exist.
This commonly happens when using an outdated SDK or when the API version
specified in the request URL is incorrect.
