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
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
organization_ids | string[] | Ha | |
auto_attach | boolean | Ha | |
is_manual | boolean | Ha | |
state | string | Ha | Mumkin qiymatlar: not_started, active, expired |
live_type | string | Ha | Mumkin qiymatlar: forever, duration |
assign_type | string | Ha | Mumkin qiymatlar: all, specific |
apply_type | string | Ha | Mumkin qiymatlar: percent, cash |
value | number | Ha | |
currency_id | string | Ha | |
starting_date | string | Ha | |
ending_date | string | Ha | |
is_all_categories | boolean | Ha | |
category_ids | string[] | Yo‘q | |
nested_category_ids | string[] | Ha | |
item_added_ids | string[] | Ha | Product ids |
{
"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
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | id of discount |
name | string | |
organization_ids | string[] | |
auto_attach | boolean | |
is_manual | boolean | |
state | string | Mumkin qiymatlar: not_started, active, expired |
live_type | string | Mumkin qiymatlar: forever, duration |
assign_type | string | Mumkin qiymatlar: all, specific |
apply_type | string | Mumkin qiymatlar: percent, cash |
value | number | |
currency_id | string | |
starting_date | string | |
ending_date | string | |
is_all_categories | boolean | |
category_ids | string[] | |
nested_category_ids | string[] | |
item_added_ids | string[] |
{
"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
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
organization_ids | string[] | Ha | |
auto_attach | boolean | Ha | |
is_manual | boolean | Ha | |
state | string | Ha | Mumkin qiymatlar: not_started, active, expired |
live_type | string | Ha | Mumkin qiymatlar: forever, duration |
assign_type | string | Ha | Mumkin qiymatlar: all, specific |
apply_type | string | Ha | Mumkin qiymatlar: percent, cash |
value | number | Ha | |
currency_id | string | Ha | |
starting_date | string | Ha | |
ending_date | string | Ha | |
is_all_categories | boolean | Ha | |
category_ids | string[] | Yo‘q | |
nested_category_ids | string[] | Ha | |
item_added_ids | string[] | Ha | Product ids |
_id | string | Ha | id of customer |
{
"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
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"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
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
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
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
apply_type | string | Yo‘q | |
states | string | Yo‘q | |
search | string | Yo‘q | |
currency_id | string | Yo‘q | |
is_expired | boolean | Yo‘q | |
organization_ids | string[] | Yo‘q |
{
"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.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | id of discount |
name | string | |
organization_ids | string[] | |
auto_attach | boolean | |
is_manual | boolean | |
state | string | Mumkin qiymatlar: not_started, active, expired |
live_type | string | Mumkin qiymatlar: forever, duration |
assign_type | string | Mumkin qiymatlar: all, specific |
apply_type | string | Mumkin qiymatlar: percent, cash |
value | number | |
currency_id | string | |
starting_date | string | |
ending_date | string | |
is_all_categories | boolean | |
category_ids | string[] | |
nested_category_ids | string[] | |
item_added_ids | string[] |
{
"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
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
apply_type | string | Yo‘q | Mumkin qiymatlar: percent, cash |
currency_id | string | Yo‘q | |
organization_ids | string[] | Yo‘q | |
is_expired | boolean | Yo‘q | |
states | string[] | Yo‘q |
{
"apply_type": "percent",
"currency_id": "64e5b499189503e999999999",
"organization_ids": [
"64e5b499189503e999999999"
],
"is_expired": false,
"states": [
"active"
]
}Javob
{
"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
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
deleted_at | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.