LogoLogo
  • Welcome to Akinon Documentation
  • Products
    • ACC
    • Omnitron
    • Commerce
    • Order Management System (OMS)
    • Instore
    • Integrator
    • Marketplace Dashboard (MPD)
    • Project Zero (PZ)
    • Seller Center
    • Akifast
    • App Maker
  • API Reference
    • Welcome to Akinon API Reference
  • Omnitron
    • Getting Started
    • Integration
      • Product
        • Product
        • Pre-Product
        • Attribute
        • Attribute Value
        • Attribute Set
        • Product Image
      • Price
        • Price List
        • Product Price
        • Currency Unit Table
      • Stock
        • Stock List
        • Product Stock
      • Order
        • Get Orders
        • Search Order
        • Get Order Detail by Order Number
        • Get Order Item Detail
        • Orders ID Detail Integration
        • Orders Waiting to Send to ERP
        • Update Order and Order Item
        • Stock Reservation Release
        • Order Cancellation
        • Cancellation & Refund Pending Orders
        • Order Discount Items
        • Order Status Codes & Cancellation Statuses
      • Migration
        • Getting Started
        • User Migration
        • Address Migration
        • Old Order Migration
        • Old Order Item Migration
        • View Migration Progress
        • Currency Options
    • PIM
      • Attributes & Sets
      • Mapping
      • Localization
      • Media
    • Catalogue
      • Introduction
      • Price List
      • Stock List
      • Catalogue Item
      • Category Trees
      • Product Collection
      • Product Sorting
    • Channels
      • Introduction
      • Payments
      • Customers
    • Order
      • Getting Started
      • Fulfillment
      • Cancellations & Refunds
    • Retail Stores
      • Retail Stores
    • User Management
      • Roles & Permissions
      • Add & Remove
    • Whippy Ware
      • Introduction
      • Stock
      • Stock Lists
      • Stock List Rules
      • Stock Providers
      • Stock Locations
  • Omnitron OpenAPIs
    • Without Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Content Types
      • Mappings
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • SalesChannelRetailStore
      • IntegrationActions
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelCategoryNodes
      • SalesChannelDistricts
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelOrders
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProduct
      • SalesChannelAttributeSchemas
      • SalesChannelProductCategories
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelCountries
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
    • With Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Mappings
      • Content Types
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • IntegrationActions
      • SalesChannelRetailStore
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelDistricts
      • SalesChannelCategoryNodes
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelCountries
      • SalesChannelOrders
      • SalesChannelProduct
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProductCategories
      • SalesChannelAttributeSchemas
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
  • Commerce
    • Users
      • Getting Started
      • User Management & Authentication
      • Password & OTP Operations
      • User Profile & Segment Management
      • User Payment & Card Management
      • User Orders & Cancellations
      • Anonymous User Orders & Cancellations
      • User Support & Conversation
      • Captcha Validation
      • Currency & Akifast Operations
    • Checkout
      • Payment Related
      • Payment Strategy Related
      • Shipping Related
      • Independent Pages
    • Product
    • User Collections
    • Basket
    • Discount
    • Autocomplete
    • Breadcrumb
    • Pretty URLs
    • Menu
    • Widgets
    • Loyalty Accounts
    • Address Migration
    • Index Configuration
    • Favourite Products
    • User Address
    • Data Warehouse
    • Introduction
      • Filtering Parameters
    • Data Warehouse
    • Default
  • OMS
    • Package Services
    • Package Item Services
    • Package Denial Reason Services
    • Order Services
    • Order Item Services
    • Transfer Order Services
    • Transfer Item Services
    • Channel Services
    • Cancellation Plan Services
    • Cancellation Reason Services
    • Address Setup Services
    • City Services
    • District Services
    • Township Services
    • Stock Location Address Services
    • Webhook Setup Services
    • Webhook Event Services
    • Omnitron Order Webhooks
    • Undelivered Webhook Event Services
    • Inventory Discrepancy Services
    • OMS Setup Services
    • UI Settings Services
    • OMS Audit Events Service
    • Customer Address Services
    • Application Settings Services
    • Content Type Services
    • Customer Services
    • Channel Setup Services
    • Demo Data Service
    • Order Execution Plan Services
    • Invoice Services
    • Localization Services
    • Action Log Services
    • Order Log Services
    • Celery Metrics Service
    • Stock Location Services
    • Stock Location Address Services
    • Stock Location Sender Address Services
    • Stock Location Sender Address Setup Services
    • Cargo Company Condition Services
    • Permission Group Services
  • Instore
    • Password Reset Services
  • Integrator
    • Projects
    • Flows
    • Logs
  • Seller Center
    • Languages
    • Categories
    • Introduction
    • Products
    • Packages
    • Orders
    • Claims
    • Shipping Methods
  • Akifast
    • Authentication
  • B2B
    • Quotation
    • Basket
    • Division
    • User
    • Staff User
    • Groups
    • Notification
    • Notification Template
  • Flows
    • Shipment Flows
    • Payment Flows
    • SMS Flows
    • Basket Offer Flows
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • GET User Full Profile
  • GET User Detail
  • PATCH Update User Profile / Update Phone Number with OTP
  • GET User Profile Information with Loyalty Card Account
  • PATCH Update User Profile with Loyalty Card Account
  • POST User Register with Loyalty Card Account
  • GET List User Segments
  • POST Set User Segment

