Skip to content

Discount ​

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 /discount/create ​

This method allows adding discount into the account.

So‘rov tanasi

MaydonTurMajburiyTavsif
namestringHa
organization_idsstring[]Ha
auto_attachbooleanHa
is_manualbooleanHa
statestringHaMumkin qiymatlar: not_started, active, expired
live_typestringHaMumkin qiymatlar: forever, duration
assign_typestringHaMumkin qiymatlar: all, specific
apply_typestringHaMumkin qiymatlar: percent, cash
valuenumberHa
currency_idstringHa
starting_datestringHa
ending_datestringHa
is_all_categoriesbooleanHa
category_idsstring[]Yo‘q
nested_category_idsstring[]Ha
item_added_idsstring[]HaProduct ids
json
{
  "name": "string",
  "organization_ids": [
    "string"
  ],
  "auto_attach": false,
  "is_manual": false,
  "state": "not_started",
  "live_type": "forever",
  "assign_type": "all",
  "apply_type": "percent",
  "value": 0,
  "currency_id": "string",
  "starting_date": "string",
  "ending_date": "string",
  "is_all_categories": false,
  "category_ids": [
    "string"
  ],
  "nested_category_ids": [
    "string"
  ],
  "item_added_ids": [
    "string"
  ]
}

Javob

MaydonTurTavsif
_idstringid of discount
namestring
organization_idsstring[]
auto_attachboolean
is_manualboolean
statestringMumkin qiymatlar: not_started, active, expired
live_typestringMumkin qiymatlar: forever, duration
assign_typestringMumkin qiymatlar: all, specific
apply_typestringMumkin qiymatlar: percent, cash
valuenumber
currency_idstring
starting_datestring
ending_datestring
is_all_categoriesboolean
category_idsstring[]
nested_category_idsstring[]
item_added_idsstring[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "organization_ids": [
      "string"
    ],
    "auto_attach": false,
    "is_manual": false,
    "state": "not_started",
    "live_type": "forever",
    "assign_type": "all",
    "apply_type": "percent",
    "value": 0,
    "currency_id": "string",
    "starting_date": "string",
    "ending_date": "string",
    "is_all_categories": false,
    "category_ids": [
      "string"
    ],
    "nested_category_ids": [
      "string"
    ],
    "item_added_ids": [
      "string"
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /discount/update ​

This method allows updating discount in the account.

So‘rov tanasi

MaydonTurMajburiyTavsif
namestringHa
organization_idsstring[]Ha
auto_attachbooleanHa
is_manualbooleanHa
statestringHaMumkin qiymatlar: not_started, active, expired
live_typestringHaMumkin qiymatlar: forever, duration
assign_typestringHaMumkin qiymatlar: all, specific
apply_typestringHaMumkin qiymatlar: percent, cash
valuenumberHa
currency_idstringHa
starting_datestringHa
ending_datestringHa
is_all_categoriesbooleanHa
category_idsstring[]Yo‘q
nested_category_idsstring[]Ha
item_added_idsstring[]HaProduct ids
_idstringHaid of customer
json
{
  "name": "string",
  "organization_ids": [
    "string"
  ],
  "auto_attach": false,
  "is_manual": false,
  "state": "not_started",
  "live_type": "forever",
  "assign_type": "all",
  "apply_type": "percent",
  "value": 0,
  "currency_id": "string",
  "starting_date": "string",
  "ending_date": "string",
  "is_all_categories": false,
  "category_ids": [
    "string"
  ],
  "nested_category_ids": [
    "string"
  ],
  "item_added_ids": [
    "string"
  ],
  "_id": "string"
}

Javob

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

DELETE /discount/delete/{id} ​

Delete a discount

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

Get discount using its _id

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHa

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

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

POST /discount/get-paging ​

Get discounts by paging

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
apply_typestringYo‘q
statesstringYo‘q
searchstringYo‘q
currency_idstringYo‘q
is_expiredbooleanYo‘q
organization_idsstring[]Yo‘q
json
{
  "page": 1,
  "limit": 20,
  "apply_type": "string",
  "states": "string",
  "search": "string",
  "currency_id": "string",
  "is_expired": false,
  "organization_ids": [
    "string"
  ]
}

Javob

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

MaydonTurTavsif
_idstringid of discount
namestring
organization_idsstring[]
auto_attachboolean
is_manualboolean
statestringMumkin qiymatlar: not_started, active, expired
live_typestringMumkin qiymatlar: forever, duration
assign_typestringMumkin qiymatlar: all, specific
apply_typestringMumkin qiymatlar: percent, cash
valuenumber
currency_idstring
starting_datestring
ending_datestring
is_all_categoriesboolean
category_idsstring[]
nested_category_idsstring[]
item_added_idsstring[]
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "string",
        "name": "string",
        "organization_ids": [
          "string"
        ],
        "auto_attach": false,
        "is_manual": false,
        "state": "not_started",
        "live_type": "forever",
        "assign_type": "all",
        "apply_type": "percent",
        "value": 0,
        "currency_id": "string",
        "starting_date": "string",
        "ending_date": "string",
        "is_all_categories": false,
        "category_ids": [
          "string"
        ],
        "nested_category_ids": [
          "string"
        ],
        "item_added_ids": [
          "string"
        ]
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /discount/get-all ​

Get all discounts

So‘rov tanasi

MaydonTurMajburiyTavsif
apply_typestringYo‘qMumkin qiymatlar: percent, cash
currency_idstringYo‘q
organization_idsstring[]Yo‘q
is_expiredbooleanYo‘q
statesstring[]Yo‘q
json
{
  "apply_type": "percent",
  "currency_id": "64e5b499189503e999999999",
  "organization_ids": [
    "64e5b499189503e999999999"
  ],
  "is_expired": false,
  "states": [
    "active"
  ]
}

Javob

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "name": "string",
      "organization_ids": [
        "string"
      ],
      "auto_attach": false,
      "is_manual": false,
      "state": "not_started",
      "live_type": "forever",
      "assign_type": "all",
      "apply_type": "percent",
      "value": 0,
      "currency_id": "string",
      "starting_date": "string",
      "ending_date": "string",
      "is_all_categories": false,
      "category_ids": [
        "string"
      ],
      "nested_category_ids": [
        "string"
      ],
      "item_added_ids": [
        "string"
      ]
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /discount/get-deleted ​

Get deleted discount 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"
}

Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API