Skip to content

Sale order ​

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 /sale-order/create ​

Create a sale order. The optional uuid field is tenant-global among active sale orders. The authenticated integration source gates replay: a same-source replay returns the active existing order, while an active UUID owned by another or missing source returns the existing sale-order collision error. Omitting uuid preserves normal creation behavior. After an order is soft-deleted, its UUID may be reused.

So‘rov tanasi

MaydonTurMajburiyTavsif
uuidstringYo‘qOptional external idempotency key. UUID uniqueness is tenant-global among active sale orders. The authenticated integration source gates replay: if it owns the active UUID, the existing order is returned; an active UUID owned by another or missing source returns the sale-order AlreadyExists collision. Source ownership is never accepted from the request body. After an order is soft-deleted, its UUID may be reused.
codestringYo‘q
namestringYo‘q
organization_idstringHa
visit_idstringYo‘q
customer_idstringHa
customer_assistant_idstringYo‘q
responsible_idstringHa
currency_idstringYo‘q
currencyobjectYo‘q
currency._idstring (objectId)Yo‘q
currency.numeratornumberHa
currency.denominatornumberHa
currency.valuenumberHa
currency.precisionnumberYo‘q
currency.round_typestringYo‘qMumkin qiymatlar: floor, ceil, round
statestringHaMumkin qiymatlar: new, draft, in_progress, canceled, done, accepted
state_idstringYo‘q
datestringHa
delivery_datestringYo‘q
notestringYo‘qComplete order note. Integration creates preserve long courier, pickup, and customer instructions; the API request-body limit still applies.
discountsobject[]Ha
discounts[]._idstring (objectId)Yo‘q
discounts[].valuenumberHa
discounts[].namestringHa
discounts[].apply_typestringYo‘qMumkin qiymatlar: percent, cash
discounts[].is_custombooleanYo‘q
productsobject[]Ha
products[].product_idstring (objectId)Ha
products[].amountnumberHa
products[].pricenumberHa
products[].real_pricenumberYo‘q
products[].discountsobject[]Yo‘q
products[].discounts[]._idstring (objectId)Yo‘q
products[].discounts[].valuenumberHa
products[].discounts[].namestringHa
products[].discounts[].apply_typestringYo‘qMumkin qiymatlar: percent, cash
products[].discounts[].is_custombooleanYo‘q
products[].price_idstring (objectId)Ha
products[].warehouse_idstring (objectId)Ha
products[].box_countnumberYo‘q
products[].box_itemnumberYo‘q
products[].productobjectYo‘q
products[].product.namestringYo‘q
products[].product.product_idstringYo‘q
products[].product.measure_idstringYo‘q
products[].product.measureobjectYo‘q
delivery_addressobjectYo‘q
delivery_address.longnumberHa
delivery_address.latnumberHa
delivery_address.human_addressobjectYo‘q
delivery_address.human_address.addresstringYo‘q
delivery_address.human_address.citystringYo‘q
delivery_address.human_address.statestringYo‘q
delivery_address.human_address.zipstringYo‘q
price_idstringYo‘q
custom_fieldsobjectYo‘q
custom_fields._idstringYo‘q
custom_fields.valueobjectYo‘q
json
{
  "uuid": "external-order-123",
  "code": "string",
  "name": "string",
  "organization_id": "67b486d242ed76693cd2cc59",
  "visit_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59",
  "customer_assistant_id": "67b486d242ed76693cd2cc59",
  "responsible_id": "67b486d242ed76693cd2cc59",
  "currency_id": "67b486d242ed76693cd2cc59",
  "currency": {
    "_id": "66126f4b1e2f4a9cb4244c8f",
    "numerator": 1,
    "denominator": 1000,
    "value": 11000,
    "precision": 3,
    "round_type": "floor"
  },
  "state": "new",
  "state_id": "67b486d242ed76693cd2cc59",
  "date": "2023-10-01T12:00:00Z",
  "delivery_date": "2023-10-01T12:00:00Z",
  "note": "string",
  "discounts": [
    {
      "_id": "66126f4b1e2f4a9cb4244c90",
      "value": 10,
      "name": "10%",
      "apply_type": "percent",
      "is_custom": true
    }
  ],
  "products": [
    {
      "product_id": "66126f4b1e2f4a9cb4244a01",
      "amount": 2,
      "price": 15000,
      "real_price": 14500,
      "discounts": [],
      "price_id": "66126f4b1e2f4a9cb4244a02",
      "warehouse_id": "66126f4b1e2f4a9cb4244a03",
      "box_count": 2,
      "box_item": 24,
      "product": {
        "name": null,
        "product_id": null,
        "measure_id": null,
        "measure": null
      }
    }
  ],
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "addres": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    }
  },
  "price_id": "2023-10-01T12:00:00Z",
  "custom_fields": {
    "_id": "67b486d242ed76693cd2cc59",
    "value": {}
  }
}

