Skip to content

Customer ​

INFO

Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.

POST /customer/create ​

This method allows adding customer into the account.

So‘rov tanasi

MaydonTurMajburiyTavsif
namestringHa
typestringYo‘qtype customer. Mumkin qiymatlar: legal, natural
category_idstringYo‘q
statestringYo‘qMumkin qiymatlar: new, warning, black_list, active
innstringYo‘q
director_namestringYo‘q
addressstringYo‘q
delivery_addressobjectYo‘q
delivery_address.longnumberYo‘q
delivery_address.latnumberYo‘q
delivery_address.human_addressobjectYo‘q
delivery_address.human_address.addressstringYo‘qStandart: "string"
delivery_address.human_address.citystringYo‘qStandart: "string"
delivery_address.human_address.statestringYo‘qStandart: "string"
delivery_address.human_address.zipstringYo‘qStandart: "string"
bank_namestringYo‘q
agent_idstringYo‘q
responsible_idstringYo‘q
account_numberstringYo‘q
mfostringYo‘q
loyalty_card_idstringYo‘q
qqs_numberstringYo‘q
phone_numberstringYo‘q
phone_numbersstring[]Yo‘q
company_phone_numberstringYo‘q
descriptionstringYo‘q
organization_idsstring[]Ha
debt_limitsobjectYo‘q
debt_limits.organization_idstringYo‘q
debt_limits.limitnumberYo‘q
debt_limits.customer_idstringYo‘q
organization_idstringYo‘q
person_idstringYo‘q
okedstringYo‘q
genderstringYo‘qMumkin qiymatlar: male, female
imagestringYo‘q
last_namestringYo‘q
middle_namestringYo‘q
birth_datestringYo‘q
legal_person_idstringYo‘q
telegram_linkstringYo‘q
is_supplierbooleanYo‘qStandart: false
statusstringYo‘qMumkin qiymatlar: active, inactive
short_namestringYo‘q
web_sitestringYo‘q
codestringYo‘q
postal_codestringYo‘q
owner_idstringYo‘q
manager_idstringYo‘q
custom_fieldsobjectYo‘q
custom_fields._idstringYo‘q
custom_fields.valueanyYo‘q
json
{
  "name": "string",
  "type": "legal",
  "category_id": "string",
  "state": "new",
  "inn": "string",
  "director_name": "string",
  "address": "string",
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    }
  },
  "bank_name": "string",
  "agent_id": "string",
  "responsible_id": "string",
  "account_number": "string",
  "mfo": "string",
  "loyalty_card_id": "string",
  "qqs_number": "string",
  "phone_number": "string",
  "phone_numbers": [
    "string"
  ],
  "company_phone_number": "string",
  "description": "string",
  "organization_ids": [
    "string"
  ],
  "debt_limits": {
    "organization_id": "string",
    "limit": 0,
    "customer_id": "string"
  },
  "organization_id": "string",
  "person_id": "string",
  "oked": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "is_supplier": false,
  "status": "active",
  "short_name": "string",
  "web_site": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "string",
  "manager_id": "string",
  "custom_fields": {
    "_id": "string",
    "value": null
  }
}

Javob

