Получение чеков

Параметры

Header:

INTENT_OPERATION_TYPE - GET_CHEQUES

Auth-token - Токен авторизации (опционально). Подробнее

Тело запроса: UUIDs

Запрос позволяет получить:

  • весь список чеков если передавать пустое тело или пустой массив uuids.
  • только выбранные uuids если передавать список.

Примеры

Успех

Запрос: Тело пустое

Запрос:

{
  "uuids": [
  ]
}

Ответ ChequesResponse:

{
  "messageDetail": "Чеки успешно получены",
  "messageTitle": "Успех",
  "resultCode": 200,
  "type": "GET_CHEQUES",
  "cheques": [
    {
      "info": {
        "uuid": "9aa03f0c-d77c-40ae-8f4d-236c432054a8",
        "name": "Чек 1",
        "chequeType": "Postponed"
      },
      "currency": "BYN",
      "chequeDiscount": {
        "isPercent": true,
        "value": "5",
        "sum": "3.03"
      },
      "subTotal": "60.5",
      "total": "57.47",
      "items": [
        {
          "price": "5",
          "quantity": "1",
          "sum": "5",
          "total": "5"
        },
        {
          "price": "5",
          "quantity": "3",
          "sum": "15",
          "total": "15"
        },
        {
          "price": "5",
          "quantity": "3",
          "discount": {
            "isPercent": true,
            "value": "10",
            "sum": "1.5"
          },
          "sum": "15",
          "total": "13.5"
        },
        {
          "price": "5",
          "quantity": "3",
          "discount": {
            "isPercent": true,
            "value": "10",
            "sum": "1.5"
          },
          "tax": {
            "rate": "10",
            "value": "1.23"
          },
          "sum": "15",
          "total": "13.5"
        },
        {
          "code": {
            "type": 0,
            "value": 10
          },
          "price": "5",
          "quantity": "3",
          "discount": {
            "isPercent": true,
            "value": "10",
            "sum": "1.5"
          },
          "tax": {
            "rate": "10",
            "value": "1.23"
          },
          "sum": "15",
          "total": "13.5"
        }
      ],
      "payments": [
      ]
    },
    {
      "info": {
        "uuid": "bb074ac8-3661-4c56-818e-26686d5a7ec3",
        "name": "Чек 2",
        "chequeType": "Order",
        "table": 2,
        "place": 3
      },
      "currency": "BYN",
      "chequeDiscount": {
        "isPercent": true,
        "value": "5",
        "sum": "0.25"
      },
      "subTotal": "5",
      "total": "4.75",
      "items": [
        {
          "name": "Чай",
          "price": "5",
          "quantity": "1",
          "sum": "5",
          "total": "5"
        }
      ],
      "payments": [
      ]
    }
  ]
}

Успех

Запрос:

{
  "uuids": [
    "bb074ac8-3661-4c56-818e-26686d5a7ec3"
  ]
}

Ответ ChequesResponse:

{
  "messageDetail": "Чеки успешно получены",
  "messageTitle": "Успех",
  "resultCode": 200,
  "type": "GET_CHEQUES",
  "cheques": [
    {
      "info": {
        "uuid": "bb074ac8-3661-4c56-818e-26686d5a7ec3",
        "name": "Чек 2",
        "chequeType": "Order",
        "table": 2,
        "place": 3
      },
      "currency": "BYN",
      "chequeDiscount": {
        "isPercent": true,
        "value": "5",
        "sum": "0.25"
      },
      "subTotal": "5",
      "total": "4.75",
      "items": [
        {
          "name": "Чай",
          "price": "5",
          "quantity": "1",
          "sum": "5",
          "total": "5"
        }
      ],
      "payments": [
      ]
    }
  ]
}

Ошибка (отсутствует UUID)

Запрос:

{
  "uuids": [
    "12345-6789-4c56-818e-26686d5a7ec3"
  ]
}

Ответ BaseResponse:

{
  "messageDetail": "Один или несколько чеков не найдены",
  "messageTitle": "Ошибка",
  "resultCode": 488,
  "type": "GET_CHEQUES"
}