# Update Customer

The UpdateCustomer endpoint enables the partners to update customer personal information such as FirstName, LastName, Email, Address, etc.

#### Endpoint: `/insurances/updateCustomer`

#### Method: POST

{% tabs %}
{% tab title="POST /insurances/updateCustomer " %}

```perl
curl -i -X POST \
-H "X_API_KEY: [my-api-key]" \
-H "Content-Type: application/json" \
-d '{"FirstName":"John", "LastName":"Doe", "Address1": "20 Some Address", "Address2": "Suite 15", "City": "Sydney", "Region": "NSW", "PostalCode": "2014", "Country":"AU", "Email": "johndoe@test.com", "NewEmail": "neweemail@test.com", "Phone": "+6141012345678", "CustomerAge": 28, "DateOfBirth": "1990-05-20", "AgentReference": "LIUI-HQS7-INS"}' \
https://api-staging.rentalcover.com/insurances/updateCustomer
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
   "Country":{
      "Code":"AU",
      "Name":"Australia",
      "PhoneCode":"+61"
   },
   "Customer":{
      "CustomerId":"229233",
      "FirstName":"John",
      "LastName":"Doe",
      "Email":"neweemail@test.com",
      "Phone":"+6141012345678",
      "Address1":"20 Some Address",
      "Address2":"Suite 15",
      "City":"Sydney",
      "Region":"NSW",
      "PostalCode":"2014",
      "CountryId":"14",
      "DateOfBirth":"1990-01-01",
      "Age":28,
      "Coupons":{
         "bonvoyage-PAPpC":{
            "Title":"15% off your policy",
            "Value":"15",
            "ValueType":"Percentage",
            "AmountRemaining":null,
            "EffectiveFrom":"2018-06-28 00:00:00",
            "EffectiveTo":"2018-07-12 00:00:00",
            "Terms":"<ul><li>User is entitled to a 15% discount on eligible RentalCover.com policies. All policies are eligible except RentalCover.com's \"Collision Damage Coverage\" for US Residents/Citizens and \"Annual\" policies.</li><li>Payment must be conducted via RentalCover.com's website or mobile app. It is not applicable via our partner sites.</li><li>Coupon cannot be shared.</li><li>Coupon expires on: 2018-07-12. Coupon creation date: 2018-06-28.</li><li>Can only apply one coupon per paid policy.</li><li>Can only be used once per user</li></ul>"
         }
      }
   }
}
```

{% endtab %}
{% endtabs %}

## **Request Parameters**

|                                                |                                                                                                                                      |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `X_API_KEY` string \[varchar(32)] **required** | API Key, provided by RentalCover.com.                                                                                                |
| `AgentReference` string **required**           | Unique identifier for a particular Customer's booking. (example:`LIUI-HQS7-INS`).                                                    |
| `Email` string **required**                    | Customer email which acts as unique identifier.                                                                                      |
| `FirstName` string                             | Customer first name (if unknown use `NULL`).                                                                                         |
| `LastName` string                              | Customer first name (if unknown use `NULL`).                                                                                         |
| `Address1` string                              | Customer street address line 1.                                                                                                      |
| `Address2` string                              | Customer street address line 2.                                                                                                      |
| `City` string                                  | Customer suburb.                                                                                                                     |
| `Country` string \[varchar(2)]                 | ISO 3166 two character country code for customer country of residence or IP.                                                         |
| `PostalCode` string                            | Customer postcode or zip code.                                                                                                       |
| `Phone` string                                 | Customer phone.                                                                                                                      |
| `OtherEmail` string                            | Customer other email.                                                                                                                |
| `Region` string                                | The customer's state, region or territory, this is a 2 or 3-letter code. See [supported regions](/rentalcover/supported-regions.md). |
| `CustomerAge` integer                          | Customer age.                                                                                                                        |
| `NewEmail` string                              | In order to change Customer's email, pass the new value in this parameter.                                                           |
| `DateOfBirth` string \[yyyy-mm-dd]             | Customer date of birth.                                                                                                              |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partner-docs.covergenius.com/rentalcover/endpoints/update-customer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
