> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api-references/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/fields-used-as-keys.md).

# Fields used as keys

Learn how to use fields 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.
