# Retrieving customer data

### Configuration values

You'll need an [API key](https://docs.giftpro.co.uk/getting-started#get-your-api-keys) to include with all requests. Depending on how your business and CRM are structured you may want to filter your  data by `domainID` which represents [the property the order was placed through.](https://docs.giftpro.co.uk/reference/properties)

It's very common for different `domainID` to be used for separate brands within a single account.

### Getting the customers information

The first step is to retrieve the primary customer interaction which is paying for gift vouchers which creates orders, the checkout is always a guest checkout and there is no concept of registered users.

Retrieve all orders starting with the most recent first using the [list orders endpoint.](https://docs.giftpro.co.uk/reference/orders#list-orders) The list endpoint includes all the customer information that the order object contains.

{% hint style="info" %}
**Important**

If your intending to send marketing to the customer make sure you check the \`marketingOptedIn\` boolean attribute on an order to see if a customer has opted in to receive marketing communication at the time of purchase.
{% endhint %}

### Understanding the data

The first thing to understand is the property and locations structure of the account.

An account can have multiple properties setup, all for the same brand, more separate brands, or a mixture of both depending on the desired outcome. While it is often the case that a property is linked to a specific brand, there can be properties that represent a shared parent group brand or a sub-brand within an overall clients business.

A customers order is attached to only one property.

### Flow of new customer data

Subsequent requests can be made to the same list orders endpoint filtering on the `changed` attribute to ensure that you only receive new or modified orders since the last request.

Remember the same customer can (Hopefully) buy your vouchers again and again.


---

# 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.giftpro.co.uk/common-uses/retrieving-customer-data.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.