Was this helpful?

  1. Commerce
  2. Users

User Profile & Segment Management

GET User Full Profile

This endpoint returns detailed information about the logged-in user, including their personal details such as name, email, phone number, gender, date of birth, and language preferences. It also includes settings for communication preferences and other attributes related to the user profile.

Path: /users/profile/

Authentication Required: Yes

Headers:

Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>

Example Request

import requests

url = "https://{commerce_url}/users/profile/"

headers = {
   'Accept-Language': '<iso_language_code>',
   'Cookie': '<cookie-name>=<session_id>'
}

response = requests.get(url, headers=headers)

print(response.text)

Example Response (200 OK)

{
    "id": 6471,
    "first_name": "John",
    "last_name": "Doe",
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": true,
    "avatar": null,
    "email": "example@example.com",
    "phone": "0000000000",
    "date_of_birth": "2000-01-01",
    "gender": "male",
    "genders": [
        {
            "value": "female",
            "label": "female"
        },
        {
            "value": "male",
            "label": "male"
        }
    ],
    "language_code": "en-us",
    "attributes": {
        "register_client_type": "anonymous",
        "logged_ip": "0.0.0.0",
        "kvkk_flat_page_version": "000",
        "confirm": true
    },
    "date_joined": "2024-01-01T00:00:00.000000Z"
}

Response Parameters:

Property
Data Type
Description

email_allowed

Boolean

Indicates whether the user has allowed receiving emails.

sms_allowed

Boolean

Indicates whether the user has allowed receiving SMS.

call_allowed

Boolean

Indicates whether the user has allowed receiving phone calls.

GET User Detail

This endpoint retrieves the details of the authenticated user, including their username, email, and full name.

Path: /users/user/

Authentication Required: Yes

Headers:

Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>

Example Request

import requests

url = "https://{commerce_url}/users/user/"

headers = {
   'Accept-Language': '<iso_language_code>',
   'Cookie': '<cookie-name>=<session_id>'
}

response = requests.get(url, headers=headers)
print(response.status_code)

Example Response (200 OK)

{
    "username": "test-user",
    "email": "test@akinon.com",
    "first_name": "TestFirstName",
    "last_name": "TestLastName"
}

PATCH Update User Profile / Update Phone Number with OTP

This method allows users to update their profile information, including personal details, contact preferences, and language settings. Additionally, if a user wants to change their phone number, they must verify it using an OTP (One-Time Password).

