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
  • OMS OpenAPIs
    • Package Services
      • Default
    • Transfer Order Services
      • Default
  • 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
  • Customer Creation
  • GET Customers
  • POST Create a Customer
  • GET Customer Detail
  • PATCH Update Customer
  • PUT Update Customer

Was this helpful?

  1. Omnitron
  2. Channels

Customers

Customers are the people who create orders. A customer object must have an email and channel. All necessary information about customers is kept in customer objects. This includes information about communication permissions accepted by customers for example: email_allowed, sms_allowed etc.

Customer Creation

In order to create a customer record on the Omnitron product, any order from the marketplace must be fetched to Omnitron. When the relevant command runs in marketplace integrations, the order is created in Omnitron. At this stage, if the customer record has not been created before, customer information is created; if the customer record has been created before, the customer information is updated (works with the Upsert logic). Service methods are used in these creation and update processes.

In the integration document, the creation of the order and, accordingly, the creation of the customer will be discussed.

Potential Responses

  • 201 Created

  • 400 Bad Request

  • 404 Not Found

  • 405 Method Not Allowed

  • 406 Not Acceptable

GET Customers

Returns all objects in the Customers table paged.

Path: /api/v1/customers/

Filters

The available filters are as follows.

"filters": {
   "created_date": {
       "type": "DateFilter",
       "lookup_types": [
           "exact",
           "gt",
           "gte",
           "lt",
           "lte",
           "date"
       ]
   },
   "modified_date": {
       "type": "DateFilter",
       "lookup_types": [
           "exact",
           "gt",
           "gte",
           "lt",
           "lte",
           "date"
       ]
   },
   "attributes": {
       "type": "JsonMethodFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "channel": {
       "type": "ModelMultipleChoiceFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "email": {
       "type": "CharFilter",
       "lookup_types": [
           "exact",
           "startswith"
       ]
   },
   "first_name": {
       "type": "CharFilterWithNull",
       "lookup_types": [
           "exact"
       ]
   },
   "last_name": {
       "type": "CharFilterWithNull",
       "lookup_types": [
           "exact"
       ]
   },
   "phone_number": {
       "type": "CharFilterWithNull",
       "lookup_types": [
           "exact"
       ]
   },
   "is_active": {
       "type": "BooleanFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "channel_code": {
       "type": "CharFilterWithNull",
       "lookup_types": [
           "exact"
       ]
   },
   "erp_code": {
       "type": "CharFilterWithNull",
       "lookup_types": [
           "exact"
       ]
   },
   "extra_field": {
       "type": "JsonMethodFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "email_allowed": {
       "type": "BooleanFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "sms_allowed": {
       "type": "BooleanFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "call_allowed": {
       "type": "BooleanFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "date_joined": {
       "type": "IsoDateTimeFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "gender": {
       "type": "ChoiceFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "user_type": {
       "type": "ChoiceFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "date_of_birth": {
       "type": "DateFilter",
       "lookup_types": [
           "exact"
       ]
   },
   "id": {
       "type": "NumberFilter",
       "lookup_types": [
           "exact",
           "gt",
           "gte",
           "lt",
           "lte"
       ]
   },
   "pk": {
       "type": "NumberFilter",
       "lookup_types": [
           "exact",
           "gt",
           "gte",
           "lt",
           "lte"
       ]
   },
   "mapping": {
       "type": "RelatedFilter",
       "lookup_types": "See available filters for Integration Mappings"
   }
}

Request

import requests
url = "{omnitron}/api/v1/customers/"
payload={}
headers = {
...
}
response = requests.request("GET", url, headers=headers, data=payload)

Response

{
    "count": 2,
    "next": "http://{customer_omnitron_url}/api/v1/customers/?page=2",
    "previous": null,
    "results": [
        {
            "pk": 1103,
            "channel": 1,
            "email": "test@test.com",
            "first_name": "TEST",
            "last_name": "denemeler",
            "phone_number": null,
            "is_active": true,
            "channel_code": "7",
            "erp_code": "760906",
            "extra_field": {},
            "modified_date": "2022-12-08T10:49:45.794533Z",
            "created_date": "2017-02-02T09:40:28.855012Z",
            "date_joined": "2017-01-30T08:21:20.657225Z",
            "email_allowed": false,
            "sms_allowed": true,
            "call_allowed": true,
            "gender": null,
            "attributes": {},
            "user_type": null,
            "date_of_birth": null,
            "attributes_kwargs": {},
            "localized_attributes": {},
            "localized_attributes_kwargs": {}
        },
        {
            "pk": 1134,
            "channel": 1,
            "email": "test@test.com",
            "first_name": "",
            "last_name": "",
            "phone_number": null,
            "is_active": false,
            "channel_code": "Shop",
            "erp_code": null,
            "extra_field": {},
            "modified_date": "2023-01-17T09:01:27.544053Z",
            "created_date": "2023-01-17T09:01:27.544026Z",
            "date_joined": null,
            "email_allowed": false,
            "sms_allowed": false,
            "call_allowed": false,
            "gender": null,
            "attributes":  {
                "logged_ip": "127.0.0.1"
            },
            "user_type": null,
            "date_of_birth": null,
            "attributes_kwargs": {},
            "localized_attributes": {},
            "localized_attributes_kwargs": {}
            "user_type": "registered"
        },
    ]
}

POST Create a Customer

Records new objects in the Customer table. The CustomerSerializer class defined at omnitron.customers.resources.serializers is used to validate the data.

Path: /api/v1/customers/

Body

