# Fields used as keys

For reporting purposes, you can use the following keys described below with Order Notification, Sales Order Activity, and Subscription Services for reporting purposes.

## Email address

To use email as a key, check the `email` element under the `billingAddress` element first.

{% tabs %}
{% tab title="JSON" %}

```javascript
{
	"billingAddress": {
		"emailAddress": ""
	}
}
```

{% endtab %}
{% endtabs %}

If no `billingAddress` elements exist, locate the `email` element associated with the `shippingAddress`**.**

{% tabs %}
{% tab title="JSON" %}

```javascript
{
	"shippingAddress": {
		"emailAddress": ""
	}
}
```

{% endtab %}
{% endtabs %}

Any `shippingAddress` for any `lineItem` will suffice since the address appears for all the line items.

## Consumer name

To use the consumer name as a key, check the `name` element under the `payment` element first.

{% tabs %}
{% tab title="JSON" %}

```javascript
{
	"payment": {
		"customerFirstName": "",
		"customerLastName": ""
	}
}
```

{% endtab %}
{% endtabs %}

If no `payment` element exists, locate the consumer `name` element associated with the `shippingAddress`.

{% tabs %}
{% tab title="JSON" %}

```javascript
{
	"shippingAddress": {
		"customerFirstName": "",
		"customerLastName": ""
	}
}
```

{% endtab %}
{% endtabs %}

Any the `shippingAddress` for any `lineItem` will suffice since the address appears for all the line items.

## Digital rights

To use digital rights as a key, check the `serialNumber` and `unlockCode` elements under the `lineItems` element.

{% tabs %}
{% tab title="Plain Text" %}

```javascript
{
	"lineItems": {
		"lineItem": {
			"digitalRights": {
				"serialNumber": "",
				"unlockCode": ""
			}
		}
	}
}
```

{% endtab %}
{% endtabs %}

## CustomerID field

Use the `customerID` field as a key when you want to attribute orders to users with access to MyAccount, where they can change their login IDs and email addresses.


---

# 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/fields-used-as-keys.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.
