> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/users/module-4/models.md).

# Models

## The UserPermissionRequest object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"UserPermissionRequest":{"type":"object","required":["uid","basket"],"properties":{"uid":{"type":"string","description":"User identifier used by permission cache"},"basket":{"type":"integer","description":"Active basket identifier"},"sms_allowed":{"type":"boolean","description":"SMS communication consent"},"call_allowed":{"type":"boolean","description":"Call communication consent"},"email_allowed":{"type":"boolean","description":"Email communication consent"},"whatsapp_allowed":{"type":"boolean","description":"WhatsApp communication consent"}}}}}}
```

## The UserProfile object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"UserProfile":{"type":"object","required":["id","first_name","last_name","email_allowed","sms_allowed","whatsapp_allowed","call_allowed","email","phone","gender","language_code","attributes","date_joined"],"properties":{"id":{"type":"integer"},"first_name":{"type":"string","maxLength":50},"last_name":{"type":"string","maxLength":50},"email_allowed":{"type":"boolean"},"sms_allowed":{"type":"boolean"},"whatsapp_allowed":{"type":"boolean"},"call_allowed":{"type":["boolean","null"]},"avatar":{"type":["string","null"],"format":"binary"},"email":{"type":"string","format":"email"},"phone":{"type":["string","null"]},"date_of_birth":{"type":["string","null"],"format":"date"},"gender":{"type":["string","null"],"enum":["male","female"]},"genders":{"type":"array","description":"Allowed gender values","items":{"type":"string","enum":["male","female"]}},"language_code":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"date_joined":{"type":"string","format":"date-time"}}}}}}
```

## The UserProfileUpdate object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"UserProfileUpdate":{"allOf":[{"$ref":"#/components/schemas/UserProfile"}]},"UserProfile":{"type":"object","required":["id","first_name","last_name","email_allowed","sms_allowed","whatsapp_allowed","call_allowed","email","phone","gender","language_code","attributes","date_joined"],"properties":{"id":{"type":"integer"},"first_name":{"type":"string","maxLength":50},"last_name":{"type":"string","maxLength":50},"email_allowed":{"type":"boolean"},"sms_allowed":{"type":"boolean"},"whatsapp_allowed":{"type":"boolean"},"call_allowed":{"type":["boolean","null"]},"avatar":{"type":["string","null"],"format":"binary"},"email":{"type":"string","format":"email"},"phone":{"type":["string","null"]},"date_of_birth":{"type":["string","null"],"format":"date"},"gender":{"type":["string","null"],"enum":["male","female"]},"genders":{"type":"array","description":"Allowed gender values","items":{"type":"string","enum":["male","female"]}},"language_code":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"date_joined":{"type":"string","format":"date-time"}}}}}}
```

## The UserProfileWithLoyalty object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"UserProfileWithLoyalty":{"allOf":[{"$ref":"#/components/schemas/UserProfile"},{"type":"object","required":["code","resend"],"properties":{"code":{"type":["string","null"],"description":"Verification code for phone changes"},"resend":{"type":"boolean","description":"Request a new verification code"}}}]},"UserProfile":{"type":"object","required":["id","first_name","last_name","email_allowed","sms_allowed","whatsapp_allowed","call_allowed","email","phone","gender","language_code","attributes","date_joined"],"properties":{"id":{"type":"integer"},"first_name":{"type":"string","maxLength":50},"last_name":{"type":"string","maxLength":50},"email_allowed":{"type":"boolean"},"sms_allowed":{"type":"boolean"},"whatsapp_allowed":{"type":"boolean"},"call_allowed":{"type":["boolean","null"]},"avatar":{"type":["string","null"],"format":"binary"},"email":{"type":"string","format":"email"},"phone":{"type":["string","null"]},"date_of_birth":{"type":["string","null"],"format":"date"},"gender":{"type":["string","null"],"enum":["male","female"]},"genders":{"type":"array","description":"Allowed gender values","items":{"type":"string","enum":["male","female"]}},"language_code":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"date_joined":{"type":"string","format":"date-time"}}}}}}
```

