> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/customer/update-customer.md).

# Update customer

Use the **updateCustomerInformation** method to update the details of a customer entity from the 2Checkout system.

## Request parameters

<table><thead><tr><th width="251.3333740234375">Parameters</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><p><strong>Required (string)</strong></p><p>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect. The <code>sessionID</code> expires in <strong>10 minutes</strong>.</p></td></tr><tr><td><a href="https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/customer.md"><code>Customer</code></a></td><td><p><strong>Required (object)</strong></p><p>Use this object to update customer information.</p></td></tr><tr><td><code>UpdateEndUserSubscriptions</code></td><td><p><strong>Optional (boolean)</strong></p><p>You can push the changes made on the customer info to the end-user details for all subscriptions belonging to this customer. Set <strong>true</strong> to have the changes reflected on the end-user details for all subscriptions. If <strong>null</strong> or <strong>false</strong>, the changes are made only at the customer level. Default value is false.</p></td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$customerReference = CUSTOMER_REFERENCE;
$externalCustomerReference = 'EXTERNAL_CUSTOMER_REFERENCE'; // Optional, but if you include it it needs to belong to the same customer as the internal Avangate customer reference

// Get customer info
$jsonRpcRequest = array(
    'method' => 'getCustomerInformation',
    'params' => array($sessionID, $customerReference, $externalCustomerReference),
    'id' => $i++,
    'jsonrpc' => '2.0'
);

$existingCustomer = callRPC((Object)$jsonRpcRequest, $host, true);

// Update email
$existingCustomer->Email = 'newemailaddress@email.com';

// New Credit object (optional)
$existingCustomer->Credit = new stdClass();
$existingCustomer->Credit->Limit = 51.0;       // float
$existingCustomer->Credit->Remaining = 21.0;   // float
$existingCustomer->Credit->Currency = 'EUR';   // string

$UpdateEndUserSubscriptions = false; // Optional, but if true the changes made on customer info are pushed to all subscriptions from this customer.

// Send updated customer info
$jsonRpcRequest = array(
    'method' => 'updateCustomerInformation',
    'params' => array($sessionID, $existingCustomer, $UpdateEndUserSubscriptions),
    'id' => $i++,
    'jsonrpc' => '2.0'
);

var_dump(callRPC((Object)$jsonRpcRequest, $host, true));
```

## Response parameters

<table><thead><tr><th width="123.33349609375">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Boolean</strong></td><td><strong>true</strong> or <strong>false</strong> depending on whether or not the operation succeeded.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/customer/update-customer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
