From 573ea26efac964e75ede4f598c7f1eb914d54077 Mon Sep 17 00:00:00 2001 From: Jumas Date: Sun, 25 Sep 2022 16:51:26 +0300 Subject: [PATCH] add /v1/product/rating-by-sku method (#63) * add /v1/product/rating-by-sku method * add /v1/product/info/description method --- src/Service/V1/ProductService.php | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Service/V1/ProductService.php b/src/Service/V1/ProductService.php index 3d959c0..b743bbf 100755 --- a/src/Service/V1/ProductService.php +++ b/src/Service/V1/ProductService.php @@ -572,4 +572,38 @@ public function picturesInfo($productId): array 'product_id' => TypeCaster::cast($productId, 'arrOfStr'), ]); } + + /** + * Receive product content rating by sku. + * + * @see https://seller-edu.ozon.ru/docs/work-with-goods/content-rating.html + * + * @param array $query + * + * @return array + */ + public function ratingBySku(array $query): array + { + $query = ArrayHelper::pick($query, ['skus']); + $query = TypeCaster::castArr($query, [ + 'skus' => 'arrOfInt', + ]); + + return $this->request('POST', "/v1/product/rating-by-sku", $query); + } + + /** + * Receive product description. + * + * @see https://docs.ozon.ru/api/seller/#operation/ProductAPI_GetProductInfoDescription + * + * @param array $query ['product_id', 'offer_id'] + */ + public function infoDescription(array $query): array + { + $query = ArrayHelper::pick($query, ['product_id', 'offer_id']); + $query = TypeCaster::castArr($query, ['product_id' => 'int', 'offer_id' => 'str']); + + return $this->request('POST', "/v1/product/info/description", $query); + } }