Javob

MaydonTurTavsif
_idstring
created_atstring
updated_atstring
namestring
uuidstring
visit_idstring
codestring
organization_idstring
organizationobject
organization._idstring
organization.namestring
customer_idstring
customerobject
customer._idstring
customer.typestringMumkin qiymatlar: legal, natural
customer.phone_numberstring
customer.phone_numbersstring[]
customer.namestring
customer.imagestring
customer.custom_fieldsobject[]
customer.custom_fields[]._idstring
customer.custom_fields[].valueobject
customer_assistantobject
customer_assistant._idstring
customer_assistant.namestring
customer_assistant.typestringMumkin qiymatlar: legal, natural
customer_assistant_hierarchyobject[]
customer_assistant_hierarchy[]._idstring
customer_assistant_hierarchy[].namestring
customer_assistant_hierarchy[].typestringMumkin qiymatlar: legal, natural
customer_assistant_hierarchy[].first_namestring
customer_assistant_hierarchy[].last_namestring
customer_assistant_hierarchy[].middle_namestring
responsible_idstring
customer_image_urlstring
responsibleobject
responsible._idstring
responsible.full_namestring
price_idstring
priceobject
price._idstring
price.namestring
price.short_namestring
price.codestring
state_idstring
statestringMumkin qiymatlar: new, draw, in_progress, canceled, done, accepted
notestring
datestring
delivery_datestring
numberstring
deviceobject
device._idstring
device.namestring
device.device_idstring
currencyobject
currency._idstring (objectId)
currency.to_currency_idstring (objectId)
currency.uuidnumber
currency.namestring
currency.valuenumber
currency.symbolstring
currency.sidestringMumkin qiymatlar: start, end
currency.numeratornumber
currency.denominatornumber
currency.round_typestringMumkin qiymatlar: floor, ceil, round
currency.precisionnumber
currency_idstring
total_to_paynumber
total_pricenumber
discountnumber
total_discountnumber
discountsobject[]
discounts[]._idstring
discounts[].namestring
discounts[].valuenumber
discounts[].apply_typestringMumkin qiymatlar: percent, cash
discounts[].currency_idstring
productsobject[]
delivery_addressobject
delivery_address.longnumber
delivery_address.latnumber
delivery_address.human_addressobject
delivery_address.human_address.addresstring
delivery_address.human_address.citystring
delivery_address.human_address.statestring
delivery_address.human_address.zipstring
total_salenumber
total_amountnumber
trade_statusstringMumkin qiymatlar: zero, partial, fully
tradesobject[]
trades[]._idstring
trades[].typestringMumkin qiymatlar: b2b, b2c
trades[].organization_idstring
trades[].statestringMumkin qiymatlar: new, in_progress, draft, canceled, done
trades[].state_idstring
trades[].numberstring
trades[].uuidnumber
trades[].currencyobject
trades[].currency._idstring
trades[].currency.to_currency_idstring
trades[].currency.namestring
trades[].currency.valuenumber
trades[].currency.numeratornumber
trades[].currency.denominatornumber
trades[].currency.round_typestringMumkin qiymatlar: floor, ceil, round
trades[].currency.precisionnumber
trades[].cashbox_idstring
trades[].calc_tax_after_discountboolean
trades[].sale_settingsobject
trades[].sale_settings.discountnumber
trades[].total_extra_costnumber
trades[].total_effected_extra_costnumber
custom_fieldsobject[]
custom_fields[]._idstring
custom_fields[].valuestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "created_at": "string",
    "updated_at": "string",
    "name": "string",
    "uuid": "external-order-123",
    "visit_id": "67b486d242ed76693cd2cc59",
    "code": "67b486d242ed76693cd2cc59",
    "organization_id": "67b486d242ed76693cd2cc59",
    "organization": {
      "_id": "string",
      "name": "string"
    },
    "customer_id": "67b486d242ed76693cd2cc59",
    "customer": {
      "_id": "string",
      "type": "legal",
      "phone_number": "string",
      "phone_numbers": [
        "string"
      ],
      "name": "string",
      "image": "string",
      "custom_fields": [
        {
          "_id": null,
          "value": null
        }
      ]
    },
    "customer_assistant": {
      "_id": "string",
      "name": "string",
      "type": "legal"
    },
    "customer_assistant_hierarchy": [
      {
        "_id": "string",
        "name": "string",
        "type": "legal",
        "first_name": "string",
        "last_name": "string",
        "middle_name": "string"
      }
    ],
    "responsible_id": "string",
    "customer_image_url": "string",
    "responsible": {
      "_id": "string",
      "full_name": "string"
    },
    "price_id": "string",
    "price": {
      "_id": "string",
      "name": "string",
      "short_name": "string",
      "code": "string"
    },
    "state_id": "string",
    "state": "new",
    "note": "string",
    "date": "string",
    "delivery_date": "string",
    "number": "string",
    "device": {
      "_id": "string",
      "name": "string",
      "device_id": "string"
    },
    "currency": {
      "_id": "66126f4b1e2f4a9cb4244c8b",
      "to_currency_id": "66126f4b1e2f4a9cb4244c8c",
      "uuid": "66126f4b1e2f4a9cb4244c8d",
      "name": "string",
      "value": 1,
      "symbol": "string",
      "side": "start",
      "numerator": 1,
      "denominator": 1,
      "round_type": "floor",
      "precision": 3
    },
    "currency_id": "string",
    "total_to_pay": 0,
    "total_price": 0,
    "discount": 0,
    "total_discount": 0,
    "discounts": [
      {
        "_id": "string",
        "name": "string",
        "value": 0,
        "apply_type": "percent",
        "currency_id": "string"
      }
    ],
    "products": [
      {}
    ],
    "delivery_address": {
      "long": 0,
      "lat": 0,
      "human_address": {
        "addres": "string",
        "city": "string",
        "state": "string",
        "zip": "string"
      }
    },
    "total_sale": 0,
    "total_amount": 0,
    "trade_status": "zero",
    "trades": [
      {
        "_id": "string",
        "type": "b2b",
        "organization_id": "string",
        "state": "new",
        "state_id": "string",
        "number": "string",
        "uuid": 0,
        "currency": {
          "_id": null,
          "to_currency_id": null,
          "name": null,
          "value": null,
          "numerator": null,
          "denominator": null,
          "round_type": null,
          "precision": null
        },
        "cashbox_id": "string",
        "calc_tax_after_discount": false,
        "sale_settings": {
          "discount": null
        },
        "total_extra_cost": 0,
        "total_effected_extra_cost": 0
      }
    ],
    "custom_fields": [
      {
        "_id": "string",
        "value": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /sale-order/update ​

This method allows updating saler-order in the account.

So‘rov tanasi

MaydonTurMajburiyTavsif
_idstringHa
codestringYo‘q
namestringYo‘q
organization_idstringYo‘q
visit_idstringYo‘q
customer_idstringYo‘q
customer_assistant_idstringYo‘q
responsible_idstringYo‘q
currency_idstringHa
currencyobjectYo‘q
currency._idstring (objectId)Yo‘q
currency.numeratornumberHa
currency.denominatornumberHa
currency.valuenumberHa
currency.precisionnumberYo‘q
currency.round_typestringYo‘qMumkin qiymatlar: floor, ceil, round
datestringYo‘q
delivery_datestringYo‘q
notestringYo‘q
discountsobject[]Ha
discounts[]._idstring (objectId)Yo‘q
discounts[].valuenumberHa
discounts[].namestringHa
discounts[].discount_apply_typestringYo‘qMumkin qiymatlar: percentage, cash
discounts[].currency_idstring (objectId)Yo‘q
productsobject[]Ha
products[].product_idstring (objectId)Ha
products[].amountnumberHa
products[].pricenumberHa
products[].real_pricenumberYo‘q
products[].discountsobject[]Yo‘q
products[].discounts[]._idstring (objectId)Yo‘q
products[].discounts[].valuenumberHa
products[].discounts[].namestringHa
products[].discounts[].discount_apply_typestringYo‘qMumkin qiymatlar: percent, cash
products[].discounts[].currency_idstring (objectId)Yo‘q
products[].price_idstring (objectId)Ha
products[].warehouse_idstring (objectId)Ha
products[].box_countnumberYo‘q
products[].box_itemnumberYo‘q
products[].productobjectYo‘q
products[].product.namestringYo‘q
products[].product.product_idstringYo‘q
products[].product.measure_idstringYo‘q
products[].product.measureobjectYo‘q
delivery_addressobjectYo‘q
delivery_address.longnumberHa
delivery_address.latnumberHa
delivery_address.human_addressobjectYo‘q
delivery_address.human_address.addresstringYo‘q
delivery_address.human_address.citystringYo‘q
delivery_address.human_address.statestringYo‘q
delivery_address.human_address.zipstringYo‘q
price_idstringYo‘q
custom_fieldsobjectYo‘q
custom_fields._idstringYo‘q
custom_fields.valuestringYo‘qmust be any data types
is_offlinebooleanYo‘q
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "code": "",
  "name": "",
  "organization_id": "67b486d242ed76693cd2cc59",
  "visit_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59",
  "customer_assistant_id": "67b486d242ed76693cd2cc59",
  "responsible_id": "67b486d242ed76693cd2cc59",
  "currency_id": "67b486d242ed76693cd2cc59",
  "currency": {
    "_id": "66126f4b1e2f4a9cb4244c8f",
    "numerator": 1,
    "denominator": 1000,
    "value": 11000,
    "precision": 3,
    "round_type": "floor"
  },
  "date": "2023-10-01T12:00:00Z",
  "delivery_date": "2023-10-01T12:00:00Z",
  "note": "string",
  "discounts": [
    {
      "_id": "66126f4b1e2f4a9cb4244c90",
      "value": 10,
      "name": "10%",
      "discount_apply_type": "percentage",
      "currency_id": "66126f4b1e2f4a9cb4244c91"
    }
  ],
  "products": [
    {
      "product_id": "66126f4b1e2f4a9cb4244a01",
      "amount": 2,
      "price": 15000,
      "real_price": 14500,
      "discounts": [],
      "price_id": "66126f4b1e2f4a9cb4244a02",
      "warehouse_id": "66126f4b1e2f4a9cb4244a03",
      "box_count": 2,
      "box_item": 24,
      "product": {
        "name": null,
        "product_id": null,
        "measure_id": null,
        "measure": null
      }
    }
  ],
  "delivery_address": {
    "long": 0,
    "lat": 0,
    "human_address": {
      "addres": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    }
  },
  "price_id": "2023-10-01T12:00:00Z",
  "custom_fields": {
    "_id": "67b486d242ed76693cd2cc59",
    "value": "any"
  },
  "is_offline": false
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /sale-order/create.

DELETE /sale-order/delete/{id} ​

Delete a sale-order

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 /sale-order/get-by-id/{id} ​

Get sale-order using its _id

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /sale-order/create.

POST /sale-order/get-paging ​

Get sale-orders by paging

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
organization_idstringYo‘q
customer_idstringYo‘q
currency_idstringYo‘q
statesstring[]Yo‘q
searchstringYo‘q
date_formstringYo‘q
date_tostringYo‘q
delivery_date_fromstringYo‘q
delivery_date_tostringYo‘q
created_from_botbooleanYo‘q
trade_statusesstring[]Yo‘q
visit_idstringYo‘q
state_idstringYo‘q
namestringYo‘q
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "67b486d242ed76693cd2cc59",
  "customer_id": "67b486d242ed76693cd2cc59",
  "currency_id": "67b486d242ed76693cd2cc59",
  "states": [
    "string"
  ],
  "search": "string",
  "date_form": "2023-10-01T12:00:00Z",
  "date_to": "2023-10-01T12:00:00Z",
  "delivery_date_from": "2023-10-01T12:00:00Z",
  "delivery_date_to": "2023-10-01T12:00:00Z",
  "created_from_bot": false,
  "trade_statuses": [
    "string"
  ],
  "visit_id": "67b486d242ed76693cd2cc59",
  "state_id": "67b486d242ed76693cd2cc59",
  "name": "string"
}

Javob

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

MaydonTurTavsif
created_atstring
updated_atstring
namestring
uuidstring
codestring
organizationobject
organization._idstring
organization.namestring
customerobject
customer._idstring
customer.typestringMumkin qiymatlar: legal, natural
customer.phone_numberstring
customer.phone_numbersstring[]
customer.namestring
customer.imagestring
customer.custom_fieldsobject[]
customer.custom_fields[]._idstring
customer.custom_fields[].valueobject
customer_image_urlstring
responsibleobject
responsible._idstring
responsible.full_namestring
state_idstring
statestringMumkin qiymatlar: new, draw, in_progress, canceled, done, accepted
notestring
datestring
numberstring
currency_idstring
total_to_paynumber
total_pricenumber
total_discountnumber
total_salenumber
total_amountnumber
trade_statusstringMumkin qiymatlar: zero, partial, fully
created_from_botboolean
positionnumber
taskobject
task.type_idstring
task.datestring
task.created_bystring
task.responsible_idstring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "created_at": "string",
        "updated_at": "string",
        "name": "string",
        "uuid": "external-order-123",
        "code": "string",
        "organization": {
          "_id": "string",
          "name": "string"
        },
        "customer": {
          "_id": "string",
          "type": "legal",
          "phone_number": "string",
          "phone_numbers": [
            "string"
          ],
          "name": "string",
          "image": "string",
          "custom_fields": [
            {
              "_id": null,
              "value": null
            }
          ]
        },
        "customer_image_url": "string",
        "responsible": {
          "_id": "string",
          "full_name": "string"
        },
        "state_id": "67b486d242ed76693cd2cc59",
        "state": "new",
        "note": "string",
        "date": "string",
        "number": "string",
        "currency_id": "string",
        "total_to_pay": 0,
        "total_price": 0,
        "total_discount": 0,
        "total_sale": 0,
        "total_amount": 0,
        "trade_status": "zero",
        "created_from_bot": false,
        "position": 0,
        "task": {
          "type_id": "67b486d242ed76693cd2cc59",
          "date": "2023-10-01T12:00:00Z",
          "created_by": "67b486d242ed76693cd2cc59",
          "responsible_id": "67b486d242ed76693cd2cc59"
        }
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /sale-order/get-deleted ​

Get deleted sale-order 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 /sale-order/accept/{id} ​

Accept a sale order (mark as accepted by the responsible party).

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /sale-order/create.

POST /sale-order/get-by-customer/for-bot ​

List sale orders for a given customer, formatted for bot/external consumption.

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
customer_idstringHa
statesstring[]Yo‘q
json
{
  "page": 1,
  "limit": 20,
  "customer_id": "string",
  "states": [
    "new"
  ]
}

Javob

MaydonTurTavsif
listobject[]
list[]._idstring
list[].created_atstring
list[].updated_atstring
list[].namestring
list[].uuidstring
list[].visit_idstring
list[].codestring
list[].organization_idstring
list[].organizationobject
list[].organization._idstring
list[].organization.namestring
list[].customer_idstring
list[].customerobject
list[].customer._idstring
list[].customer.typestringMumkin qiymatlar: legal, natural
list[].customer.phone_numberstring
list[].customer.phone_numbersstring[]
list[].customer.namestring
list[].customer.imagestring
list[].customer.custom_fieldsobject[]
list[].customer_assistantobject
list[].customer_assistant._idstring
list[].customer_assistant.namestring
list[].customer_assistant.typestringMumkin qiymatlar: legal, natural
list[].customer_assistant_hierarchyobject[]
list[].customer_assistant_hierarchy[]._idstring
list[].customer_assistant_hierarchy[].namestring
list[].customer_assistant_hierarchy[].typestringMumkin qiymatlar: legal, natural
list[].customer_assistant_hierarchy[].first_namestring
list[].customer_assistant_hierarchy[].last_namestring
list[].customer_assistant_hierarchy[].middle_namestring
list[].responsible_idstring
list[].customer_image_urlstring
list[].responsibleobject
list[].responsible._idstring
list[].responsible.full_namestring
list[].price_idstring
list[].priceobject
list[].price._idstring
list[].price.namestring
list[].price.short_namestring
list[].price.codestring
list[].state_idstring
list[].statestringMumkin qiymatlar: new, draw, in_progress, canceled, done, accepted
list[].notestring
list[].datestring
list[].delivery_datestring
list[].numberstring
list[].deviceobject
list[].device._idstring
list[].device.namestring
list[].device.device_idstring
list[].currencyobject
list[].currency._idstring (objectId)
list[].currency.to_currency_idstring (objectId)
list[].currency.uuidnumber
list[].currency.namestring
list[].currency.valuenumber
list[].currency.symbolstring
list[].currency.sidestringMumkin qiymatlar: start, end
list[].currency.numeratornumber
list[].currency.denominatornumber
list[].currency.round_typestringMumkin qiymatlar: floor, ceil, round
list[].currency.precisionnumber
list[].currency_idstring
list[].total_to_paynumber
list[].total_pricenumber
list[].discountnumber
list[].total_discountnumber
list[].discountsobject[]
list[].discounts[]._idstring
list[].discounts[].namestring
list[].discounts[].valuenumber
list[].discounts[].apply_typestringMumkin qiymatlar: percent, cash
list[].discounts[].currency_idstring
list[].productsobject[]
list[].delivery_addressobject
list[].delivery_address.longnumber
list[].delivery_address.latnumber
list[].delivery_address.human_addressobject
list[].total_salenumber
list[].total_amountnumber
list[].trade_statusstringMumkin qiymatlar: zero, partial, fully
list[].tradesobject[]
list[].trades[]._idstring
list[].trades[].typestringMumkin qiymatlar: b2b, b2c
list[].trades[].organization_idstring
list[].trades[].statestringMumkin qiymatlar: new, in_progress, draft, canceled, done
list[].trades[].state_idstring
list[].trades[].numberstring
list[].trades[].uuidnumber
list[].trades[].currencyobject
list[].trades[].cashbox_idstring
list[].trades[].calc_tax_after_discountboolean
list[].trades[].sale_settingsobject
list[].trades[].total_extra_costnumber
list[].trades[].total_effected_extra_costnumber
list[].custom_fieldsobject[]
list[].custom_fields[]._idstring
list[].custom_fields[].valuestring
totalnumber
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "list": [
      {
        "_id": "string",
        "created_at": "string",
        "updated_at": "string",
        "name": "string",
        "uuid": "external-order-123",
        "visit_id": "67b486d242ed76693cd2cc59",
        "code": "67b486d242ed76693cd2cc59",
        "organization_id": "67b486d242ed76693cd2cc59",
        "organization": {
          "_id": null,
          "name": null
        },
        "customer_id": "67b486d242ed76693cd2cc59",
        "customer": {
          "_id": null,
          "type": null,
          "phone_number": null,
          "phone_numbers": null,
          "name": null,
          "image": null,
          "custom_fields": null
        },
        "customer_assistant": {
          "_id": null,
          "name": null,
          "type": null
        },
        "customer_assistant_hierarchy": [],
        "responsible_id": "string",
        "customer_image_url": "string",
        "responsible": {
          "_id": null,
          "full_name": null
        },
        "price_id": "string",
        "price": {
          "_id": null,
          "name": null,
          "short_name": null,
          "code": null
        },
        "state_id": "string",
        "state": "new",
        "note": "string",
        "date": "string",
        "delivery_date": "string",
        "number": "string",
        "device": {
          "_id": null,
          "name": null,
          "device_id": null
        },
        "currency": {
          "_id": null,
          "to_currency_id": null,
          "uuid": null,
          "name": null,
          "value": null,
          "symbol": null,
          "side": null,
          "numerator": null,
          "denominator": null,
          "round_type": null,
          "precision": null
        },
        "currency_id": "string",
        "total_to_pay": 0,
        "total_price": 0,
        "discount": 0,
        "total_discount": 0,
        "discounts": [],
        "products": [],
        "delivery_address": {
          "long": null,
          "lat": null,
          "human_address": null
        },
        "total_sale": 0,
        "total_amount": 0,
        "trade_status": "zero",
        "trades": [],
        "custom_fields": []
      }
    ],
    "total": 0
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /sale-order/get-by-id/for-bot/{id} ​

Get a sale order by _id, formatted for bot/external consumption.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /sale-order/create.


Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API