> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files/members.md).

# Members

Use the member import to add multiple member profiles at once. This is especially useful during initial data migration or when onboarding a large batch of customers.

**File format:** XML

### Sample file

{% file src="/files/5BDpLpbo4RN6MGDQdFlo" %}

{% file src="/files/81h78D1hlvDpbEIDSIzO" %}

{% code title="members-import-sample.xml" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<customers>
  <customer>
    <email>jane.doe@example.com</email>
    <loyaltyCardNumber>CARD-001</loyaltyCardNumber>
    <phone>+1234567890</phone>
    <firstName>Jane</firstName>
    <lastName>Doe</lastName>
    <gender>female</gender>
    <birthDate>1990-05-15</birthDate>
    <registeredAt>2024-01-10 09:00:00.000000</registeredAt>
    <address>
      <address1>123 Main Street</address1>
      <city>New York</city>
      <country>US</country>
      <postal>10001</postal>
      <province>NY</province>
      <street>Main Street 123</street>
    </address>
    <agreement1>1</agreement1>
    <agreement2>0</agreement2>
    <agreement3>0</agreement3>
  </customer>
</customers>
```

{% endcode %}

### Field reference

<table><thead><tr><th width="196.1640625">Field</th><th width="122.25">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>email</code></td><td>Yes *</td><td>Member's email address (must be unique)</td></tr><tr><td><code>loyaltyCardNumber</code></td><td>Yes *</td><td>Loyalty card identifier</td></tr><tr><td><code>phone</code></td><td>Yes *</td><td>Phone number (include country code)</td></tr><tr><td><code>firstName</code></td><td>No</td><td>First name</td></tr><tr><td><code>lastName</code></td><td>No</td><td>Last name</td></tr><tr><td><code>gender</code></td><td>No</td><td><code>male</code>, <code>female</code>, or <code>not_disclosed</code></td></tr><tr><td><code>birthDate</code></td><td>No</td><td>Date of birth in <code>YYYY-MM-DD</code> format</td></tr><tr><td><code>registeredAt</code></td><td>No</td><td>Registration timestamp in <code>YYYY-MM-DD HH:MM:SS</code> format</td></tr><tr><td><code>address</code></td><td>No</td><td>Address block — if included, provide only the fields you need</td></tr><tr><td><code>country</code></td><td>No</td><td><strong>Must be an ISO 3166-1 alpha-2 code</strong> (e.g., <code>US</code>, <code>GB</code>, <code>PL</code>). Numeric codes are not accepted.</td></tr><tr><td><code>agreement1/2/3</code></td><td>No</td><td>Marketing consent flags: <code>1</code> = agreed, <code>0</code> = not agreed</td></tr></tbody></table>

{% hint style="danger" %}
**Member identifiers must be unique.** If a member with the same email already exists, the import will update the existing record rather than create a duplicate.

Only one identifier is required (email OR phone OR loyalty card number).

To find out more, please refer to the article below:

[Configuration](/main-features/members/configuration.md)
{% endhint %}

### Important notes

{% hint style="warning" %}
**Remove fields you don't use.** If you don't need `address`, `company`, or any optional field, delete the entire XML element — do not leave it empty. Empty elements cause `"This form should not contain extra fields"` errors.
{% endhint %}

{% hint style="info" %}
**Country codes must be ISO alpha-2.** Use two-letter codes like `US`, `GB`, `PL` — not numeric codes like `840` or `616`. Invalid codes will cause the import to fail without a clear error message.
{% endhint %}

### Common mistakes

| Mistake                                         | Fix                                       |
| ----------------------------------------------- | ----------------------------------------- |
| Using numeric country codes (`840`)             | Use alpha-2 codes (`US`)                  |
| Leaving empty `<company>` or `<address>` blocks | Remove the entire block if not needed     |
| Wrong `registeredAt` format                     | Use `YYYY-MM-DD HH:MM:SS` with timezone   |
| Windows line endings (CRLF)                     | Convert to Unix (LF) — see Best practices |

To find out more, please refer to the article below:

{% content-ref url="/pages/F2ssvyBuZ3RQrImNyESw" %}
[Members](/main-features/members.md)
{% endcontent-ref %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.openloyalty.io/main-features/imports-exports/imports/sample-import-files/members.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
