> 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/api-reference/member/add-a-member.md).

# Add a member

Integration\
\
This method allows registering a new Member as an Admin.

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Member","description":"These endpoints allow you to easily manage members."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"idempotencyKey":{"name":"Idempotency-Key","in":"header","description":"Optional. An opaque identifier the client chooses for one logical request, so a retry of that request cannot create a second resource.\n\nRepeating a key that was already used returns the **original** response — the same status code and the same body, including the loyalty card number the first attempt was assigned — together with an `Idempotent-Replayed: true` header, rather than an error the client has to reconcile. This is checked before the body is validated, so an identical retry succeeds even where it would otherwise be rejected for duplicating a unique field such as e-mail.\n\nThe request body is **not** part of the comparison. The key alone decides, so a repeat replays even when the payload differs in field order, whitespace or values — you do not need to reproduce the original request byte for byte. Choose a key that identifies one member, and never reuse one key for two different members: a reused key returns the member it was first used for.\n\nA key is recognised for **24 hours** after its first use. After that the same key starts a new registration rather than replaying, and it is also **released early if the member it created is deleted** — so a member removed in error can be recreated under the same key straight away. Sending the header on a request that also carries `?async=true` has no effect, because the response is returned before the member is created.\n\nConstraints: 1–128 characters, printable ASCII, and it must not contain `:`. Violating any of these returns 400 with only `code` and `message` — not the `errors` array documented for this endpoint's validation failures, since the header is rejected before the body is examined. A request that respects the schema below cannot produce that response.\n","required":false,"schema":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[ -9;-~]+$"}}},"schemas":{"CustomerRegistrationFormType":{"required":["email"],"properties":{"referrerToken":{"type":"string","nullable":true},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"description":"Required depending on identification method settings","type":"string"},"phone":{"description":"Required depending on identification method settings","type":"string"},"loyaltyCardNumber":{"description":"Required depending on identification method settings","type":"string"},"birthDate":{"type":"string","format":"date"},"createdAt":{"description":"Use \"registeredAt\" field instead.","type":"string","format":"date-time","deprecated":true},"registeredAt":{"type":"string","format":"date-time"},"address":{"$ref":"#/components/schemas/CustomerAddressFormType"},"company":{"properties":{"name":{"type":"string"},"nip":{"type":"string"}},"type":"object"},"labels":{"type":"array","items":{"properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}},"type":"object"}},"agreement1":{"description":"TOS Agreement","type":"boolean"},"agreement2":{"description":"Direct Marketing Agreement","type":"boolean"},"agreement3":{"description":"Optional Agreement","type":"boolean"},"levelId":{"description":"Assign member to tier","type":"string","format":"uuid","nullable":true},"channelId":{"type":"string","format":"uuid"},"customFieldsData":{"description":"Custom fields data for member","type":"array","items":{"required":["customFieldSchemaId","value"],"properties":{"customFieldSchemaId":{"description":"ID of the custom field schema","type":"string","format":"uuid"},"value":{"description":"Value for the custom field (validated against schema requirements)","type":"string"}},"type":"object"},"nullable":true},"customFields":{"description":"Custom field values (CustomField module) to set on the new member, keyed by group then field. Requires the `CUSTOM_FIELD_MEMBER` feature flag; ignored when disabled.","type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{}}}},"type":"object"},"CustomerAddressFormType":{"properties":{"street":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"postal":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"country":{"description":"The country code in ISO 3166-1 alpha-2 format. This should be a two-letter uppercase string representing a valid country code. Examples:  - `US` (United States) - `PL` (Poland)","type":"string"}},"type":"object"},"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/member":{"post":{"tags":["Member"],"summary":"Add a member","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method allows registering a new Member as an Admin.\n","operationId":"_memberPost","parameters":[{"$ref":"#/components/parameters/storeCode"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"customer":{"$ref":"#/components/schemas/CustomerRegistrationFormType"}},"type":"object"}}}},"responses":{"200":{"description":"Return registered member id and identifiers. When the request repeated a previously used `Idempotency-Key`, this is the original response replayed and `Idempotent-Replayed: true` is set.\n","headers":{"Idempotent-Replayed":{"description":"Present and `true` only when this response replays an earlier request that carried the same `Idempotency-Key`; absent on a fresh create.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"properties":{"customerId":{"description":"Registered member identity","type":"string","format":"uuid"},"email":{"description":"Registered member email","type":"string"},"phone":{"description":"Registered member phone","type":"string","nullable":true},"loyaltyCardNumber":{"description":"Registered member loyalty card number","type":"string","nullable":true}},"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The same `Idempotency-Key` is being processed by another request right now, so this one was rejected instead of waiting — retry shortly and the original response will be replayed. Also returned when the key was used before but the resource it created no longer exists, so there is nothing left to replay.\n","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}}}}}
````


---

# 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/api-reference/member/add-a-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.
