API documentation for working with stocks
Table with field descriptions:
| Field | Type | Required? | Description |
|---|---|---|---|
| id | int | No | Unique promotion identifier (required when updating). |
| name_ro | string | Yes | The name of the action is in Romanian. |
| name_ru | string | Yes | The name of the action is in Russian. |
| name_en | string | No | The name of the action in English. |
| name_uk | string | No | The name of the action is in Ukrainian. |
| hide | boolean | Yes | Indicates whether the promotion is hidden (true/false). |
| info | string | No | Additional information about the promotion. |
| expire_date | datetime | Yes | The date and time the promotion ends. |
| position | int | No | Position of the stock in the general list. |
| priority | int | No | Priority of the action. |
| slug | string | Yes | Unique identifier of the share (servants). |
| showinpromo_block | boolean | No | Indicates whether the promotion is shown in the promotion block (true/false). |
| showisslider | boolean | No | Indicates whether the stock is shown as a slider (true/false). |
| show_on | string | No | Promotion display settings (for example: "start"). |
1. Receive all shares
Method: GET
URL: {domain}/external/promo/
Description:
Returns a list of all promotions on the site.
Query example:
GET {domain}/external/promo/
Example answer:
[
{
"id": 26,
"name_ro": "Toamna ta - reducerile noastre! Boxenew",
"name_ru": "Autumn good discounts! Boxe5",
"name_en": "Promo name",
"name_uk": "Promo Name",
"hide": false,
"info": null,
"expire_date": "2024-03-04T08:15:00",
"position": 10,
"priority": 0,
"slug": "toamna-ta-reducerile-noastre-boxenew",
"show_in_promo_block": false,
"show_is_slider": false,
"show_on": null
},
{
"id": 25,
"name_ro": "smartpromonew",
"name_ru": "smartpromoru5",
"name_en": "Promo nameEN",
"name_uk": "Promo Name",
"hide": false,
"info": null,
"expire_date": "2025-02-28T17:30:00",
"position": 1,
"priority": 10,
"slug": "smartpromonew",
"show_in_promo_block": false,
"show_is_slider": false,
"show_on": "start"
}
]
2. Receive one share
Method: GET
URL: {domain}/external/promo/{promo_id}/
Description:
Returns data for one stock by its unique identifier.
Query example:
GET {domain}/external/promo/26/
Example answer:
{
"id": 26,
"name_ro": "Toamna ta - reducerile noastre! Boxenew",
"name_ru": "Autumn good discounts! Boxe5",
"name_en": "Promo name",
"name_uk": "Promo Name",
"hide": false,
"info": null,
"expire_date": "2024-03-04T08:15:00",
"position": 10,
"priority": 0,
"slug": "toamna-ta-reducerile-noastre-boxenew",
"show_in_promo_block": false,
"show_is_slider": false,
"show_on": null
}
3. Update one promotion
Method: PUT
URL: {domain}/external/promo/{promo_id}/
Description:
Updates data for one stock by its unique identifier.
Query example:
PUT {domain}/external/promo/26/
Content-Type: application/json
Request body:
{
"name_ro": "Toamna ta - reducerile noastre! UPDATED",
"name_ru": "Autumn good discounts! UPDATED",
"expire_date": "2025-01-01T12:00:00",
"position": 5,
"priority": 1,
"hide": false,
"show_in_promo_block": true,
"show_is_slider": true
}
Example answer:
{
"id": 26,
"name_ro": "Toamna ta - reducerile noastre! UPDATED",
"name_ru": "Autumn good discounts! UPDATED",
"name_en": "Promo name",
"name_uk": "Promo Name",
"hide": false,
"info": null,
"expire_date": "2025-01-01T12:00:00",
"position": 5,
"priority": 1,
"slug": "toamna-ta-reducerile-noastre-boxenew",
"show_in_promo_block": true,
"show_is_slider": true,
"show_on": null
}
4. Creation of multiple shares
Method: POST
URL: {domain}/external/promo/bulk-create/
Description:
Creates several shares at the same time.
Query example:
POST {domain}/external/promo/bulk-create/
Content-Type: application/json
Request body:
[
{
"name_ro": "Toamna nouă! Boxenew",
"name_ru": "New autumn! Boxe5",
"name_en": "Promo name new",
"name_uk": "Promo Name New",
"hide": false,
"info": "New promo info",
"expire_date": "2024-06-01T09:00:00",
"position": 2,
"priority": 5,
"slug": "toamna-noua-boxenew",
"show_in_promo_block": true,
"show_is_slider": false,
"show_on": "start"
},
{
"name_ro": "Promo Boxenew 2",
"name_ru": "Promo Boxe5 2",
"name_en": "Promo name 2",
"name_uk": "Promo Name 2",
"hide": false,
"info": "Promo Description 2",
"expire_date": "2023-12-01T09:00:00",
"position": 1,
"priority": 10,
"slug": "promo-boxenew-2",
"show_in_promo_block": false,
"show_is_slider": true,
"show_on": "end"
}
]
Example answer:
[
{
"id": 27,
"name_ro": "Toamna nouă! Boxenew",
"name_ru": "New autumn! Boxe5",
"name_en": "Promo name new",
"name_uk": "Promo Name New",
"hide": false,
"info": "New promo info",
"expire_date": "2024-06-01T09:00:00",
"position": 2,
"priority": 5,
"slug": "toamna-noua-boxenew",
"show_in_promo_block": true,
"show_is_slider": false,
"show_on": "start"
},
{
"id": 28,
"name_ro": "Promo Boxenew 2",
"name_ru": "Promo Boxe5 2",
"name_en": "Promo name 2",
"name_uk": "Promo Name 2",
"hide": false,
"info": "Promo Description 2",
"expire_date": "2023-12-01T09:00:00",
"position": 1,
"priority": 10,
"slug": "promo-boxenew-2",
"show_in_promo_block": false,
"show_is_slider": true,
"show_on": "end"
}
]
5. Multiple promotions update
Method: POST
URL: {domain}/external/promo/bulk-update/
Description:
Updates data for several stocks at the same time.
Query example:
POST {domain}/external/promo/bulk-update/
Content-Type: application/json
Request body:
[
{
"id": 25,
"name_ro": "Promo Updated",
"name_ru": "Promotion Updated",
"expire_date": "2025-03-01T10:00:00"
},
{
"id": 26,
"name_ro": "Toamna Update",
"priority": 99
}
]
Example answer:
[
{
"id": 25,
"name_ro": "Promo Updated",
"name_ru": "Promotion Updated",
"name_en": "Promo nameEN",
"name_uk": "Promo Name",
"hide": false,
"info": null,
"expire_date": "2025-03-01T10:00:00",
"position": 1,
"priority": 10,
"slug": "smartpromonew",
"show_in_promo_block": false,
"show_is_slider": false,
"show_on": "start"
},
{
"id": 26,
"name_ro": "Toamna Update",
"name_ru": "Autumn good discounts! Boxe5",
"name_en": "Promo name",
"name_uk": "Promo Name",
"hide": false,
"info": null,
"expire_date": "2024-03-04T08:15:00",
"position": 10,
"priority": 99,
"slug": "toamna-ta-reducerile-noastre-boxenew",
"show_in_promo_block": false,
"show_is_slider": false,
"show_on": null
}
]
Was the article helpful?
Yes, thank you! Unfortunately no