To update the phone number, the new number should be provided in the phone parameter, and the OTP received via SMS should be sent in the code parameter. If the OTP is incorrect, expired, or missing, the request will be rejected with an appropriate error response. Users can also request a new OTP by setting the resend parameter to true.

Additionally, for the system to send SMS OTP, the SMS_GATEWAY and SMS_GATEWAYS dynamic settings must be properly configured. Ensure the correct SMS gateway provider is set up in the application settings, and verify that the gateway is operational.

This ensures that only authorized users can modify their phone numbers, adding an extra layer of security.

Path: /users/profile/

Authentication Required: Yes

Headers:

Content-Type: application/json
Cookie: <cookie-name>=<session_id>
Accept-Language: <iso_language_code>
x-csrftoken: <token>

Body Parameters

Property
Data Type
Required
Description

first_name

String

False

The first name of the user.

last_name

String

False

The last name of the user

email_allowed

Boolean

False

Indicates if the user consents to receiving emails.

sms_allowed

Boolean

False

Indicates if the user consents to receiving SMS messages.

call_allowed

Boolean

False

Indicates if the user consents to receiving phone calls.

gender

String

False

Enum type representing the user's gender (male, female).

date_of_birth

Datefield

False

The user's date of birth, formatted as YYYY-MM-DD.

phone

String

True

The user's phone number, validated and required for updates.

attributes

Dict

False

Additional customizable user attributes in key-value pairs.

language_code

String

False

The user's preferred language code (e.g., en, de).

avatar

Image

False

The profile image of the user.

code

String

False

The verification code required for phone number changes. This parameter is used in UserProfileKvkkViewSet and UserProfileSMSOtpView.

resend

Boolean

False

Indicates if an verification code should be resent. This parameter is used in UserProfileKvkkViewSet and UserProfileSMSOtpView.

Request Body

{
    "first_name": "John",
    "last_name": "Doe",
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": false
}

Example Request

import requests
import json

url = "https://{commerce_url}/users/profile/"

headers = {
  'Content-Type': 'application/json',
  'Cookie': '<cookie-name>=<session_id>'
  'Accept-Language': '<iso_language_code>',
  'x-csrftoken': '<token>'
  
}

payload = json.dumps({
    "first_name": "John",
    "last_name": "Doe",
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": false
})

response = requests.patch(url, headers=headers, data=payload)
print(response.text)

Example Response (200 OK)

{
    "id": 1234,
    "first_name": "John",
    "last_name": "Doe",
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": null,
    "avatar": null,
    "email": "john.doe@example.com",
    "phone": "0123456789",
    "date_of_birth": "2000-01-01",
    "gender": "male",
    "genders": [
        {
            "value": "female",
            "label": "female"
        },
        {
            "value": "male",
            "label": "male"
        }
    ],
    "language_code": "en-us",
    "attributes": {
        "register_client_type": "default",
        "logged_ip": "0.0.0.0",
        "kvkk_flat_page_version": "999",
        "confirm": true
    },
    "date_joined": "2024-01-01T00:00:00.000000Z"
}

Example Response (202 Accepted)

{
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": null,
    "avatar": null,
    "email": "john.doe@example.com",
    "date_of_birth": "2000-01-01",
    "language_code": "en-us",
    "date_joined": "2024-01-01T00:00:00.000000Z"
}

Example Response (406 Not Acceptable)

{
    "non_field_errors": "Mismatch confirmation data {phone}, {sms_allowed}, {email_allowed}, {call_allowed}, {email}.",
    "error_code": "kvkk_service_100_2"
}
{
    "non_field_errors": "Sms otp code expired. Please resend code.",
    "error_code": "sms_verification_100_4"
}
{
    "non_field_errors": "Phone numbers do not match.",
    "error_code": "sms_verification_100_1"
}
{
    "non_field_errors": "Verification codes do not match.",
    "error_code": "sms_verification_100_2"
}

GET User Profile Information with Loyalty Card Account

This endpoint allows authenticated loyalty card users to retrieve their profile information.

Path: /users/profile-with-loyalty/

Authentication Required: Yes

