# Registration

Registration flows with loyalty support

## Register user with optional loyalty enrollment

> Creates a user account and optionally enrolls loyalty. Phone must be\
> unique when \`PHONE\_NUMBER\_UNIQUE\_VALIDATOR\_ACTIVE\` is enabled. Loyalty\
> behavior is driven by \`CUSTOMER\_LOYALTY\_CARD\_SERVICE\`.\
> \
> Throttling scope: \`register-with-loyalty\`.\
> Two-factor: SMS verification via \`code\`/\`resend\`.

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Registration","description":"Registration flows with loyalty support"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/users/register-with-loyalty/":{"post":{"tags":["Registration"],"operationId":"registerWithLoyalty","summary":"Register user with optional loyalty enrollment","description":"Creates a user account and optionally enrolls loyalty. Phone must be\nunique when `PHONE_NUMBER_UNIQUE_VALIDATOR_ACTIVE` is enabled. Loyalty\nbehavior is driven by `CUSTOMER_LOYALTY_CARD_SERVICE`.\n\nThrottling scope: `register-with-loyalty`.\nTwo-factor: SMS verification via `code`/`resend`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterWithLoyaltyRequest"}}}},"responses":{"201":{"description":"Registration succeeded"},"202":{"description":"Verification code sent"},"400":{"description":"Validation error"}}}}},"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}}}}}}
```

## Register user

> Creates a user account. When\
> \`GUEST\_USER\_REGISTRATION\_REQUIRES\_EMAIL\_VERIFICATION\` is enabled,\
> login is blocked until email is verified.\
> \
> The registration flow is selected via \`REST\_REGISTER\_VIEW\`\
> (System Configuration):\
> \- \`RegisterSMSOtpView\`: Requires phone + SMS code (2FA).\
> \- \`RegisterKvkkView\`: Requires consent fields; may request SMS code.\
> \- \`UserRegisterWithLoyaltyCardViewSet\`: Supports loyalty enrollment; phone verification via SMS.\
> \- \`RegisterRedirectView\`: Default email-first flow.\
> \
> 2FA coverage:\
> \- SMS-based second factor is enforced when \`RegisterSMSOtpView\` is active.\
> \- Loyalty registration enforces SMS verification for phone changes and enrollment.\
> \- When \`RegisterSMSOtpView\` is configured, this endpoint requires \`phone\`\
> &#x20; plus SMS \`code\`/\`resend\` values for completion.\
> \
> Throttling scope: \`register\`.

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Registration","description":"Registration flows with loyalty support"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/users/registration/":{"post":{"tags":["Registration"],"operationId":"registerUser","summary":"Register user","description":"Creates a user account. When\n`GUEST_USER_REGISTRATION_REQUIRES_EMAIL_VERIFICATION` is enabled,\nlogin is blocked until email is verified.\n\nThe registration flow is selected via `REST_REGISTER_VIEW`\n(System Configuration):\n- `RegisterSMSOtpView`: Requires phone + SMS code (2FA).\n- `RegisterKvkkView`: Requires consent fields; may request SMS code.\n- `UserRegisterWithLoyaltyCardViewSet`: Supports loyalty enrollment; phone verification via SMS.\n- `RegisterRedirectView`: Default email-first flow.\n\n2FA coverage:\n- SMS-based second factor is enforced when `RegisterSMSOtpView` is active.\n- Loyalty registration enforces SMS verification for phone changes and enrollment.\n- When `RegisterSMSOtpView` is configured, this endpoint requires `phone`\n  plus SMS `code`/`resend` values for completion.\n\nThrottling scope: `register`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"Registration succeeded"},"400":{"description":"Validation error"}}}}},"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}}}}}}
```

## GET /users/registration/account-confirm-email/{key}/

> Confirm email

```json
{"openapi":"3.1.0","info":{"title":"Users API - Loyalty, Permissions, Segments, and Cards","version":"4.0.0"},"tags":[{"name":"Registration","description":"Registration flows with loyalty support"}],"servers":[{"description":"Default commerce site","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce storefront hostname"}}}],"paths":{"/users/registration/account-confirm-email/{key}/":{"get":{"tags":["Registration"],"operationId":"confirmEmail","summary":"Confirm email","parameters":[{"in":"path","name":"key","required":true,"schema":{"type":"string"},"description":"Email confirmation key"}],"responses":{"302":{"description":"Email confirmed and redirected"},"400":{"description":"Invalid or expired key"}}}}}}
```
