# Заказы

## Список заказов

<mark style="color:blue;">`GET`</mark> `https://api.waix.ru/order`

{% hint style="info" %}
Для получения в ответе последнее сообщение из заказа, используйте дополнительный идентификатор в query запросе **messages**=*n,* где *n* — количество последних сообщений. Список сообщений возвращается не более 10 с сортировкой от новых к старым.
{% endhint %}

#### Query Parameters

| Name                                           | Type   | Description                                                                                                                             |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| offset                                         | number | Отступ, используйте для постраничного отображения вместе с параметром count.                                                            |
| status                                         | number | Возвращает заказы определенного статуса.                                                                                                |
| messages                                       | number | Кол-во последних сообщений от 0 до 10                                                                                                   |
| count                                          | number | Число выдаваемых записей от 1 до 100. *По-умолчанию 10.*                                                                                |
| key or token<mark style="color:red;">\*</mark> | string | [Ключ-код](/access.md#klyuch-kod) пользователя для запроса клиент-сервер или [токен](/access.md#klyuch-token) для запроса сервер-сервер |
| uid                                            | number | идентификатор пользователя если указан @token                                                                                           |

{% tabs %}
{% tab title="200 JSON ответ со списком заказов" %}
{% code expandable="true" %}

```json
{
	"status":"OK",
	"result":[
      {
         "items":[
            {
               "image":[
                  "http:\/\/d.zaix.ru\/b35dc05a663c.jpg"
               ],
               "id":59237,
               "platform":"taobao.com",
               "link":"https:\/\/item.taobao.com\/item.htm?id=560346115508"
            },
            {
               "image":[
                  "http:\/\/d.zaix.ru\/2c59a3e27978.jpg"
               ],
               "id":58478,
               "platform":"taobao.com",
               "link":"https:\/\/item.taobao.com\/item.htm?id=527710683306"
            }
         ],
         "messages":{
            "total":0,
            "new":0
         },
         "date_status":1601662792,
         "date_create":1575696237,
         "id":24162,
         "price":1466,
         "course":12,
         "status":1,
         "note":"",
         "archive":0,
         "status_text":"Не оплачен",
         "send":true
      },
	  {
         "items":[
            {
               "image":[
                  "http:\/\/d.zaix.ru\/b35dc05a663c.jpg"
               ],
               "id":59237,
               "platform":"taobao.com",
               "link":"https:\/\/item.taobao.com\/item.htm?id=560346115508"
            },
            {
               "image":[
                  "http:\/\/d.zaix.ru\/2c59a3e27978.jpg"
               ],
               "id":58478,
               "platform":"taobao.com",
               "link":"https:\/\/item.taobao.com\/item.htm?id=527710683306"
            }
         ],
         "messages":{
            "total":2,
            "new":1,
		"items":[
   			{
				id: 104,
				uid: 1,
				name: "Евгений",
				text: "Здравствуйте, цвет какой вам нужен позиции 2?",
				date: 1575699821
			}
		]
         },
         "date_status":1601662792,
         "date_create":1575696237,
         "id":24162,
         "price":1466,
         "course":12,
         "status":1,
         "note":"",
         "archive":0,
         "status_text":"На выкупе",
         "send":false
      }
	]
}
```

{% endcode %}
{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```
{ если ключ или токен не верный }
```

{% endtab %}
{% endtabs %}

## Получение содержимого заказа

<mark style="color:blue;">`GET`</mark> `https://api.waix.ru/order/{id}`

Получение указанных данных заказа и его позиций\*

#### Query Parameters

| Name                                           | Type   | Description                                                                                                                                                                                                              |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark>           | number | Номер заказа из [списка заказов](/api/order.md#spisok-zakazov)                                                                                                                                                           |
| key or token<mark style="color:red;">\*</mark> | String | [Ключ-код](/access.md) доступа                                                                                                                                                                                           |
| \*noitems                                      | number | <p><sub><em>не обязательный параметр</em></sub></p><p><br><sup>1 (или любое значение) — не отображать товары, отображать  только данные заказа, ускоряет выдачу результатов поскольку исключает рендер позиций</sup></p> |

{% tabs %}
{% tab title="200: OK " %}
{% code expandable="true" %}

```json
{
   "status":"OK",
   "result":{
      "data":{
         "address":"ул. Морозова 56",
         "phone":"+79551450000",
         "city":"Москва",
         "comission":3,
         "name":"Велов Георгий Антоненко",
         "delivery":"Авто-быстрое"
      },
      "items":[
         {
            "param":[
               {
                  "name":"尺码",
                  "value":"39"
               },
               {
                  "name":"颜色分类",
                  "value":"黑"
               }
            ],
            "image":[
               "//d.zaix.ru/58ff1a8774c5.jpg"
            ],
            "taobao_id":"548598984319",
            "seller_crc":1706326572,
            "date_create":1622724511,
            "id":264749,
            "price":300,
            "price_total":300,
            "number":1,
            "price_reward":1,
            "seller":"哥弟官方旗舰店",
            "title":"哥弟女鞋2021夏季新款高帮弹力袜子鞋女厚底一脚蹬休闲鞋AX12037",
            "link":"https://item.taobao.com/item.htm?id=548598984319",
            "note":"",
            "price_delivery":0,
            "platform":"taobao.com"
         },
         {
            "param":[
               {
                  "name":"鞋码",
                  "value":"45"
               },
               {
                  "name":"颜色分类",
                  "value":"AA2181-002"
               }
            ],
            "image":[
               "7ae65c9dfa480c794fcc945b.png"
            ],
            "taobao_id":"585070835466",
            "seller_crc":4017549552,
            "date_create":1622726092,
            "id":264761,
            "price":239,
            "price_total":239,
            "number":1,
            "price_reward":1,
            "seller":"热点运动专营店",
            "link":"https://detail.tmall.com/item.htm?id=584169405715&spm=a1z09.2.0.0.324b2e8dkaJN4K&_u=4201io13oda493",
            "title":"NIKE耐克男子网面运动休闲跑步鞋AA2181-002-001-007-008-300-010",
            "note":"",
            "price_delivery":0,
            "platform":"tmall.com"
         }
      ]
   }
}
```

{% endcode %}
{% endtab %}

{% tab title="304: ERROR" %}
Данное сообщение отобращается если искомый заказ не был найден:

```json
{
    "status": "ERROR",
    "message": "Order not found",
    "code": 304
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.waix.ru/api/order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
