Skip to content

Commit

Permalink
add /v1/product/rating-by-sku method (#63)
Browse files Browse the repository at this point in the history
* add /v1/product/rating-by-sku method
* add /v1/product/info/description method
  • Loading branch information
Jumas-Cola committed Sep 25, 2022
1 parent c4f2f70 commit 573ea26
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Service/V1/ProductService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 573ea26

Please sign in to comment.