diff --git a/bin/is_realized.php b/bin/is_realized.php index 812a7c4..141e6cd 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\V1\Posting\FbsService as V1FbsService; use Gam6itko\OzonSeller\Service\V5\Posting\FbsService as V5FbsService; use GuzzleHttp\Client; @@ -39,6 +40,7 @@ '/v1/products/prices' => null, '/v1/products/stocks' => null, '/v1/products/update' => null, + '/v1/posting/fbs/package-label/get' => [V1FbsService::class, 'packageLabelGet'], // V2 '/v2/fbs/posting/delivered' => [FbsService::class.'delivered'], @@ -51,6 +53,7 @@ '/v2/products/info/attributes' => [V2ProductService::class, 'infoAttributes'], '/v2/returns/company/fbo' => [V2ReturnsService::class, 'company'], '/v2/returns/company/fbs' => [V2ReturnsService::class, 'company'], + '/v2/posting/fbs/package-label/create' => [FbsService::class, 'packageLabelCreate'], // V3 - TODO diff --git a/src/Service/V1/Posting/FbsService.php b/src/Service/V1/Posting/FbsService.php new file mode 100644 index 0000000..3854134 --- /dev/null +++ b/src/Service/V1/Posting/FbsService.php @@ -0,0 +1,24 @@ + $taskId, + ]; + return $this->request('POST', "{$this->path}/package-label/get", $body); + } +} diff --git a/src/Service/V2/Posting/FbsService.php b/src/Service/V2/Posting/FbsService.php index 3788824..8ca6f84 100644 --- a/src/Service/V2/Posting/FbsService.php +++ b/src/Service/V2/Posting/FbsService.php @@ -136,6 +136,20 @@ public function packageLabel($postingNumber): string return $this->request('POST', "{$this->path}/package-label", ['posting_number' => $postingNumber], false); } + /** + * @see https://docs.ozon.ru/api/seller/#operation/PostingAPI_CreateLabelBatchV2 + * + * @param array|string $postingNumber + */ + public function packageLabelCreate($postingNumber): array + { + if (is_string($postingNumber)) { + $postingNumber = [$postingNumber]; + } + + return $this->request('POST', "{$this->path}/package-label/create", ['posting_number' => $postingNumber]); + } + /** * @see https://cb-api.ozonru.me/apiref/en/#t-fbs_arbitration_title *