Order

orders journal

request
GET /api/v2/orders?size=5&page=0 HTTP/1.1
Table 272. request description
Parameter Description

orderId

order id

type

order type

status

order status

departmentId

department id

familyNameCient

client family name

userId

user id

prescriptionBasis

prescription basis

createdOnFrom

date of creation from

createdOnTo

date of creation to

finishExpectingOnFrom

expected finish date from

finishExpectingOnTo

expected finish date to

pageable

Pageable description

response
HTTP/1.1 200 OK

{
  "content" : [ {
    "id" : 9000111225,
    "clientId" : 1000001527,
    "createdAt" : "2024-02-06T00:00:00",
    "finishedAt" : null,
    "finishExpectingAt" : null,
    "departmentId" : "1000000003",
    "departmentName" : "Первый магазин",
    "client" : {
      "id" : 1000001527,
      "familyName" : "Михайлов",
      "firstName" : "Евгений",
      "patronymicName" : "Александрович"
    },
    "type" : "SALE",
    "status" : "ORDER_READY",
    "sum" : 1.0,
    "paidSum" : 12.0,
    "receiptPrinted" : false,
    "createdById" : 1000000004,
    "redo" : true,
    "readyStatusInStore" : true
  }, {
    "id" : 1000000245,
    "clientId" : 1000001526,
    "createdAt" : "2025-08-27T10:21:00",
    "finishedAt" : "2025-08-27T10:21:56.591689",
    "finishExpectingAt" : null,
    "departmentId" : "1000000003",
    "departmentName" : "Первый магазин",
    "client" : {
      "id" : 1000001526,
      "familyName" : "Пууманн",
      "firstName" : "Анна",
      "patronymicName" : "-"
    },
    "type" : "SALE",
    "status" : "ORDER_COMPLETED",
    "sum" : 500.0,
    "paidSum" : 500.0,
    "receiptPrinted" : false,
    "createdById" : 9000000008,
    "redo" : null,
    "readyStatusInStore" : false
  }, {
    "id" : 1000000244,
    "clientId" : 1000001526,
    "createdAt" : "2025-08-27T10:21:00",
    "finishedAt" : "2025-08-27T10:21:55.419127",
    "finishExpectingAt" : null,
    "departmentId" : "1000000003",
    "departmentName" : "Первый магазин",
    "client" : {
      "id" : 1000001526,
      "familyName" : "Пууманн",
      "firstName" : "Анна",
      "patronymicName" : "-"
    },
    "type" : "SALE",
    "status" : "ORDER_COMPLETED",
    "sum" : 2000.0,
    "paidSum" : 2000.0,
    "receiptPrinted" : false,
    "createdById" : 9000000008,
    "redo" : null,
    "readyStatusInStore" : false
  }, {
    "id" : 1000000243,
    "clientId" : 1000001526,
    "createdAt" : "2025-08-27T10:21:00",
    "finishedAt" : "2025-08-27T10:21:52.761923",
    "finishExpectingAt" : null,
    "departmentId" : "1000000003",
    "departmentName" : "Первый магазин",
    "client" : {
      "id" : 1000001526,
      "familyName" : "Пууманн",
      "firstName" : "Анна",
      "patronymicName" : "-"
    },
    "type" : "SALE",
    "status" : "ORDER_COMPLETED",
    "sum" : 2300.0,
    "paidSum" : 2300.0,
    "receiptPrinted" : false,
    "createdById" : 9000000008,
    "redo" : null,
    "readyStatusInStore" : false
  }, {
    "id" : 1000000242,
    "clientId" : 1000001526,
    "createdAt" : "2025-08-27T10:21:00",
    "finishedAt" : "2025-08-27T10:21:49.630233",
    "finishExpectingAt" : null,
    "departmentId" : "1000000003",
    "departmentName" : "Первый магазин",
    "client" : {
      "id" : 1000001526,
      "familyName" : "Пууманн",
      "firstName" : "Анна",
      "patronymicName" : "-"
    },
    "type" : "SALE",
    "status" : "ORDER_COMPLETED",
    "sum" : 4000.0,
    "paidSum" : 4000.0,
    "receiptPrinted" : false,
    "createdById" : 9000000008,
    "redo" : null,
    "readyStatusInStore" : false
  } ],
  "totalPages" : 49,
  "totalElements" : 244,
  "size" : 5,
  "page" : 0,
  "number" : 0,
  "pageable" : {
    "pageSize" : 5,
    "pageNumber" : 0
  },
  "totalResult" : {
    "sum" : 443555.0,
    "pageSum" : 8801.0,
    "paidSum" : 418647.1,
    "pagePaidSum" : 8812.0,
    "purchaseSum" : null,
    "pagePurchaseSum" : null,
    "retailSum" : null,
    "pageRetailSum" : null,
    "count" : 244
  }
}
Table 273. response description
Path Type Description

