# Add & fetch a Member

## 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.&#x20;
{% 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://content.gitbook.com/content/gIv2CyIIYf7vRfuhMKQ6/blobs/2xnMWXnOETp8Vxl2YZoi/openapi-5.61.0%20\(1\).json)
{% 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}`&#x20;
* 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](/main-features/members.md)
{% endcontent-ref %}


---

# 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://help.openloyalty.io/technical-guide/getting-started-guide/add-member.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.