MaydonTurTavsif
_idstringid of customer
created_atstring
updated_atstring
namestring
typestring
innstring
director_namestring
addressstring
bank_namestring
account_numberstring
pinflstring
director_pinflstring
mfostring
okedstring
qqs_numberstring
phone_numberstring
phone_numbersstring[]
company_phone_numberstring
descriptionstring
organization_idsstring[]
last_sale_atstring
first_sale_atstring
total_salenumber
avg_salenumber
pointnumber
balancenumber
balance_currency_idstring
balancesobject
balances.balancenumber
balances.balance_currency_idstring
balance_listobject[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "created_at": "string",
    "updated_at": "string",
    "name": "string",
    "type": "string",
    "inn": "string",
    "director_name": "string",
    "address": "string",
    "bank_name": "string",
    "account_number": "string",
    "pinfl": "string",
    "director_pinfl": "string",
    "mfo": "string",
    "oked": "string",
    "qqs_number": "string",
    "phone_number": "string",
    "phone_numbers": [
      "string"
    ],
    "company_phone_number": "string",
    "description": "string",
    "organization_ids": [
      "string"
    ],
    "last_sale_at": "string",
    "first_sale_at": "string",
    "total_sale": 0,
    "avg_sale": 0,
    "point": 0,
    "balance": 0,
    "balance_currency_id": "string",
    "balances": {
      "balance": 0,
      "balance_currency_id": "string"
    },
    "balance_list": [
      {}
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /customer/update ​

This method allows updating customer in the account.

So‘rov tanasi

MaydonTurMajburiyTavsif
namestringHa
typestringYo‘qtype customer. Mumkin qiymatlar: legal, natural
category_idstringYo‘q
statestringYo‘qMumkin qiymatlar: new, warning, black_list, active
innstringYo‘q
director_namestringYo‘q
addressstringYo‘q
delivery_addressobjectYo‘q
delivery_address.longnumberYo‘q
delivery_address.latnumberYo‘q
delivery_address.human_addressobjectYo‘q
delivery_address.human_address.addressstringYo‘qStandart: "string"
delivery_address.human_address.citystringYo‘qStandart: "string"
delivery_address.human_address.statestringYo‘qStandart: "string"
delivery_address.human_address.zipstringYo‘qStandart: "string"
bank_namestringYo‘q
agent_idstringYo‘q
responsible_idstringYo‘q
account_numberstringYo‘q
mfostringYo‘q
loyalty_card_idstringYo‘q
qqs_numberstringYo‘q
phone_numberstringYo‘q
phone_numbersstring[]Yo‘q
company_phone_numberstringYo‘q
descriptionstringYo‘q
organization_idsstring[]Ha
debt_limitsobjectYo‘q
debt_limits.organization_idstringYo‘q
debt_limits.limitnumberYo‘q
debt_limits.customer_idstringYo‘q
organization_idstringYo‘q
person_idstringYo‘q
okedstringYo‘q
genderstringYo‘qMumkin qiymatlar: male, female
imagestringYo‘q
last_namestringYo‘q
middle_namestringYo‘q
birth_datestringYo‘q
legal_person_idstringYo‘q
telegram_linkstringYo‘q
is_supplierbooleanYo‘qStandart: false
statusstringYo‘qMumkin qiymatlar: active, inactive
short_namestringYo‘q
web_sitestringYo‘q
codestringYo‘q
postal_codestringYo‘q
owner_idstringYo‘q
manager_idstringYo‘q
custom_fieldsobjectYo‘q
custom_fields._idstringYo‘q
custom_fields.valueanyYo‘q
_idstringHaid of customer
json
{
  "name": "string",
  "type": "legal",
  "category_id": "string",
  "state": "new",
  "inn": "string",
  "director_name": "string",
  "address": "string",
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "address": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    }
  },
  "bank_name": "string",
  "agent_id": "string",
  "responsible_id": "string",
  "account_number": "string",
  "mfo": "string",
  "loyalty_card_id": "string",
  "qqs_number": "string",
  "phone_number": "string",
  "phone_numbers": [
    "string"
  ],
  "company_phone_number": "string",
  "description": "string",
  "organization_ids": [
    "string"
  ],
  "debt_limits": {
    "organization_id": "string",
    "limit": 0,
    "customer_id": "string"
  },
  "organization_id": "string",
  "person_id": "string",
  "oked": "string",
  "gender": "male",
  "image": "string",
  "last_name": "string",
  "middle_name": "string",
  "birth_date": "string",
  "legal_person_id": "string",
  "telegram_link": "string",
  "is_supplier": false,
  "status": "active",
  "short_name": "string",
  "web_site": "string",
  "code": "string",
  "postal_code": "string",
  "owner_id": "string",
  "manager_id": "string",
  "custom_fields": {
    "_id": "string",
    "value": null
  },
  "_id": "string"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.

DELETE /customer/delete/{id} ​

Delete a customer

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

GET /customer/get-by-id/{id} ​

Get customer using its _id

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.

POST /customer/get-paging ​

Get customers by paging

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
updated_atstringYo‘q
organization_idstringYo‘q
searchstringYo‘q
phone_numberstringYo‘q
json
{
  "page": 1,
  "limit": 20,
  "updated_at": "string",
  "organization_id": "string",
  "search": "string",
  "phone_number": "string"
}

Javob

data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.

MaydonTurTavsif
_idstringid of customer
created_atstring
updated_atstring
namestring
typestring
innstring
director_namestring
addressstring
bank_namestring
account_numberstring
pinflstring
director_pinflstring
mfostring
okedstring
qqs_numberstring
phone_numberstring
phone_numbersstring[]
company_phone_numberstring
descriptionstring
organization_idsstring[]
last_sale_atstring
first_sale_atstring
total_salenumber
avg_salenumber
pointnumber
balancenumber
balance_currency_idstring
balancesobject
balances.balancenumber
balances.balance_currency_idstring
balance_listobject[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "string",
        "created_at": "string",
        "updated_at": "string",
        "name": "string",
        "type": "string",
        "inn": "string",
        "director_name": "string",
        "address": "string",
        "bank_name": "string",
        "account_number": "string",
        "pinfl": "string",
        "director_pinfl": "string",
        "mfo": "string",
        "oked": "string",
        "qqs_number": "string",
        "phone_number": "string",
        "phone_numbers": [
          "string"
        ],
        "company_phone_number": "string",
        "description": "string",
        "organization_ids": [
          "string"
        ],
        "last_sale_at": "string",
        "first_sale_at": "string",
        "total_sale": 0,
        "avg_sale": 0,
        "point": 0,
        "balance": 0,
        "balance_currency_id": "string",
        "balances": {
          "balance": 0,
          "balance_currency_id": "string"
        },
        "balance_list": [
          {}
        ]
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /customer/get-deleted ​

Get deleted customer ids

So‘rov parametrlari

ParametrTurMajburiyTavsif
deleted_atstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}

PUT /customer/set-state ​

setState customer

So‘rov tanasi

MaydonTurMajburiyTavsif
_idstringHa
statestringHaMumkin qiymatlar: black_list, new, active, warning
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a",
  "state": "new"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.

GET /customer/get-by-phone-number ​

Find a customer by phone number.

So‘rov parametrlari

ParametrTurMajburiyTavsif
phone_numberstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /customer/create.


Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API