Headers:

Content-Type: application/json
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>

Example Request

import requests
import json

url = "https://{commerce_url}/users/profile-with-loyalty/"

headers = {
  'Content-Type': 'application/json',
  'Accept-Language': '<iso_language_code>',
  'Cookie': '<cookie-name>=<session_id>'
}

response = requests.get(url, headers=headers)
print(response.text)

Example Response (200 OK)

{
  "id": 1234,
  "first_name": "John",
  "last_name": "Doe",
  "email_allowed": false,
  "sms_allowed": true,
  "call_allowed": false,
  "avatar": "https://example.com/avatar.png",
  "email": "john.doe@example.com",
  "phone": "0123456789",
  "date_of_birth": "1990-05-15",
  "gender": "male",
  "genders": [
    {
      "value": "female",
      "label": "female"
    },
    {
      "value": "male",
      "label": "male"
    }
  ],
  "language_code": "en-gb",
  "attributes": {
    "register_client_type": "mobile",
    "logged_ip": "192.168.1.1",
    "kvkk_flat_page_version": "101",
    "confirm": false
  },
  "date_joined": "2023-06-01T12:30:45.123456Z"
}

PATCH Update User Profile with Loyalty Card Account

This endpoint allows authenticated users to update their profile information. Updates can include changes to the phone number, which may require optional SMS verification, and synchronization with a linked loyalty card account.

The CUSTOMER_LOYALTY_CARD_SERVICE dynamic setting must be configured to communicate with the 3rd party loyalty card service.

The system validates the phone number to ensure its uniqueness.

If a phone number change is requested:

  • The system requires an SMS verification code (via the code field).

  • If the resend is set to true, a new SMS verification code will be sent.

Path: /users/profile-with-loyalty/

Authentication Required: Yes

Headers:

Content-Type: application/json
Cookie: <cookie-name>=<session_id>
Accept-Language: <iso_language_code>
x-csrftoken: <token>

Body Parameters

Property
Data Type
Required
Description

first_name

String

False

The first name of the user.

last_name

String

False

The last name of the user

email_allowed

Boolean

False

Indicates if the user consents to receiving emails.

sms_allowed

Boolean

False

Indicates if the user consents to receiving SMS messages.

call_allowed

Boolean

False

Indicates if the user consents to receiving phone calls.

gender

String

False

Enum type representing the user's gender (male, female).

date_of_birth

Datefield

True

The user's date of birth, formatted as YYYY-MM-DD.

phone

String

True

The user's phone number, validated and required for updates.

attributes

Dict

False

Additional customizable user attributes in key-value pairs.

language_code

String

False

The user's preferred language code (e.g., en, de).

code

String

False

The SMS verification code required for phone number changes.

resend

Boolean

False

Indicates if an SMS verification code should be resent.

Request Body

{
    "phone": "5555555555",
    "code": "123456",
    "resend": false,
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "attributes": {"preferred_language": "English"}
}

Example Request

import requests
import json

url = "https://{commerce_url}/users/profile-with-loyalty/"

headers = {
  'Content-Type': 'application/json',
  'Cookie': '<cookie-name>=<session_id>'
  'Accept-Language': '<iso_language_code>',
  'x-csrftoken': '<token>'
}

payload = json.dumps({
    "phone": "5555555555",
    "code": "123456",
    "resend": false,
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "attributes": {"preferred_language": "English"}
})

response = requests.patch(url, headers=headers, data=payload)
print(response.text)

Example Response (202 Accepted)

SMS verification is required, and a code has been sent to the new phone number:

{
  "id": 1234,
  "first_name": "John",
  "last_name": "Doe",
  "email_allowed": false,
  "sms_allowed": true,
  "call_allowed": false,
  "avatar": "https://example.com/avatar.png",
  "email": "john.doe@example.com",
  "phone": "0123456789",
  "date_of_birth": "1990-05-15",
  "gender": "male",
  "genders": [
    {
      "value": "female",
      "label": "female"
    },
    {
      "value": "male",
      "label": "male"
    }
  ],
  "language_code": "en-gb",
  "attributes": {
    "register_client_type": "mobile",
    "logged_ip": "192.168.1.1",
    "kvkk_flat_page_version": "101",
    "confirm": false
  },
  "date_joined": "2023-06-01T12:30:45.123456Z"
}