## The UserProfileWithLoyaltyUpdate object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"UserProfileWithLoyaltyUpdate":{"allOf":[{"$ref":"#/components/schemas/UserProfileWithLoyalty"}]},"UserProfileWithLoyalty":{"allOf":[{"$ref":"#/components/schemas/UserProfile"},{"type":"object","required":["code","resend"],"properties":{"code":{"type":["string","null"],"description":"Verification code for phone changes"},"resend":{"type":"boolean","description":"Request a new verification code"}}}]},"UserProfile":{"type":"object","required":["id","first_name","last_name","email_allowed","sms_allowed","whatsapp_allowed","call_allowed","email","phone","gender","language_code","attributes","date_joined"],"properties":{"id":{"type":"integer"},"first_name":{"type":"string","maxLength":50},"last_name":{"type":"string","maxLength":50},"email_allowed":{"type":"boolean"},"sms_allowed":{"type":"boolean"},"whatsapp_allowed":{"type":"boolean"},"call_allowed":{"type":["boolean","null"]},"avatar":{"type":["string","null"],"format":"binary"},"email":{"type":"string","format":"email"},"phone":{"type":["string","null"]},"date_of_birth":{"type":["string","null"],"format":"date"},"gender":{"type":["string","null"],"enum":["male","female"]},"genders":{"type":"array","description":"Allowed gender values","items":{"type":"string","enum":["male","female"]}},"language_code":{"type":"string"},"attributes":{"type":"object","additionalProperties":true},"date_joined":{"type":"string","format":"date-time"}}}}}}
```

## The RegisterRequest object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"RegisterRequest":{"type":"object","required":["first_name","last_name","email","password","confirm"],"properties":{"first_name":{"type":"string","maxLength":50},"last_name":{"type":"string","maxLength":50},"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"},"email_allowed":{"type":"boolean","default":false},"sms_allowed":{"type":"boolean","default":false},"whatsapp_allowed":{"type":"boolean","default":false},"call_allowed":{"type":["boolean","null"]},"confirm":{"type":"boolean","description":"Confirms acceptance of policies"},"code":{"type":["string","null"],"description":"SMS verification code (used in SMS OTP/KVKK flows)"},"resend":{"type":["boolean","null"],"default":false,"description":"Request a new SMS verification code (SMS OTP/KVKK flows)"},"gender":{"type":["string","null"],"enum":["male","female"]},"date_of_birth":{"type":["string","null"],"format":"date"},"username":{"type":["string","null"],"maxLength":150},"user_type":{"type":"string","description":"User type enumeration value"},"phone":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true}}}}}}
```

## The RegisterWithLoyaltyRequest object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"RegisterWithLoyaltyRequest":{"allOf":[{"$ref":"#/components/schemas/RegisterRequest"},{"type":"object","required":["phone"],"properties":{"add_loyalty":{"type":"boolean","default":false},"code":{"type":["string","null"]},"resend":{"type":"boolean","default":false},"phone":{"type":"string","maxLength":60},"gender":{"type":["string","null"],"enum":["male","female"]},"date_of_birth":{"type":["string","null"],"format":"date"}}}]},"RegisterRequest":{"type":"object","required":["first_name","last_name","email","password","confirm"],"properties":{"first_name":{"type":"string","maxLength":50},"last_name":{"type":"string","maxLength":50},"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"},"email_allowed":{"type":"boolean","default":false},"sms_allowed":{"type":"boolean","default":false},"whatsapp_allowed":{"type":"boolean","default":false},"call_allowed":{"type":["boolean","null"]},"confirm":{"type":"boolean","description":"Confirms acceptance of policies"},"code":{"type":["string","null"],"description":"SMS verification code (used in SMS OTP/KVKK flows)"},"resend":{"type":["boolean","null"],"default":false,"description":"Request a new SMS verification code (SMS OTP/KVKK flows)"},"gender":{"type":["string","null"],"enum":["male","female"]},"date_of_birth":{"type":["string","null"],"format":"date"},"username":{"type":["string","null"],"maxLength":150},"user_type":{"type":"string","description":"User type enumeration value"},"phone":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true}}}}}}
```

## The SavedCard object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"SavedCard":{"type":"object","description":"Saved card resource returned by saved-cards endpoints. Fields mirror `omnishop.payments.models.SavedCard`.","required":["pk","masked_card_number","token","user"],"properties":{"pk":{"type":"integer","description":"Saved card identifier"},"name":{"type":["string","null"],"description":"User-defined card label"},"token":{"type":"string","description":"Gateway token for the saved card (opaque)"},"user":{"type":"integer","description":"Owner user ID"},"masked_card_number":{"type":"string","description":"Masked PAN (e.g., **** **** **** 1234)"},"pos":{"type":["integer","null"],"description":"POS identifier associated with the card"},"created_date":{"type":"string","format":"date-time","description":"Creation timestamp"},"modified_date":{"type":"string","format":"date-time","description":"Last update timestamp"}}}}}}
```

## The SavedCardUpdate object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"SavedCardUpdate":{"type":"object","description":"Fields allowed for saved card update","properties":{"name":{"type":["string","null"],"description":"User-defined card label"}}}}}}
```

## The StoredCard object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"StoredCard":{"type":"object","description":"Stored card resource returned by stored-cards endpoint","additionalProperties":true}}}}
```

## The SegmentSummary object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"SegmentSummary":{"type":"object","required":["pk","name","priority"],"properties":{"pk":{"type":"integer"},"name":{"type":"string"},"priority":{"type":"integer"}}}}}}
```

## The SegmentCurrent object

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"components":{"schemas":{"SegmentCurrent":{"type":"object","required":["pk","name","priority"],"properties":{"pk":{"type":"integer"},"name":{"type":"string"},"priority":{"type":"integer"},"price_list":{"type":["integer","null"]}}}}}}
```


---

# 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://apidocs.akinon.com/commerce-openapis/users/module-4/models.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.
