From bf23f55b1cd03642955df019ec2663956751de8c Mon Sep 17 00:00:00 2001 From: 0x543 Date: Wed, 13 Nov 2024 01:21:37 +0300 Subject: [PATCH] V5 FbsService (#90) * V5 FbsService * cs --- bin/is_realized.php | 5 ++++ src/Service/V5/Posting/FbsService.php | 37 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/Service/V5/Posting/FbsService.php diff --git a/bin/is_realized.php b/bin/is_realized.php index 38d98c9..812a7c4 100644 --- a/bin/is_realized.php +++ b/bin/is_realized.php @@ -23,6 +23,7 @@ use Gam6itko\OzonSeller\Service\V2\ProductService as V2ProductService; use Gam6itko\OzonSeller\Service\V2\ReturnsService as V2ReturnsService; use Gam6itko\OzonSeller\Service\V4\ProductService as V4ProductService; +use Gam6itko\OzonSeller\Service\V5\Posting\FbsService as V5FbsService; use GuzzleHttp\Client; const MAPPING = [ @@ -55,6 +56,10 @@ // V4 '/v4/product/info/prices' => [V4ProductService::class, 'infoPrices'], + + //V5 + '/v5/fbs/posting/product/exemplar/create-or-get' => [V5FbsService::class, 'productExemplarCreateOrGet'], + '/v5/fbs/posting/product/exemplar/set' => [V5FbsService::class, 'productExemplarSet'], ]; $client = new Client(); diff --git a/src/Service/V5/Posting/FbsService.php b/src/Service/V5/Posting/FbsService.php new file mode 100644 index 0000000..ac04246 --- /dev/null +++ b/src/Service/V5/Posting/FbsService.php @@ -0,0 +1,37 @@ + $postingNumber, + ]; + return $this->request('POST', "{$this->path}/product/exemplar/create-or-get", $body); + } + + /** + * @see https://docs.ozon.ru/api/seller/#operation/PostingAPI_FbsPostingProductExemplarSet + */ + public function productExemplarSet(int $multiBoxQty, string $postingNumber, array $products): bool + { + $body = [ + 'multi_box_qty' => $multiBoxQty, + 'posting_number' => $postingNumber, + 'products' => $products, + ]; + return $this->request('POST', "{$this->path}/product/exemplar/set", $body); + } +}