content[].

Array

an array of filtered orders

[].id

Number

order id

[].clientId

Number

client id

[].createdAt

String

order created datetime

[].finishedAt

String

order finished datetime

[].finishExpectingAt

String

order expecting finished datetime

[].type

String

order type

[].statuses

Array

order statuses

[].wasFinalReceiptPrinted

Boolean

final receipt printed or not

[].client

Object

client

[].client.firstName

String

first name

[].client.secondName

String

second name

[].client.patronymicName

String

patronymic name

[].departmentId

Number

department id

[].departmentName

String

department name

[].userId

Number

id of user

[].sum

Number

sum of order

[].paidSum

Number

paid sum

[].wasFinalReceiptPrinted

Boolean

check if final receipt was printed

[].redo

Boolean

if redo or not

list basic types

request
GET /api/v2/orders/types HTTP/1.1
response
HTTP/1.1 200 OK

[ {
  "id" : "GLASSES",
  "localName" : "Изготовление очков"
}, {
  "id" : "SALE",
  "localName" : "Заказ \"Продажа\""
}, {
  "id" : "REPAIR",
  "localName" : "Заказ \"Ремонт\""
}, {
  "id" : "CONTACT_LENS",
  "localName" : "Продажа контактных линз"
}, {
  "id" : "CHECK_VISION",
  "localName" : "Проверка зрения"
} ]
Table 274. response description
Path Type Description

[]

Array

List of basic order types

[].id

String

Id of the account type

[].localName

String

Localized name of the account type

statuses

Всевозможные значения статуса заказа
request
GET /api/v2/orders/statuses HTTP/1.1
response
HTTP/1.1 200 OK

[ "WAIT", "ACCEPTED", "IN_WORK", "ORDER_READY", "ORDER_COMPLETED", "RETURN", "CANCEL" ]
Table 275. response description
Path Type Description

[]

Array

array of available order statuses

orders commented or active statuses

журнал статусов незавершенных заказов, а также по которым  есть комментарии
request
GET /api/v2/orders/commented-or-active/statuses?createdOnFrom=2020-12-08&createdOnTo=2022-09-05&departmentId=1000000003 HTTP/1.1
Table 276. request description
Parameter Description

createdOnFrom

order created date from

createdOnTo

order created date to

departmentId

department id

pageable

Pageable description

response
HTTP/1.1 200 OK

{
  "content" : [ {
    "orderId" : 1000000131,
    "status" : "ORDER_COMPLETED"
  }, {
    "orderId" : 1000000129,
    "status" : "ORDER_COMPLETED"
  }, {
    "orderId" : 1000000127,
    "status" : "ACCEPTED"
  }, {
    "orderId" : 1000000126,
    "status" : "ACCEPTED"
  }, {
    "orderId" : 1000000125,
    "status" : "ORDER_COMPLETED"
  } ],
  "pageable" : {
    "pageNumber" : 0,
    "pageSize" : 100,
    "sort" : {
      "empty" : false,
      "sorted" : true,
      "unsorted" : false
    },
    "offset" : 0,
    "paged" : true,
    "unpaged" : false
  },
  "last" : true,
  "totalElements" : 5,
  "totalPages" : 1,
  "first" : true,
  "size" : 100,
  "number" : 0,
  "sort" : {
    "empty" : false,
    "sorted" : true,
    "unsorted" : false
  },
  "numberOfElements" : 5,
  "empty" : false
}
Table 277. response description
Path Type Description

content[].

