> 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/technical-guide/getting-started-guide/add-member.md).

# Add & fetch a Member

See the sample example how a member can be added and fetched. Links to more detailed instructions can be found at the end of the article.

## How this example works

In this example, you can register a new member profile using the previously specified registration method and then fetch the member details.

{% hint style="warning" %}
The endpoints used in this example is the recommended ones, and they requires an admin token to be used.
{% endhint %}

***

## Try adding a member yourself <a href="#to-try-it-yourself" id="to-try-it-yourself"></a>

* Input the previous saved [token](/technical-guide/getting-started-guide/authentication.md) and [storeCode](/technical-guide/getting-started-guide/member-registartion-configuration.md#to-try-it-yourself) in the request header
* Add a member\
  Endpoint: `POST /api/{storeCode}/member`

  ```
  {
     "customer": {
          "email": "john.smith@example.com",
          "firstName": "John",
          "lastName": "Smith",
          "gender": "male"
      }
  }
  ```
* This action should trigger `CustomerRegistered` [webhook](/technical-guide/getting-started-guide/add-webhook.md#to-try-it-yourself)

***

## Endpoints used

{% openapi src="/files/jvocRY6tlAWocBwKFsNL" path="/api/{storeCode}/member" method="post" %}
[openapi-5.61.0 (1).json](https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2Fgit-blob-c6d6d1ae03b533a9dcf7bf7e18c3fbc4e23b0e6b%2Fopenapi-5.61.0%20\(1\).json?alt=media)
{% endopenapi %}

***

## Try fetching a member yourself <a href="#to-try-it-yourself" id="to-try-it-yourself"></a>

* Input the previous saved [token](/technical-guide/getting-started-guide/authentication.md) and [storeCode](/technical-guide/getting-started-guide/member-registartion-configuration.md#to-try-it-yourself) in the request header
* Input the customerId of the member you wish to retrieve.\
  Endpoint: `GET /api/{storeCode}/member/{member}`
* 200 Returns the complete member profile as you can see below.

```
{
    "labels": [],
    "customerId": {member},
    "registeredAt": "2025-11-04T10:47:41+01:00",
    "active": true,
    "firstName": "John",
    "lastName": "Smith",
    "gender": "male",
    "email": "john.smith@example.com",
    "address": {},
    "createdAt": "2025-11-04T10:47:41+01:00",
    "updatedAt": "2025-11-04T10:47:42+01:00",
    "agreement1": false,
    "agreement2": false,
    "agreement3": false,
    "company": {},
    "transactionsCount": 0,
    "returnTransactionsCount": 0,
    "transactionsAmount": 0.0,
    "returnTransactionsAmount": 0.0,
    "transactionsAmountWithoutDeliveryCosts": 0.0,
    "amountExcludedForLevel": 0.0,
    "averageTransactionAmount": 0.0,
    "averageReturnTransactionAmount": 0.0,
    "levelAchievementDate": "2025-11-04T10:47:42+01:00",
    "anonymized": false,
    "referralToken": "X4HVLEH7E",
    "defaultAccount": {
        "accountId": "76ff22ca-e63e-414e-8b17-6ba54246ceb6",
        "activePoints": 0.0,
        "transferredPoints": 0.0,
        "lockedPoints": 0.0,
        "expiredPoints": 0.0,
        "spentPoints": 0.0,
        "earnedPoints": 0.0,
        "blockedPoints": 0.0
    },
    "customFieldsData": [],
    "currency": "USD",
    "storeCode": {storeCode},
    "segments": [],
    "currentLevel": {
        "levelId": "275a9ea4-5e39-47f4-ba03-bb5e13f5c9d3",
        "name": "Tier1",
        "translations": {
            "en": {
                "name": "Tier1"
            }
        }
    }
}
```

The retrieved JSON object contains a wealth of information. Retrieving this data is crucial for many operations, such as:

* Personalizing communication (e.g., "Hello John, you have 500 points!").
* Displaying the customer's status in a mobile app or e-commerce account.
* Making business decisions in other systems (e.g., a CRM or Marketing Automation tool).

## More resources

For a detailed overview and description of the members, please refer to these series of articles:

{% content-ref url="/spaces/cNVX03KZzmrGwJihLiEx/pages/F2ssvyBuZ3RQrImNyESw" %}
[Members](/members-and-activity/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/technical-guide/getting-started-guide/add-member.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