{
   "email": "test@test.com",
   "channel": 1,
   "channel_code": "1231",
   "gender": "male",
   "user_type": "registered",
   "is_active": false,
   "erp_code": "er_code",
   "email_allowed": true,
   "sms_allowed": true,
   "call_allowed": true,
   "phone_number": "05555555555",
   "attributes": {},
   "extra_field": {},
   "date_of_birth": "2001-01-01"
}

Response

{
    "pk": 1117,
    "channel": 1,
    "email": "test@test.com",
    "first_name": "",
    "last_name": "",
    "phone_number": "05555555555",
    "is_active": false,
    "channel_code": "1231",
    "erp_code": "er_code",
    "extra_field": {},
    "modified_date": "2021-05-26T13:53:58.585932Z",
    "created_date": "2021-05-26T13:53:58.585910Z",
    "date_joined": null,
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": true,
    "gender": "male",
    "attributes": {},
    "user_type": "registered",
    "date_of_birth": "2001-01-01",
    "attributes_kwargs": {},
    "localized_attributes": {},
    "localized_attributes_kwargs": {}
}

Response HTTP 400

{
    "non_field_errors": [
        "The fields channel, channel_code must make a unique set."
    ]
}

-- OR

{
    "email": [
        "This field is required."
    ],
    "channel": [
        "This field is required."
    ],
    "channel_code": [
        "This field is required."
    ]
}

-- OR

{
    "email": [
        "Enter a valid email address."
    ]
}

GET Customer Detail

Returns the object specified with the primary key in the Customers table by serializing it with the CustomerSerializer class defined at omnitron.customers.resources.serializers.

Path: /api/v1/customers/{pk}/

Request

url = "{customer_omnitron_url}/api/v1/customers/1135/"
payload={}
headers = {
 'Authorization':...'
}

response = requests.request("GET", url, headers=headers, data=payload)

Successful Response

{
    "pk": 1117,
    "channel": 1,
    "email": "test@test.com",
    "first_name": "",
    "last_name": "",
    "phone_number": "05555555555",
    "is_active": false,
    "channel_code": "1231",
    "erp_code": "er_code",
    "extra_field": {},
    "modified_date": "2021-05-26T13:53:58.585932Z",
    "created_date": "2021-05-26T13:53:58.585910Z",
    "date_joined": null,
    "email_allowed": true,
    "sms_allowed": true,
    "call_allowed": true,
    "gender": "male",
    "attributes": {},
    "user_type": "registered",
    "date_of_birth": "2001-01-01",
    "attributes_kwargs": {},
    "localized_attributes": {},
    "localized_attributes_kwargs": {}

}

Failed Response

{
    "detail": "Not found."
}

PATCH Update Customer

Updates the object of the relevant primary key in the Customer table with the provided parameters.

Path: /api/v1/customers/{pk}/

{
   "is_active": true,
   "email_allowed": false,
   "sms_allowed": false,
   "user_type": "registered"
}

Response

{
    "pk": 1117,
    "channel": 1,
    "email": "test@test.com",
    "first_name": "",
    "last_name": "",
    "phone_number": "05555555555",
    "is_active": true,
    "channel_code": "1231",
    "erp_code": "er_code",
    "extra_field": {},
    "modified_date": "2021-05-26T14:24:11.776744Z",
    "created_date": "2021-05-26T13:53:58.585910Z",
    "date_joined": null,
    "email_allowed": false,
    "sms_allowed": false,
    "call_allowed": true,
    "gender": "female",
    "attributes": {},
    "user_type": "registered",
    "date_of_birth": "2001-01-01",
    "attributes_kwargs": {},
    "localized_attributes": {},
    "localized_attributes_kwargs": {}
}
HTTP 406  
{
    "non_field_errors": "channel:channel_name These field cannot be updated",
    "error_code": "customer_100_3"
} 

PUT Update Customer

Allows to change the information of the relevant primary key in the Customer table. Mandatory parameters must be sent.

Path: /api/v1/customers/{pk}/

{
    "email": "test2@test.com",
    "channel": 1,
    "channel_code": "1231",
    "is_active": true,
    "email_allowed": false,
    "sms_allowed": false,
    "user_type": "registered",
    "extra_field": {}
}

Successful Response

{
    "pk": 1117,
    "channel": 1,
    "email": "test2@test.com",
    "first_name": "",
    "last_name": "",
    "phone_number": "05555555555",
    "is_active": true,
    "channel_code": "1231",
    "erp_code": "er_code",
    "extra_field": {},
    "modified_date": "2021-05-26T14:26:52.809180Z",
    "created_date": "2021-05-26T13:53:58.585910Z",
    "date_joined": null,
    "email_allowed": false,
    "sms_allowed": false,
    "call_allowed": true,
    "gender": "female",
    "attributes": {},
    "user_type": "registered",
    "date_of_birth": "2001-01-01",
    "attributes_kwargs": {},
    "localized_attributes": {},
    "localized_attributes_kwargs": {}
}

Failed Response

If we remove the email data from the body example, the following response will be returned.

HTTP 400  
{
    "extra_field": [
        "This field is required."
    ],
    "channel": [
        "This field is required."
    ],
    "channel_code": [
        "This field is required."
    ]
}

Note: When we change the channel information and send a PUT or PATCH request in the body example, the following response will be returned.

HTTP 406  
{
    "non_field_errors": "channel:channel_name These field cannot be updated",
    "error_code": "customer_100_3"
} 
PreviousPaymentsNextOrder

Last updated 26 days ago

Was this helpful?