Привет, у меня такая задача, нужен скрипт на NodeJS который будет смотреть JSON ответ от МегаМаркета, и анализировать есть ли заказы на аккаунте, или нет, в случае если есть, то посчитать сколько активных и отмененных заказов есть на аккаунте. Ниже привел JSON-ответ от сервера.

{"pagination":{"currentPage":1,"lastPage":1,"perPage":20,"recordCount":2},"orders":[{"id":"9863865374922","guid":"20684726702","date":"2024-04-14T07:27:33Z","paymentType":"CARD_ONLINE","paymentTypeName":"Оплата банковской картой на сайте","comment":"","isChanged":false,"price":2017,"deliveries":[{"id":"9863874498294","address":"Волгоград, им. Землячки, 56, кв. 16","addressLocationId":"","deliveryType":"COURIER","deliveryTypeName":"Доставка курьером","dateFrom":"2024-04-16T07:00:00Z","dateTo":"2024-04-16T15:00:00Z","dateTimeFrom":{"year":2024,"month":4,"day":16,"hours":10,"minutes":0,"seconds":0,"nanos":0},"dateTimeTo":{"year":2024,"month":4,"day":16,"hours":18,"minutes":0,"seconds":0,"nanos":0},"price":0,"clientStatusName":"Продавец собирает товары","totalprice":2017,"canceledTotalPrice":0,"isChanged":false,"summary":"Доставка курьером, 16.04.2024, послезавтра, с 10:00 до 18:00","isDeliveryUpdateAllowed":true,"recipient":{"phone":"79047765190","firstName":"Элаев","lastName":"Магомед"},"goods":[{"id":"100061731981","price":9,"name":"Влажный корм для кошек KiteKat Нежный кролик в желе 85 г","quantity":15,"canceledQuantity":0,"offerId":"14958068054","merchantName":"Мегамаркет Воронеж","merchantId":"41741","image":"https://main-cdn.sbermegamarket.ru/mid9/hlr-system/179/344/541/311/180/37/100061731981b0.jpg","currentFavoriteOffer":null,"isReturnAllowed":false,"shipmentOrderId":"","brand":"","url":"/catalog/details/vlazhnyy-korm-dlya-koshek-kitekat-nezhnyy-krolik-v-zhele-85-g-100061731981/","initialPrice":9,"initialQuantity":15,"isNew":false,"isCorrected":false,"privileges":{"used":[],"obtained":[{"amount":1,"type":"bonusRoubles","id":""}]},"trackNumbers":[],"isDummy":false,"contentFlags":[],"contentFlagsStr":[],"selectors":[],"shipmentOrderItems":[{"id":"918253973"},{"id":"918253974"},{"id":"918253975"},{"id":"918253976"},{"id":"918253977"},{"id":"918253978"},{"id":"918253979"},{"id":"918253980"},{"id":"918253981"},{"id":"918253982"},{"id":"918253983"},{"id":"918253984"},{"id":"918253985"},{"id":"918253986"},{"id":"918253987"}],"isCanceled":false},{"id":"100061731981","price":10,"name":"Влажный корм для кошек KiteKat Нежный кролик в желе 85 г","quantity":3,"canceledQuantity":0,"offerId":"14958068054","merchantName":"Мегамаркет Воронеж","merchantId":"41741","image":"https://main-cdn.sbermegamarket.ru/mid9/hlr-system/179/344/541/311/180/37/100061731981b0.jpg","currentFavoriteOffer":null,"isReturnAllowed":false,"shipmentOrderId":"","brand":"","url":"/catalog/details/vlazhnyy-korm-dlya-koshek-kitekat-nezhnyy-krolik-v-zhele-85-g-100061731981/","initialPrice":10,"initialQuantity":3,"isNew":false,"isCorrected":false,"privileges":{"used":[],"obtained":[{"amount":1,"type":"bonusRoubles","id":""}]},"trackNumbers":[],"isDummy":false,"contentFlags":[],"contentFlagsStr":[],"selectors":[],"shipmentOrderItems":[{"id":"918253988"},{"id":"918253989"},{"id":"918253990"}],"isCanceled":false},{"id":"100001277939","price":10,"name":"Влажный корм для кошек Kitekat, с курицей в желе, 85г","quantity":14,"canceledQuantity":0,"offerId":"14528299524","merchantName":"Мегамаркет Воронеж","merchantId":"41741","image":"https://main-cdn.sbermegamarket.ru/mid9/hlr-system/-20/198/768/691/024/218/100001277939b0.jpg","currentFavoriteOffer":null,"isReturnAllowed":false,"shipmentOrderId":"","brand":"","url":"/catalog/details/korm-dlya-koshek-kitekat-kurica-0085kg-100001277939/","initialPrice":10,"initialQuantity":14,"isNew":false,"isCorrected":false,"privileges":{"used":[],"obtained":[{"amount":1,"type":"bonusRoubles","id":""}]},"trackNumbers":[],"isDummy":false,"contentFlags":[],"contentFlagsStr":[],"selectors":[{"name":"Количество","values":["1"]},{"name":"Вкус","values":["курица"]}],"shipmentOrderItems":[{"id":"918253991"},{"id":"918253992"},{"id":"918253993"},{"id":"918253994"},{"id":"918253995"},{"id":"918253996"},{"id":"918253997"},{"id":"918253998"},{"id":"918253999"},{"id":"918254000"},{"id":"918254001"},{"id":"918254002"},{"id":"918254003"},{"id":"918254004"}],"isCanceled":false},{"id":"100001284143","price":1712,"name":"Сухой корм Kitekat для взрослых кошек Мясной Пир, 15кг","quantity":1,"canceledQuantity":0,"offerId":"14907719691","merchantName":"Мегамаркет Воронеж","merchantId":"41741","image":"https://main-cdn.sbermegamarket.ru/mid9/hlr-system/-12/256/247/844/312/33/100001284143b0.jpg","currentFavoriteOffer":null,"isReturnAllowed":false,"shipmentOrderId":"","brand":"","url":"/catalog/details/korm-dlya-koshek-kitekat-s-myasom-15-kg-100001284143/","initialPrice":1712,"initialQuantity":1,"isNew":false,"isCorrected":false,"privileges":{"used":[],"obtained":[{"amount":532,"type":"bonusRoubles","id":""}]},"trackNumbers":[],"isDummy":false,"contentFlags":[],"contentFlagsStr":[],"selectors":[{"name":"Вес","values":["15"]},{"name":"Вкус","values":["мясо"]}],"shipmentOrderItems":[{"id":"918254005"}],"isCanceled":false}],"clientStatusCode":"IN_PROGRESS","operator":null,"merchantOrderId":"9863883621666","initialPrice":0,"totalInitialPrice":2017,"statusItems":[{"statusCode":"CREATED","name":"Заказ создан","description":"","isActive":true,"sorting":0},{"statusCode":"SENT_TO_MERCHANT","name":"На подтверждении","description":"Мы отправили продавцу заявку с товарами и ждем подтверждения","isActive":true,"sorting":1},{"statusCode":"CONFIRMED_BY_MERCHANT","name":"Продавец собирает товары","description":"Продавец получил заявку с товарами и готовит их к отгрузке","isActive":true,"sorting":2},{"statusCode":"RECIEVED_BY_COURIER","name":"Товары отправлены","description":"","isActive":false,"sorting":3},{"statusCode":"BY_COURIER","name":"У курьера","description":"","isActive":false,"sorting":4},{"statusCode":"RECIEVED","name":"Получена","description":"","isActive":false,"sorting":5}],"statusCode":"CONFIRMED_BY_MERCHANT","refundAmount":0,"refundBonuses":0,"isRefundSpasibo":false,"isClaimAvailable":false,"endOfStorageDate":null,"options":[],"estimatedDeliveryTimeTo":null,"confirmationCode":"4922","isRegisteredBy3pl":false,"deliveryRequestInterval":null,"isClientIdentificationRequired":false,"isAvailableRequestDelivery":null,"statusTimerRemainingSeconds":null,"updatePossibilitiesFlags":["DATE_UPDATE_ALLOWED_UPDATE_FLAG","RECIPIENT_UPDATE_ALLOWED_UPDATE_FLAG"],"updateStateFlags":[],"fittingDeadlineTimerTotalMinutes":"120","isDelayed":false,"dateTextDetail":"Курьером 16 апреля с 10:00 до 18:00","dateTextList":"Курьером 16 апреля с 10:00 до 18:00","deliveryDetailsText":null,"widgetDescriptionText":null,"courierCallButton":false,"delayedMessage":null,"delayedWidgetMessage":null}],"statusCode":"IN_PROGRESS","statusName":"Подтвержден продавцом","operator":null,"statusColor":"YELLOW","receipts":[],"cancelAvailable":true,"statusCodeId":"FFCM00F","initialPrice":2017,"privileges":{"used":[{"amount":2000,"type":"promoCode","id":"pf2fb281111"}],"obtained":[{"amount":564,"type":"bonusRoubles","id":""}]},"paymentMethod":"SBERPAY","paymentMethodName":"SberPay","status":"IN_PROGRESS","isClaimAvailable":false,"totalSums":{"goodsTotalPrice":2017,"bonusRoublesTotalUsed":0,"bonusRoublesTotalObtained":564,"spasiboTotalUsed":0,"merchantDiscountsTotalUsed":0,"deliveryTotalPrice":0,"promoCodesTotalUsed":2000,"totalEconomy":2000},"createdAt":{"year":2024,"month":4,"day":14,"hours":10,"minutes":27,"seconds":33,"nanos":0},"isPaidOnline":null,"isOnlinePaymentAllowed":false,"paymentTimeMinutes":30,"additionalData":{},"isHidden":false,"links":[],"paymentTypeOptions":[],"bonusDebitDate":{"year":2024,"month":4,"day":30,"hours":18,"minutes":0,"seconds":0,"nanos":0}},{"id":"9821332214658","guid":"20684723578","date":"2024-04-14T07:23:23Z","paymentType":"CARD_ONLINE","paymentTypeName":"Оплата банковской картой на сайте","comment":"","isChanged":true,"price":3011,"deliveries":[{"id":"9821341338030","address":"Москва, улица Павла Корчагина, 11, кв. 16","addressLocationId":"","deliveryType":"COURIER","deliveryTypeName":"Доставка курьером по клику","dateFrom":"2024-04-15T05:00:00Z","dateTo":"2024-04-15T20:00:00Z","dateTimeFrom":{"year":2024,"month":4,"day":15,"hours":8,"minutes":0,"seconds":0,"nanos":0},"dateTimeTo":{"year":2024,"month":4,"day":15,"hours":23,"minutes":0,"seconds":0,"nanos":0},"price":0,"clientStatusName":"Отменена","totalprice":3011,"canceledTotalPrice":3011,"isChanged":true,"summary":"Доставка курьером, 15.04.2024, завтра, с 08:00 до 23:00","isDeliveryUpdateAllowed":false,"recipient":{"phone":"79047765190","firstName":"Элаев","lastName":"Магомед"},"goods":[{"id":"100032041013","price":3011,"name":"Крем-гель La Roche Posay Effaclar H Iso-Biome очищающий для пересушенной кожи, 390 мл","quantity":1,"canceledQuantity":1,"offerId":"14838159808","merchantName":"Мегамаркет Москва","merchantId":"40440","image":"https://main-cdn.sbermegamarket.ru/mid9/hlr-system/213/974/638/552/614/12/100032041013b0.png","currentFavoriteOffer":null,"isReturnAllowed":false,"shipmentOrderId":"","brand":"","url":"/catalog/details/krem-gel-la-roche-posay-effaclar-h-iso-biome-ochishayushiy-dlya-peresushennoy-kozhi-400-ml-100032041013/","initialPrice":3011,"initialQuantity":1,"isNew":false,"isCorrected":false,"privileges":{"used":[],"obtained":[{"amount":784,"type":"bonusRoubles","id":""}]},"trackNumbers":[],"isDummy":false,"contentFlags":[],"contentFlagsStr":[],"selectors":[],"shipmentOrderItems":[{"id":"918247530"}],"isCanceled":true}],"clientStatusCode":"CANCELED","operator":null,"merchantOrderId":"","initialPrice":0,"totalInitialPrice":3011,"statusItems":[{"statusCode":"CANCELED","name":"Отменена","description":"","isActive":true,"sorting":0}],"statusCode":"CANCELED","refundAmount":3011,"refundBonuses":0,"isRefundSpasibo":false,"isClaimAvailable":false,"endOfStorageDate":{"year":2024,"month":4,"day":19,"hours":0,"minutes":0,"seconds":0,"nanos":0},"options":["ON_DEMAND_CUSTOMER_ORDER_DELIVERY_OPTION"],"estimatedDeliveryTimeTo":null,"confirmationCode":"4658","isRegisteredBy3pl":false,"deliveryRequestInterval":{"dateTimeFrom":{"year":2024,"month":4,"day":14,"hours":8,"minutes":0,"seconds":0,"nanos":0},"dateTimeTo":{"year":2024,"month":4,"day":14,"hours":23,"minutes":0,"seconds":0,"nanos":0}},"isClientIdentificationRequired":false,"isAvailableRequestDelivery":true,"statusTimerRemainingSeconds":null,"updatePossibilitiesFlags":[],"updateStateFlags":[],"fittingDeadlineTimerTotalMinutes":"120","isDelayed":false,"dateTextDetail":"Курьером по клику, 15 апреля в даркстор","dateTextList":"15 апреля по клику","deliveryDetailsText":null,"widgetDescriptionText":null,"courierCallButton":false,"delayedMessage":null,"delayedWidgetMessage":null}],"statusCode":"IN_PROGRESS","statusName":"Отмена","operator":null,"statusColor":"RED","receipts":[],"cancelAvailable":false,"statusCodeId":"FFRJ00F","initialPrice":3011,"privileges":{"used":[],"obtained":[{"amount":784,"type":"bonusRoubles","id":""}]},"paymentMethod":"SBERPAY","paymentMethodName":"SberPay","status":"CANCELED","isClaimAvailable":false,"totalSums":{"goodsTotalPrice":3011,"bonusRoublesTotalUsed":0,"bonusRoublesTotalObtained":0,"spasiboTotalUsed":0,"merchantDiscountsTotalUsed":451,"deliveryTotalPrice":0,"promoCodesTotalUsed":0,"totalEconomy":451},"createdAt":{"year":2024,"month":4,"day":14,"hours":10,"minutes":23,"seconds":23,"nanos":0},"isPaidOnline":null,"isOnlinePaymentAllowed":false,"paymentTimeMinutes":30,"additionalData":{},"isHidden":false,"links":[],"paymentTypeOptions":[],"bonusDebitDate":{"year":2024,"month":4,"day":29,"hours":23,"minutes":0,"seconds":0,"nanos":0}}]}