Example Response (200 OK)

{
  "id": 1234,
  "first_name": "John",
  "last_name": "Doe",
  "email_allowed": false,
  "sms_allowed": true,
  "call_allowed": false,
  "avatar": "https://example.com/avatar.png",
  "email": "john.doe@example.com",
  "phone": "0123456789",
  "date_of_birth": "1990-05-15",
  "gender": "male",
  "genders": [
    {
      "value": "female",
      "label": "female"
    },
    {
      "value": "male",
      "label": "male"
    }
  ],
  "language_code": "en-gb",
  "attributes": {
    "register_client_type": "mobile",
    "logged_ip": "192.168.1.1",
    "kvkk_flat_page_version": "101",
    "confirm": false
  },
  "date_joined": "2023-06-01T12:30:45.123456Z"
}

When resend is True:

{
    "message": "success"
}

Example Response (406 Not Acceptable)

{
    "non_field_errors": "Phone numbers do not match.",
    "error_code": "sms_verification_100_1"
}
{
    "non_field_errors": "Verification codes do not match.",
    "error_code": "sms_verification_100_2"
}

Example Response (400 Bad Request)

{
	"phone": [
    	"This field is required."
	]
}

POST User Register with Loyalty Card Account

This endpoint allows users to register a new account, with the option to link their account to a loyalty card. The registration process includes SMS verification for the phone number and, if requested, loyalty account synchronization.

The CUSTOMER_LOYALTY_CARD_SERVICE dynamic setting must be configured to communicate with the third-party loyalty card service.

  • The system validates the phone number to ensure it is unique.

  • The system requires an SMS verification code, provided in the code field.

  • If resend is set to true, a new SMS verification code is sent.

  • If add_loyalty is set to true, a loyalty card is created and synchronized with the user's account.

Path: /users/register-with-loyalty/

Authentication Required: No

Headers:

Content-Type: application/json
Accept-Language: <iso_language_code>
x-csrftoken: <token>

Body Parameters

Property
Data Type
Required
Description

first_name

String

True

The first name of the user.

last_name

String

True

The last name of the user

email

String

True

The email address of the user.

password

String

True

The password of the user

phone

String

True

The user's phone number, validated and required for updates.

email_allowed

Boolean

False

Indicates if the user consents to receiving emails.

sms_allowed

Boolean

False

Indicates if the user consents to receiving SMS messages.

call_allowed

Boolean

False

Indicates if the user consents to receiving phone calls.

gender

String

False

Enum type representing the user's gender (male, female).

date_of_birth

String

True

The user's date of birth, formatted as YYYY-MM-DD.

attributes

Dict

False

Additional customizable user attributes in key-value pairs.

language_code

String

False

The user's preferred language code (e.g., en, de).

code

String

False

The SMS verification code required for phone number changes.

resend

Boolean

False

Indicates if an SMS verification code should be resent.

add_loyalty

Boolean

False

Indicates whether a loyalty card should be created and linked to the user.

Request Body

{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "password": "SecurePassword123",
    "phone": "+1234567890",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "add_loyalty": true,
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": false
}

Example Request

import requests
import json

url = "https://{commerce_url}/users/register-with-loyalty/"

headers = {
  'Content-Type': 'application/json',
  'Accept-Language': '<iso_language_code>',
  'x-csrftoken': '<token>'
}

payload = json.dumps({
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "password": "SecurePassword123",
    "phone": "+1234567890",
    "date_of_birth": "1990-01-01",
    "gender": "male",
    "add_loyalty": true,
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": false
})

response = requests.post(url, headers=headers, data=payload)
print(response.text)