Array

orders commented or active statuses

[].orderId

Number

Идентификатор заказа

[].status

Number

Статус заказа

get

request
GET /api/v2/orders/1000000012 HTTP/1.1
Table 278. /api/v2/orders/{orderId}
Parameter Description

orderId

order id

response
HTTP/1.1 200 OK

{
  "id" : 1000000012,
  "createdAt" : "2019-01-31T17:13:00.000Z",
  "clientId" : 1000000002,
  "type" : "SALE",
  "departmentName" : "Первый магазин",
  "productionDepartmentName" : "Первый магазин",
  "status" : "ORDER_COMPLETED",
  "sum" : 3500.0,
  "paidSum" : 3500.0,
  "comment" : null
}
Table 279. response description
Path Type Description

id

Number

id

createdAt

String

createdAt

type

String

type

departmentName

String

departmentName

productionDepartmentName

String

productionDepartmentName

status

String

status

sum

Number

Discount order sum

paidSum

Number

Сумма, оплаченная за заказ

last purchased contact lenses

request
GET /api/v2/orders/last-purchased/contact-lenses?clientId=1110012983 HTTP/1.1
request description

Unresolved directive in index.adoc - include::/builds/itigris/optima-core/optima/optima-2-backend/target/generated-snippets/order-last-purchased-contact-lenses/request-parameters.adoc[] .response

HTTP/1.1 200 OK

{
  "manufacturerName" : "Johnson&Johnson",
  "brandName" : "1-DAY Acuvue Define Diag",
  "color" : "Shimmer",
  "packageQuantity" : 5,
  "wearingPeriod" : "1 день",
  "retailPrice" : 1.0,
  "dioptre" : 0.0,
  "cylinder" : null,
  "axis" : null,
  "add" : null,
  "curvatureRadius" : 8.5,
  "diameter" : 14.2,
  "purchasedAt" : "2023-04-23T15:25:00",
  "orderId" : 1110000056,
  "requestType" : "FROM_SUPPLIER",
  "departmentId" : null,
  "eyeType" : "LEFT_EYE",
  "expected" : true
}
Table 280. response description
Path Type Description

isExpected

Boolean

Является ли контактная линза заявкой

manufacturerName

String

Производитель

brandName

String

Бренд

color

String

Цвет

packageQuantity

Number

Количество в упаковке

wearingPeriod

String

Период ношения

retailPrice

Number

Цена

radius

Number

Радиус

purchasedAt

String

Дата покупки

requestType

String

Тип заявки (в случае если последние купленные контактные линзы были оформлены через заявку)

departmentId

String

Департамент из которого были куплены контактные линзы (в случае если последние купленные контактные линзы были оформлены через заявку)

list basic types

request
GET /api/v2/orders/types HTTP/1.1
response
HTTP/1.1 200 OK

[ {
  "id" : "GLASSES",
  "localName" : "Изготовление очков"
}, {
  "id" : "SALE",
  "localName" : "Заказ \"Продажа\""
}, {
  "id" : "REPAIR",
  "localName" : "Заказ \"Ремонт\""
}, {
  "id" : "CONTACT_LENS",
  "localName" : "Продажа контактных линз"
}, {
  "id" : "CHECK_VISION",
  "localName" : "Проверка зрения"
} ]
Table 281. response description
Path Type Description

[]

Array

List of basic order types

[].id

String

Id of the account type

[].localName

String

Localized name of the account type

get order reasons

Сортировка по дефолту: name,asc
request
GET /api/v2/orders/reasons?orderType=SALE HTTP/1.1
Table 282. request params
Parameter Description

orderType

[SALE, REPAIR, GLASSES, CONTACT_LENS, CHECK_VISION, REPAIR_GLASSES_ORDER]

sort

Sort description

HTTP/1.1 200 OK

[ {
  "names" : [ "Test for getting order reason" ],
  "required" : true,
  "active" : true
}, {
  "names" : [ ],
  "required" : true,
  "active" : false
} ]
Table 283. response description
Path Type Description

names

Array

Варианты информационного поля

required

Array

Является ли настройка обязательной

active

Array

Активно ли поле (если нет, его не нужно отрисовывать)