My Project
  1. Customer
My Project
  • Untitled Doc
  • Sample APIs
    • Add a new pet to the store
      POST
    • Update an existing pet
      PUT
    • Finds Pets by status
      GET
    • Find pet by ID
      GET
    • Deletes a pet
      DELETE
  • pet
    • uploads an image
      POST
    • Finds Pets by tags
      GET
    • Updates a pet in the store with form data
      POST
  • store
    • Returns pet inventories by status
      GET
    • Place an order for a pet
      POST
    • Find purchase order by ID
      GET
    • Delete purchase order by ID
      DELETE
  • user
    • Creates list of users with given input array
      POST
    • Get user by user name
      GET
    • Updated user
      PUT
    • Delete user
      DELETE
    • Logs user into the system
      GET
    • Logs out current logged in user session
      GET
    • Creates list of users with given input array
      POST
    • Create user
      POST
  • 👀 A_接口状态_看效果
    • 1_开发中_全参数测试-接口文档默认mock
  • User
    • Authentication
      • refresh_token_create
      • logoutAllDevices
      • logoutDevice
      • sendOTP
    • Customer
      • AuthenticateCustomer
        POST
      • GetCustomerDetails
        GET
      • UpdateCustomer
        PATCH
      • DeleteCustomer
        DELETE
  • Location
    • Country
      • ListCountries
    • Region
      • GetRegionByPoint
    • Address
      • ListAddresses
      • CreateAddress
      • UpdateAddress
      • DeleteAddress
  • Wallet
    • listWalletDetails
    • updateWallet
  • FCM
    • Devices
      • devices_list
      • devices_create
      • devices_retrieve
      • devices_update
      • devices_destroy
      • devices_partial_update
    • Notification
      • listNotifications
      • deleteNotification
      • bulkDeleteNotifications
  • AppInfo
    • getSocialAccounts
    • getAppInfo
    • listFaqs
  1. Customer

AuthenticateCustomer

POST
/api/customers/authenticate/
User/Customer
Authenticate a customer using phone number and OTP. Creates a new customer if one doesn't exist.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/customers/authenticate/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "phone_number": "+201234567890",
    "otp": "123456",
    "device": {
        "registration_id": "your_registration_id",
        "device_id": "your_device_id",
        "type": "android"
    },
    "language": "en"
}'
Response Response Example
200 - Example 1
{
    "access": "string",
    "refresh": "string",
    "customer": {
        "id": 0,
        "phone_number": "string",
        "full_name": "string",
        "email": "user@example.com",
        "image": "http://example.com",
        "gender": "M",
        "birth_date": "2019-08-24",
        "primary_address": 0,
        "is_profile_completed": true,
        "language": "en",
        "country": {
            "code": "EG",
            "flag": "http://example.com",
            "phone_code": "stri",
            "name": "string"
        },
        "wallet": {
            "balance": "string",
            "balance_currency": "string",
            "is_use_wallet_in_payment": true
        }
    }
}

Request

Body Params application/json
phone_number
string 
required
>= 1 characters
otp
string 
required
>= 1 characters
device
object (FCMDeviceCreateRequest) 
required
registration_id
string 
required
>= 1 characters
device_id
string 
required
>= 1 characters
type
enum<string> 
optional
android - android
ios - ios
web - web
Allowed values:
androidiosweb
Default:
android
language
enum<string> 
required
en - English
ar - Arabic
Allowed values:
enar
Examples

Responses

🟢200OK
application/json
Body
access
string 
required
refresh
string 
required
customer
object (CustomerDetailed) 
required
id
integer 
read-onlyrequired
phone_number
string 
required
Should start with country code as (+966)
<= 128 characters
full_name
string 
optional
<= 255 characters
email
string <email>
optional
<= 254 characters
image
string <uri> | null 
optional
gender
enum<string> 
optional
M - Male
F - Female
NS - Not Selected
Allowed values:
MFNS
birth_date
string <date> | null 
optional
primary_address
integer  | null 
optional
is_profile_completed
boolean 
read-onlyrequired
language
enum<string> 
optional
en - English
ar - Arabic
Allowed values:
enar
country
object 
read-onlyrequired
wallet
object 
read-onlyrequired
🟢201Created
🟠400Bad Request
🟠405405
🟠406406
🟠415415
🟠429429
🔴500Server Error
Previous
sendOTP
Next
GetCustomerDetails
Built with