Example Response (201 Created)

{
  "id": 1234,
  "first_name": "John",
  "last_name": "Doe",
  "email_allowed": false,
  "sms_allowed": true,
  "call_allowed": false,
  "avatar": "https://example.com/avatar.png",
  "email": "john.doe@example.com",
  "phone": "0123456789",
  "date_of_birth": "1990-05-15",
  "gender": "male",
  "genders": [
    {
      "value": "female",
      "label": "female"
    },
    {
      "value": "male",
      "label": "male"
    }
  ],
  "language_code": "en-gb",
  "attributes": {
    "register_client_type": "mobile",
    "logged_ip": "192.168.1.1",
    "kvkk_flat_page_version": "101",
    "confirm": false
  },
  "date_joined": "2023-06-01T12:30:45.123456Z"
}

Example Response (202 Accepted)

{
  "id": 1234,
  "first_name": "John",
  "last_name": "Doe",
  "email_allowed": false,
  "sms_allowed": true,
  "call_allowed": false,
  "avatar": "https://example.com/avatar.png",
  "email": "john.doe@example.com",
  "phone": "0123456789",
  "date_of_birth": "1990-05-15",
  "gender": "male",
  "genders": [
    {
      "value": "female",
      "label": "female"
    },
    {
      "value": "male",
      "label": "male"
    }
  ],
  "language_code": "en-gb",
  "attributes": {
    "register_client_type": "mobile",
    "logged_ip": "192.168.1.1",
    "kvkk_flat_page_version": "101",
    "confirm": false
  },
  "date_joined": "2023-06-01T12:30:45.123456Z"
}

Example Response (200 OK)

When resend is True:

{
    "message": "success"
}

Example Response (406 Not Acceptable)

{
    "non_field_errors": "Phone numbers do not match.",
    "error_code": "sms_verification_100_1"
}
{
    "non_field_errors": "Verification codes do not match.",
    "error_code": "sms_verification_100_2"
}

GET List User Segments

Lists all segments that are assigned to the authenticated user. Segments are typically used for categorizing users based on different attributes like roles, behaviors, or preferences.

Path: /users/segments/

Authentication Required: Yes

Headers:

Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>

Example Request

import requests

url = "https://{commerce_url}/users/segments/"

headers = {
  'Accept-Language: '<iso_language_code>',
  'Cookie': '<cookie-name>=<session_id>'
}

response = requests.get(url, headers=headers)
print(response.text)

Example Response (200 OK)

[
    {
        "priority": 0,
        "pk": 107,
        "name": "Employee Segment"
    },
    {
        "priority": 1,
        "pk": 108,
        "name": "Manager Segment"
    }
]

Response Parameters:

Property
Data Type
Description

pk

Integer

The unique ID of the segment.

priority

Integer

The priority of the segment, which may affect its ordering.

name

String

The name of the segment.

POST Set User Segment

This endpoint is used to assign a specific segment to the authenticated user. Segments are typically used for categorizing users based on different attributes like roles, behaviors, or preferences.

Set a specific segment for the authenticated user.

Path: /users/segments/<segment_id>/set/

Authentication Required: Yes

Headers:

Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
x-csrftoken: <token>

Example Request

import requests

url = "https://{commerce_url}/segments/<pk>/set/"

headers = {
  'Accept-Language: '<iso_language_code>',
  'Cookie': '<cookie-name>=<session_id>',
  'x-csrftoken': '<token>'
}

response = requests.post(url, headers=headers)
print(response.json())

Example Response (200 OK)

{
    "priority": 0,
    "pk": 109,
    "price_list": {
        "pk": 73,
        "name": "Default Price List",
        "code": "T123",
        "currency": "usd"
    },
    "name": "Employee Segment"
}

Example Response (406 Not Acceptable)

{
    "non_field_errors": "Segment with ID 12 is not available for user 10.",
    "error_code": "segment_100_1"
}
PreviousPassword & OTP OperationsNextUser Payment & Card Management

Was this helpful?