# Models

## The GenderTypeEnum object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The UserDetail object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"UserDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"User unique identifier"},"username":{"type":"string","description":"Hashed username for privacy"},"first_name":{"type":"string","description":"User's first name"},"last_name":{"type":"string","description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"is_active":{"type":"boolean","description":"Whether the user account is active"},"date_joined":{"type":"string","format":"date-time","description":"User registration date"},"last_login":{"type":"string","format":"date-time","nullable":true,"description":"Last login timestamp"},"email_allowed":{"type":"boolean","description":"User consent for email marketing"},"sms_allowed":{"type":"boolean","description":"User consent for SMS marketing"},"call_allowed":{"type":"boolean","nullable":true,"description":"User consent for phone calls"},"gender":{"$ref":"#/components/schemas/GenderTypeEnum"},"attributes":{"type":"object","description":"Custom user attributes (EAV)","additionalProperties":true},"phone":{"type":"string","description":"User's phone number in international format"},"date_of_birth":{"type":"string","format":"date","nullable":true,"description":"User's date of birth"},"attributes_kwargs":{"type":"object","description":"Additional attribute metadata"},"user_type":{"type":"string","description":"Type of user account"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"}}},"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The LoyaltyCard object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"LoyaltyCard":{"type":"object","properties":{"pk":{"type":"integer","description":"Loyalty card unique identifier"},"attributes":{"type":"object","description":"Custom loyalty card attributes (EAV)","additionalProperties":true},"created_date":{"type":"string","format":"date-time","description":"Loyalty card creation date"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"},"number":{"type":"string","description":"Loyalty card number (typically phone number)"},"user":{"$ref":"#/components/schemas/UserDetail"}}},"UserDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"User unique identifier"},"username":{"type":"string","description":"Hashed username for privacy"},"first_name":{"type":"string","description":"User's first name"},"last_name":{"type":"string","description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"is_active":{"type":"boolean","description":"Whether the user account is active"},"date_joined":{"type":"string","format":"date-time","description":"User registration date"},"last_login":{"type":"string","format":"date-time","nullable":true,"description":"Last login timestamp"},"email_allowed":{"type":"boolean","description":"User consent for email marketing"},"sms_allowed":{"type":"boolean","description":"User consent for SMS marketing"},"call_allowed":{"type":"boolean","nullable":true,"description":"User consent for phone calls"},"gender":{"$ref":"#/components/schemas/GenderTypeEnum"},"attributes":{"type":"object","description":"Custom user attributes (EAV)","additionalProperties":true},"phone":{"type":"string","description":"User's phone number in international format"},"date_of_birth":{"type":"string","format":"date","nullable":true,"description":"User's date of birth"},"attributes_kwargs":{"type":"object","description":"Additional attribute metadata"},"user_type":{"type":"string","description":"Type of user account"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"}}},"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The LoyaltyCardResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"LoyaltyCardResponse":{"type":"object","properties":{"card":{"allOf":[{"$ref":"#/components/schemas/LoyaltyCard"},{"nullable":true}],"description":"Loyalty card details (null if not found)"},"points":{"type":"number","format":"float","description":"Available loyalty points balance (decimal value)"},"errors":{"type":"string","nullable":true,"description":"Error message if points query failed"}}},"LoyaltyCard":{"type":"object","properties":{"pk":{"type":"integer","description":"Loyalty card unique identifier"},"attributes":{"type":"object","description":"Custom loyalty card attributes (EAV)","additionalProperties":true},"created_date":{"type":"string","format":"date-time","description":"Loyalty card creation date"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"},"number":{"type":"string","description":"Loyalty card number (typically phone number)"},"user":{"$ref":"#/components/schemas/UserDetail"}}},"UserDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"User unique identifier"},"username":{"type":"string","description":"Hashed username for privacy"},"first_name":{"type":"string","description":"User's first name"},"last_name":{"type":"string","description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"is_active":{"type":"boolean","description":"Whether the user account is active"},"date_joined":{"type":"string","format":"date-time","description":"User registration date"},"last_login":{"type":"string","format":"date-time","nullable":true,"description":"Last login timestamp"},"email_allowed":{"type":"boolean","description":"User consent for email marketing"},"sms_allowed":{"type":"boolean","description":"User consent for SMS marketing"},"call_allowed":{"type":"boolean","nullable":true,"description":"User consent for phone calls"},"gender":{"$ref":"#/components/schemas/GenderTypeEnum"},"attributes":{"type":"object","description":"Custom user attributes (EAV)","additionalProperties":true},"phone":{"type":"string","description":"User's phone number in international format"},"date_of_birth":{"type":"string","format":"date","nullable":true,"description":"User's date of birth"},"attributes_kwargs":{"type":"object","description":"Additional attribute metadata"},"user_type":{"type":"string","description":"Type of user account"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"}}},"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The RegisterLoyaltyCardRequest object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"RegisterLoyaltyCardRequest":{"type":"object","required":["first_name","last_name","email","gender","date_of_birth","phone"],"properties":{"first_name":{"type":"string","maxLength":30,"description":"User's first name"},"last_name":{"type":"string","maxLength":30,"description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"email_allowed":{"type":"boolean","nullable":true,"description":"Consent for email marketing","default":false},"sms_allowed":{"type":"boolean","nullable":true,"description":"Consent for SMS marketing","default":false},"call_allowed":{"type":"boolean","nullable":true,"description":"Consent for phone calls","default":null},"gender":{"$ref":"#/components/schemas/GenderTypeEnum"},"date_of_birth":{"type":"string","format":"date","description":"User's date of birth (YYYY-MM-DD)"},"phone":{"type":"string","pattern":"^\\+?1?\\d{9,15}$","maxLength":60,"description":"Phone number in international format (E.164)"},"code":{"type":"string","minLength":4,"maxLength":20,"description":"SMS verification code (required on second submission)"},"resend":{"type":"boolean","description":"Request to resend SMS verification code","default":false}}},"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The RegisterLoyaltyCardResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"RegisterLoyaltyCardResponse":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/LoyaltyCard"},"redirect_url":{"type":"string","description":"URL to redirect after successful registration"}}},"LoyaltyCard":{"type":"object","properties":{"pk":{"type":"integer","description":"Loyalty card unique identifier"},"attributes":{"type":"object","description":"Custom loyalty card attributes (EAV)","additionalProperties":true},"created_date":{"type":"string","format":"date-time","description":"Loyalty card creation date"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"},"number":{"type":"string","description":"Loyalty card number (typically phone number)"},"user":{"$ref":"#/components/schemas/UserDetail"}}},"UserDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"User unique identifier"},"username":{"type":"string","description":"Hashed username for privacy"},"first_name":{"type":"string","description":"User's first name"},"last_name":{"type":"string","description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"is_active":{"type":"boolean","description":"Whether the user account is active"},"date_joined":{"type":"string","format":"date-time","description":"User registration date"},"last_login":{"type":"string","format":"date-time","nullable":true,"description":"Last login timestamp"},"email_allowed":{"type":"boolean","description":"User consent for email marketing"},"sms_allowed":{"type":"boolean","description":"User consent for SMS marketing"},"call_allowed":{"type":"boolean","nullable":true,"description":"User consent for phone calls"},"gender":{"$ref":"#/components/schemas/GenderTypeEnum"},"attributes":{"type":"object","description":"Custom user attributes (EAV)","additionalProperties":true},"phone":{"type":"string","description":"User's phone number in international format"},"date_of_birth":{"type":"string","format":"date","nullable":true,"description":"User's date of birth"},"attributes_kwargs":{"type":"object","description":"Additional attribute metadata"},"user_type":{"type":"string","description":"Type of user account"},"modified_date":{"type":"string","format":"date-time","description":"Last modification date"}}},"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The UpdateLoyaltyCardRequest object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"UpdateLoyaltyCardRequest":{"type":"object","required":["phone","first_name","last_name","gender"],"properties":{"phone":{"type":"string","pattern":"^\\+?1?\\d{9,15}$","maxLength":60,"description":"Phone number (must be unique, cannot match other active users)"},"first_name":{"type":"string","maxLength":30,"description":"User's first name"},"last_name":{"type":"string","maxLength":30,"description":"User's last name"},"email_allowed":{"type":"boolean","nullable":true,"description":"Consent for email marketing","default":false},"sms_allowed":{"type":"boolean","nullable":true,"description":"Consent for SMS marketing","default":false},"call_allowed":{"type":"boolean","nullable":true,"description":"Consent for phone calls","default":null},"gender":{"$ref":"#/components/schemas/GenderTypeEnum"},"date_of_birth":{"type":"string","format":"date","nullable":true,"description":"User's date of birth"}}},"GenderTypeEnum":{"type":"string","description":"Gender type enumeration.\n\nSupported values:\n* `male` - Male\n* `female` - Female\n* `unknown` - Unknown/Prefer not to say","enum":["male","female","unknown"]}}}}
```

## The UpdateLoyaltyCardResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"UpdateLoyaltyCardResponse":{"type":"object","properties":{"card":{"type":"object","description":"Updated loyalty card information","properties":{"phone":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email_allowed":{"type":"boolean"},"sms_allowed":{"type":"boolean"},"call_allowed":{"type":"boolean","nullable":true},"gender":{"type":"string"},"date_of_birth":{"type":"string","format":"date"}}},"redirect_url":{"type":"string","description":"URL to redirect after successful update"}}}}}}
```

## The SearchExistsCreateRequest object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"SearchExistsCreateRequest":{"type":"object","required":["email"],"properties":{"phone":{"type":"string","pattern":"^\\+?1?\\d{9,15}$","maxLength":60,"description":"Phone number to search for"},"email":{"type":"string","format":"email","description":"Email address to search for (required)"},"date_of_birth":{"type":"string","format":"date","description":"Date of birth for additional matching"}}}}}}
```

## The SearchExistsCreateResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"SearchExistsCreateResponse":{"type":"object","properties":{"number":{"type":"string","description":"Created loyalty card number"}}}}}}
```

## The MessageResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string","description":"Response message"}}}}}}
```

## The NotFoundResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"NotFoundResponse":{"type":"object","properties":{"message":{"type":"string","description":"Message indicating account not found"}}}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.0.3","info":{"title":"Loyalty Card API","version":"1.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"detail":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Field-specific validation errors","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}
```


---

# 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://apidocs.akinon.com/commerce-openapis/loyalty-card/models.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.
