# Customer external reference identifier ERID

The Remote User Management (also known as SSO) service requires an `externalReferenceID` as a customer identifier.&#x20;

{% hint style="danger" %}
You must specify a unique `externalReferenceID` for each user because several objects use it. Failure to do so may violate your contract with Digital River and will cause users to get cross-linked.&#x20;
{% endhint %}

You must specify a unique inbound `userKey` (in response to `LoginRequest`, `GetUserRequest`) for each user in the clients' database.

## Using an external reference identifier for a customer

When you [create a customer](https://app.gitbook.com/s/-LzlYMEYC0GeLSgnsft6/shopper-apis/shopper-basics/common-use-cases/creating-a-customer), you can specify the external reference ID. You can also update a customer using the [`POST /shoppers/me`](https://app.gitbook.com/s/X2fWaY1Kp5sXA1fmOL7z/shoppers/shoppers#v1-shoppers-me-1) resource.

### Specifying an external reference identifier when creating and getting a customer

The shopper object in the payload for a [`POST /shoppers`](https://app.gitbook.com/s/X2fWaY1Kp5sXA1fmOL7z/shoppers/shoppers#v1-shoppers-client-hosted-shopper) request (where the client maintains the login credentials) includes an `externalReferenceId` as shown in line 5:

{% tabs %}
{% tab title="Payload example" %}
{% code lineNumbers="true" %}

```json
{
 		"shopper": {
 			"firstname": "John",
			"lastname": "Johnson",
 			"externalreferenceid": "abc123",
 			"emailaddress": "jjohnson@myCompany.com",
 			"locale": "en_US",
 			"currency": "USD"
	 	}
 }
```

{% endcode %}
{% endtab %}
{% endtabs %}

When you use the `ap`[v1-shoppers-me](https://app.gitbook.com/s/X2fWaY1Kp5sXA1fmOL7z/shoppers/shoppers#v1-shoppers-me "mention") resource to get a customer, you can use the `expand` query parameter to get the customer's external reference identifier. The GET does not return the external reference identifier field by default. Refer to the Shopper resource for more information about getting and creating customers.

### Create a full access token using the external reference identifier

For the Client Credentials confidential flow only, you can create a full access token on behalf of a customer by passing in the `external_reference_id` form parameter in the payload:

{% tabs %}
{% tab title="Payload example" %}

```http
grant_type=client_credentials&amp;dr_external_reference_id=partner-shopper-id
```

{% endtab %}
{% endtabs %}

For more information, see [`POST oauth20/token`](https://app.gitbook.com/s/X2fWaY1Kp5sXA1fmOL7z/oauth/tokens#oauth20-token-dr-hosted-shopper) under the [Token API](https://app.gitbook.com/s/X2fWaY1Kp5sXA1fmOL7z/oauth/tokens).


---

# 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://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/customer-external-reference-identifier-erid.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.
