diff --git a/src/Client.php b/src/Client.php index aeedfca..1534bf3 100644 --- a/src/Client.php +++ b/src/Client.php @@ -65,6 +65,30 @@ public function getCommission(string $ean, float $unitPrice, ?Enum\GetCommission return $this->request('GET', $url, $options, $responseTypes); } + /** + * Gets a list of all commissions using EAN. + * @param Model\Ean[] $products + * @return Model\BulkCommissionRatesMultiStatusResponse + * @throws Exception\ConnectException when an error occurred in the HTTP connection. + * @throws Exception\ResponseException when an unexpected response was received. + * @throws Exception\UnauthorizedException when the request was unauthorized. + * @throws Exception\RateLimitException when the throttling limit has been reached for the API user. + * @throws Exception\Exception when something unexpected went wrong. + */ + public function getCommissionRates(array $products): Model\BulkCommissionRatesMultiStatusResponse + { + $url = "retailer/commissions"; + $options = [ + 'body' => Model\CommissionProducts::constructFromArray(['products' => $products]), + 'produces' => 'application/vnd.retailer.v10+json', + 'consumes' => 'application/vnd.retailer.v10+json', + ]; + $responseTypes = [ + ]; + + return $this->request('POST', $url, $options, $responseTypes); + } + /** * Gets the details of a catalog product by means of its EAN. * @param string $ean The EAN number associated with this product. @@ -229,6 +253,41 @@ public function getPerformanceIndicators(Enum\GetPerformanceIndicatorsName $name return $this->request('GET', $url, $options, $responseTypes)->performanceIndicators; } + /** + * Gets a list of product ranks. + * @param string $ean The EAN number associated with this product. + * @param string $date Filters search results to a specific date. The date must be in the past, no more than three + * months back, and up to yesterday. + * @param Enum\GetProductRanksType|null $type Determines the search type, either 'SEARCH' for specific queries or + * 'BROWSE' for broader category searches. In order to retrieve all results, it can be sent as "null". + * @param int|null $page The requested page number with a page size of 50 items. + * @param string|null $AcceptLanguage The language to search for. + * @return Model\ProductRanks + * @throws Exception\ConnectException when an error occurred in the HTTP connection. + * @throws Exception\ResponseException when an unexpected response was received. + * @throws Exception\UnauthorizedException when the request was unauthorized. + * @throws Exception\RateLimitException when the throttling limit has been reached for the API user. + * @throws Exception\Exception when something unexpected went wrong. + */ + public function getProductRanks(string $ean, string $date, ?Enum\GetProductRanksType $type = null, ?int $page = 1, ?string $AcceptLanguage = null): Model\ProductRanks + { + $url = "retailer/insights/product-ranks"; + $options = [ + 'query' => [ + 'ean' => $ean, + 'date' => $date, + 'type' => $type?->value, + 'page' => $page, + ], + 'produces' => 'application/vnd.retailer.v10+json', + ]; + $responseTypes = [ + '200' => Model\ProductRanks::class, + ]; + + return $this->request('GET', $url, $options, $responseTypes); + } + /** * Get sales forecast to estimate the sales expectations on the total bol.com platform for the requested number of * weeks ahead. diff --git a/src/Enum/GetProductRanksAcceptLanguage.php b/src/Enum/GetProductRanksAcceptLanguage.php new file mode 100644 index 0000000..630d17f --- /dev/null +++ b/src/Enum/GetProductRanksAcceptLanguage.php @@ -0,0 +1,13 @@ + [ 'model' => CommissionSuccessfulQuery::class, 'enum' => null, 'array' => true ], + 'failedQueries' => [ 'model' => CommissionFailedQuery::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var CommissionSuccessfulQuery[] + */ + public $successfulQueries = []; + + /** + * @var CommissionFailedQuery[] + */ + public $failedQueries = []; +} diff --git a/src/Model/ChangeTransportRequest.php b/src/Model/ChangeTransportRequest.php index 1a046da..5b9f24d 100644 --- a/src/Model/ChangeTransportRequest.php +++ b/src/Model/ChangeTransportRequest.php @@ -17,13 +17,13 @@ class ChangeTransportRequest extends AbstractModel public function getModelDefinition(): array { return [ - 'transporterCode' => [ 'model' => null, 'enum' => Enum\ChangeTransportRequestTransporterCode::class, 'array' => false ], + 'transporterCode' => [ 'model' => null, 'enum' => null, 'array' => false ], 'trackAndTrace' => [ 'model' => null, 'enum' => null, 'array' => false ], ]; } /** - * @var Enum\ChangeTransportRequestTransporterCode + * @var string Specify the transporter that carries out the shipment. */ public $transporterCode; diff --git a/src/Model/CommissionDateRange.php b/src/Model/CommissionDateRange.php new file mode 100644 index 0000000..c80f0b6 --- /dev/null +++ b/src/Model/CommissionDateRange.php @@ -0,0 +1,40 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'endDate' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'rates' => [ 'model' => CommissionDateRate::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var string The inclusive start date (in ISO 8601 format) from which the commission applies + */ + public $startDate; + + /** + * @var string The exclusive end date (in ISO 8601 format) after which the commission no longer applies. + */ + public $endDate; + + /** + * @var CommissionDateRate[] An array of objects, each describing commission rates for a specific condition. + */ + public $rates = []; +} diff --git a/src/Model/CommissionDateRate.php b/src/Model/CommissionDateRate.php new file mode 100644 index 0000000..95bf71a --- /dev/null +++ b/src/Model/CommissionDateRate.php @@ -0,0 +1,34 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'priceRanges' => [ 'model' => CommissionPriceRange::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var string Condition of the product. + */ + public $condition; + + /** + * @var CommissionPriceRange[] + */ + public $priceRanges = []; +} diff --git a/src/Model/CommissionFailedQuery.php b/src/Model/CommissionFailedQuery.php new file mode 100644 index 0000000..309c8e3 --- /dev/null +++ b/src/Model/CommissionFailedQuery.php @@ -0,0 +1,41 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'status' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'violations' => [ 'model' => Violation::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var float This provides the location of the entity where it was provided in the original response body. + */ + public $index; + + /** + * @var int HTTP status code for individual entity operation. + */ + public $status; + + /** + * @var Violation[] Outlines the list of violations encountered in the API for the specific index detailing the + * nature and reason for the issue. + */ + public $violations = []; +} diff --git a/src/Model/CommissionPriceRange.php b/src/Model/CommissionPriceRange.php new file mode 100644 index 0000000..fa9d80f --- /dev/null +++ b/src/Model/CommissionPriceRange.php @@ -0,0 +1,46 @@ + [ 'model' => CommissionRange::class, 'enum' => null, 'array' => false ], + 'fixedAmount' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'percentage' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'reductionApplied' => [ 'model' => null, 'enum' => null, 'array' => false ], + ]; + } + + /** + * @var CommissionRange Defines a specific price range for which the commission rates apply including VAT. + */ + public $range; + + /** + * @var float The fixed commission amount excluding VAT. + */ + public $fixedAmount; + + /** + * @var float A percentage of commission, based on the intended selling price per unit, excluding VAT. + */ + public $percentage; + + /** + * @var bool A boolean flag indicating whether a reduction is applied to the commission or not. + */ + public $reductionApplied; +} diff --git a/src/Model/CommissionProducts.php b/src/Model/CommissionProducts.php new file mode 100644 index 0000000..9e1ec5f --- /dev/null +++ b/src/Model/CommissionProducts.php @@ -0,0 +1,59 @@ + [ 'model' => Ean::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var Ean[] + */ + public $products = []; + + /** + * Returns an array with the eans from products. + * @return string[] Eans from products. + */ + public function getProductsEans(): array + { + return array_map(function ($model) { + return $model->ean; + }, $this->products); + } + + /** + * Sets products by an array of eans. + * @param string[] $eans Eans for products. + */ + public function setProductsEans(array $eans): void + { + $this->products = array_map(function ($ean) { + return Ean::constructFromArray(['ean' => $ean]); + }, $eans); + } + + /** + * Adds a new Ean to products by ean. + * @param string $ean Ean for the Ean to add. + */ + public function addProductsEan(string $ean): void + { + $this->products[] = Ean::constructFromArray(['ean' => $ean]); + } +} diff --git a/src/Model/CommissionRange.php b/src/Model/CommissionRange.php new file mode 100644 index 0000000..8543d50 --- /dev/null +++ b/src/Model/CommissionRange.php @@ -0,0 +1,34 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'upper' => [ 'model' => null, 'enum' => null, 'array' => false ], + ]; + } + + /** + * @var float The inclusive lower price threshold for which the commission is valid. + */ + public $lower; + + /** + * @var float The exclusive upper price threshold for which the commission is valid. + */ + public $upper; +} diff --git a/src/Model/CommissionRate.php b/src/Model/CommissionRate.php new file mode 100644 index 0000000..232c14d --- /dev/null +++ b/src/Model/CommissionRate.php @@ -0,0 +1,35 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'dateRanges' => [ 'model' => CommissionDateRange::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var string The EAN number associated with this product. + */ + public $ean; + + /** + * @var CommissionDateRange[] An array of objects, each describing a period during which certain commission rates + * apply. + */ + public $dateRanges = []; +} diff --git a/src/Model/CommissionSuccessfulQuery.php b/src/Model/CommissionSuccessfulQuery.php new file mode 100644 index 0000000..2f38ab1 --- /dev/null +++ b/src/Model/CommissionSuccessfulQuery.php @@ -0,0 +1,40 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'status' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'commissionRates' => [ 'model' => CommissionRate::class, 'enum' => null, 'array' => true ], + ]; + } + + /** + * @var float This provides the location of the entity where it was provided in the original response body. + */ + public $index; + + /** + * @var int HTTP status code for individual entity operation. + */ + public $status; + + /** + * @var CommissionRate[] + */ + public $commissionRates = []; +} diff --git a/src/Model/CreateOfferRequest.php b/src/Model/CreateOfferRequest.php index 93afe35..f50147f 100644 --- a/src/Model/CreateOfferRequest.php +++ b/src/Model/CreateOfferRequest.php @@ -46,7 +46,10 @@ public function getModelDefinition(): array public $reference; /** - * @var bool Indicates whether or not you want to put this offer for sale on the bol.com website. Defaults to false. + * @var bool This field specifies whether the retailer has temporarily suspended the listing of this offer on the + * bol.com website. When set to true, the offer becomes invisible to customers and is not available for purchase. + * The default setting, false, indicates that the offer is active and visible on the website. This feature is useful + * for managing inventory or making updates to the offer without permanently removing it from the site. */ public $onHoldByRetailer; diff --git a/src/Model/CreateProductContentSingleRequest.php b/src/Model/CreateProductContentSingleRequest.php index bdc9e50..a72b470 100644 --- a/src/Model/CreateProductContentSingleRequest.php +++ b/src/Model/CreateProductContentSingleRequest.php @@ -29,7 +29,8 @@ public function getModelDefinition(): array public $language; /** - * @var Attribute[] A list of attributes. + * @var Attribute[] A list of attributes. Every content update request should have one "EAN" attribute to link + * changes to a proper product. */ public $attributes = []; diff --git a/src/Model/Problem.php b/src/Model/Problem.php index 57e6592..2119f00 100644 --- a/src/Model/Problem.php +++ b/src/Model/Problem.php @@ -17,54 +17,49 @@ class Problem extends AbstractModel public function getModelDefinition(): array { return [ - 'detail' => [ 'model' => null, 'enum' => null, 'array' => false ], - 'instance' => [ 'model' => null, 'enum' => null, 'array' => false ], 'type' => [ 'model' => null, 'enum' => null, 'array' => false ], - 'host' => [ 'model' => null, 'enum' => null, 'array' => false ], 'title' => [ 'model' => null, 'enum' => null, 'array' => false ], 'status' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'detail' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'host' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'instance' => [ 'model' => null, 'enum' => null, 'array' => false ], 'violations' => [ 'model' => Violation::class, 'enum' => null, 'array' => true ], - 'causedBy' => [ 'model' => Problem::class, 'enum' => null, 'array' => false ], ]; } /** - * @var string + * @var string Type URI for this problem. Fixed value: https://api.bol.com/problems. */ - public $detail; + public $type; /** - * @var string + * @var string Title describing the nature of the problem. */ - public $instance; + public $title; /** - * @var string + * @var int HTTP status returned from the endpoint causing the problem. */ - public $type; + public $status; /** - * @var string + * @var string Detailed error message describing in additional detail what caused the service to return this + * problem. */ - public $host; + public $detail; /** - * @var string + * @var string Host identifier describing the server instance that reported the problem. */ - public $title; + public $host; /** - * @var int + * @var string Full URI path of the resource that reported the problem. */ - public $status; + public $instance; /** * @var Violation[] */ public $violations = []; - - /** - * @var Problem Describes a problem that occurred interacting with the API. - */ - public $causedBy; } diff --git a/src/Model/ProductRanks.php b/src/Model/ProductRanks.php new file mode 100644 index 0000000..2f30025 --- /dev/null +++ b/src/Model/ProductRanks.php @@ -0,0 +1,34 @@ + [ 'model' => Rank::class, 'enum' => null, 'array' => true ], + 'hasNextPage' => [ 'model' => null, 'enum' => null, 'array' => false ], + ]; + } + + /** + * @var Rank[] The list of ranks associated with the product. + */ + public $ranks = []; + + /** + * @var bool Indicator if there is a next page of ranks (true/false). + */ + public $hasNextPage; +} diff --git a/src/Model/Rank.php b/src/Model/Rank.php new file mode 100644 index 0000000..b3f0cc7 --- /dev/null +++ b/src/Model/Rank.php @@ -0,0 +1,52 @@ + [ 'model' => null, 'enum' => null, 'array' => false ], + 'searchTerm' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'wasSponsored' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'rank' => [ 'model' => null, 'enum' => null, 'array' => false ], + 'impressions' => [ 'model' => null, 'enum' => null, 'array' => false ], + ]; + } + + /** + * @var string The ID of the category to which the product belongs. + */ + public $categoryId; + + /** + * @var string Search term related to the rank. + */ + public $searchTerm; + + /** + * @var bool Indicator if the product is sponsored or not. + */ + public $wasSponsored; + + /** + * @var int The rank of the product in the category or search page. + */ + public $rank; + + /** + * @var int Number of impressions of the product. + */ + public $impressions; +} diff --git a/src/Model/RetailerOffer.php b/src/Model/RetailerOffer.php index 1612a9c..bc8b4aa 100644 --- a/src/Model/RetailerOffer.php +++ b/src/Model/RetailerOffer.php @@ -49,7 +49,10 @@ public function getModelDefinition(): array public $reference; /** - * @var bool Indicates whether or not you want to put this offer for sale on the bol.com website. Defaults to false. + * @var bool This field specifies whether the retailer has temporarily suspended the listing of this offer on the + * bol.com website. When set to true, the offer becomes invisible to customers and is not available for purchase. + * The default setting, false, indicates that the offer is active and visible on the website. This feature is useful + * for managing inventory or making updates to the offer without permanently removing it from the site. */ public $onHoldByRetailer; diff --git a/src/Model/UpdateOfferRequest.php b/src/Model/UpdateOfferRequest.php index 2b8b145..02a6cff 100644 --- a/src/Model/UpdateOfferRequest.php +++ b/src/Model/UpdateOfferRequest.php @@ -31,7 +31,10 @@ public function getModelDefinition(): array public $reference; /** - * @var bool Indicates whether or not you want to put this offer for sale on the bol.com website. Defaults to false. + * @var bool This field specifies whether the retailer has temporarily suspended the listing of this offer on the + * bol.com website. When set to true, the offer becomes invisible to customers and is not available for purchase. + * The default setting, false, indicates that the offer is active and visible on the website. This feature is useful + * for managing inventory or making updates to the offer without permanently removing it from the site. */ public $onHoldByRetailer; diff --git a/src/Model/Violation.php b/src/Model/Violation.php index fa1d63b..f807030 100644 --- a/src/Model/Violation.php +++ b/src/Model/Violation.php @@ -23,12 +23,12 @@ public function getModelDefinition(): array } /** - * @var string + * @var string Describes the origin of the error, for instance a field or query parameter validation error. */ public $name; /** - * @var string + * @var string Detailed description of the validation error that caused the problem. */ public $reason; } diff --git a/src/OpenApi/ClientGenerator.php b/src/OpenApi/ClientGenerator.php index 7159276..cd59794 100644 --- a/src/OpenApi/ClientGenerator.php +++ b/src/OpenApi/ClientGenerator.php @@ -2,6 +2,8 @@ namespace Picqer\BolRetailerV10\OpenApi; +use Exception; + class ClientGenerator { protected $specs; @@ -501,9 +503,9 @@ protected function addResponseTypes(array $responses, array &$code): void protected function getReturnType(array $responses): array { - $response = $responses['200'] ?? $responses['202'] ?? null; + $response = $responses['200'] ?? $responses['202'] ?? $responses['207'] ?? null; if ($response === null) { - throw new \Exception('Could not fit responseType'); + throw new Exception('Could not fit responseType: ' . print_r($responses, true)); } $response = current($response['content'] ?? []); @@ -537,7 +539,7 @@ protected function getReturnType(array $responses): array // currently only array is support if ($response['schema']['type'] != 'string' || $response['schema']['format'] != 'byte') { - throw new \Exception("Only Models and raw bytes are supported as response type"); + throw new Exception("Only Models and raw bytes are supported as response type"); } return ['doc' => 'string', 'php' => 'string', '']; } diff --git a/src/OpenApi/retailer.json b/src/OpenApi/retailer.json index d6d4757..e9e0665 100644 --- a/src/OpenApi/retailer.json +++ b/src/OpenApi/retailer.json @@ -225,6 +225,48 @@ } } }, + "/retailer/commissions": { + "post": { + "tags": [ + "Commissions" + ], + "summary": "Get a list of commissions by EAN (BETA)", + "description": "Gets a list of all commissions using EAN.", + "operationId": "get-commission-rates", + "requestBody": { + "content": { + "application/vnd.retailer.v10+json": { + "schema": { + "$ref": "#/components/schemas/CommissionProducts" + } + } + }, + "required": true + }, + "responses": { + "207": { + "description": "Multi-status: Retrieved successful and unsuccessful results.", + "content": { + "application/vnd.retailer.v10+json": { + "schema": { + "$ref": "#/components/schemas/BulkCommissionRatesMultiStatusResponse" + } + } + } + }, + "400": { + "description": "Bad request: The sent request does not meet the API specification. Please check the error message(s) for more information.", + "content": { + "application/vnd.retailer.v10+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + } + } + } + }, "/retailer/content/catalog-products/{ean}": { "get": { "tags": [ @@ -583,6 +625,111 @@ } } }, + "/retailer/insights/product-ranks": { + "get": { + "tags": [ + "Insights" + ], + "summary": "Get product ranks", + "description": "Gets a list of product ranks.", + "operationId": "get-product-ranks", + "parameters": [ + { + "name": "ean", + "in": "query", + "description": "The EAN number associated with this product.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "date", + "in": "query", + "description": "Filters search results to a specific date. The date must be in the past, no more than three months back, and up to yesterday.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Determines the search type, either 'SEARCH' for specific queries or 'BROWSE' for broader category searches. In order to retrieve all results, it can be sent as \"null\".", + "required": false, + "schema": { + "type": "string", + "enum": [ + "SEARCH", + "BROWSE" + ] + } + }, + { + "name": "page", + "in": "query", + "description": "The requested page number with a page size of 50 items.", + "required": false, + "schema": { + "maximum": 200, + "minimum": 1, + "type": "integer", + "format": "int32", + "default": 1 + }, + "example": 1 + }, + { + "name": "Accept-Language", + "in": "header", + "description": "The language to search for.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "nl-NL", + "nl", + "nl-BE", + "fr", + "fr-BE" + ] + } + } + ], + "responses": { + "200": { + "description": "Ok: Successfully processed the request.", + "content": { + "application/vnd.retailer.v10+json": { + "schema": { + "$ref": "#/components/schemas/ProductRanks" + } + } + } + }, + "400": { + "description": "Bad request: The sent request does not meet the API specification. Please check the error message(s) for more information.", + "content": { + "application/vnd.retailer.v10+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + }, + "406": { + "description": "Not acceptable: The sent request header does not meet the API specification. Please check the error message(s) for more information.", + "content": { + "application/vnd.retailer.v10+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + } + } + } + }, "/retailer/insights/sales-forecast": { "get": { "tags": [ @@ -819,7 +966,7 @@ "Invoices" ], "summary": "Get all invoices", - "description": "Gets a list of invoices, by default from the past 4 weeks. The optional period-start-date and period-end-date-date parameters can be used together to retrieve invoices from a specific date range in the past, the period can be no longer than 31 days. Invoices and their specifications can be downloaded separately in different media formats with the ‘GET an invoice by id’ and the ‘GET an invoice specification by id’ calls. The available media types differ per invoice and are listed per invoice within the response. Note: the media types listed in the response must be given in our standard API format.", + "description": "Gets a list of invoices, by default from the past 4 weeks. The optional period-start-date and period-end-date-date parameters can be used together to retrieve invoices from a specific date range in the past, the period can be no longer than 31 days. Invoices and their specifications can be downloaded separately in different media formats with the ‘GET an invoice by id’ and the ‘GET an invoice specification by id’ calls. The available media types differ per invoice and are listed per invoice within the response. Note: the media types listed in the response must be given in our standard API format.", "operationId": "get-invoices", "parameters": [ { @@ -3344,7 +3491,7 @@ "content": { "application/vnd.retailer.v10+json": { "schema": { - "$ref": "#/components/schemas/problem" + "$ref": "#/components/schemas/Problem" } } } @@ -3593,7 +3740,7 @@ "content": { "application/vnd.retailer.v10+json": { "schema": { - "$ref": "#/components/schemas/problem" + "$ref": "#/components/schemas/Problem" } } } @@ -4187,39 +4334,8 @@ "properties": { "transporterCode": { "type": "string", - "example": "TNT", - "enum": [ - "AMPERE", - "BPOST_BE", - "BPOST_BRIEF", - "BRIEFPOST", - "BUDBEE", - "COURIER", - "CYCLOON", - "DHL", - "DHL-GLOBAL-MAIL", - "DHL-SD", - "DHLFORYOU", - "DHL_DE", - "DPD-BE", - "DPD-NL", - "DYL", - "FEDEX_BE", - "FEDEX_NL", - "GLS", - "OTHER", - "PACKS", - "PARCEL-NL", - "PES", - "TNT", - "TNT-EXPRESS", - "TNT-EXTRA", - "TNT_BRIEF", - "TRANSMISSION", - "TRUNKRS", - "TSN", - "UPS" - ] + "description": "Specify the transporter that carries out the shipment.", + "example": "TNT" }, "trackAndTrace": { "type": "string", @@ -4553,8 +4669,7 @@ }, "UpdateOfferRequest": { "required": [ - "fulfilment", - "onHoldByRetailer" + "fulfilment" ], "type": "object", "properties": { @@ -4567,8 +4682,9 @@ }, "onHoldByRetailer": { "type": "boolean", - "description": "Indicates whether or not you want to put this offer for sale on the bol.com website. Defaults to false.", - "example": false + "description": "This field specifies whether the retailer has temporarily suspended the listing of this offer on the bol.com website. When set to true, the offer becomes invisible to customers and is not available for purchase. The default setting, false, indicates that the offer is active and visible on the website. This feature is useful for managing inventory or making updates to the offer without permanently removing it from the site.", + "example": false, + "default": false }, "unknownProductTitle": { "maxLength": 500, @@ -5198,7 +5314,7 @@ "ean": { "type": "string", "description": "The EAN number associated with this product.", - "example": "The EAN number associated with this product." + "example": "0000007740404" } } }, @@ -5530,7 +5646,6 @@ "condition", "ean", "fulfilment", - "onHoldByRetailer", "pricing", "stock" ], @@ -5553,8 +5668,9 @@ }, "onHoldByRetailer": { "type": "boolean", - "description": "Indicates whether or not you want to put this offer for sale on the bol.com website. Defaults to false.", - "example": false + "description": "This field specifies whether the retailer has temporarily suspended the listing of this offer on the bol.com website. When set to true, the offer becomes invisible to customers and is not available for purchase. The default setting, false, indicates that the offer is active and visible on the website. This feature is useful for managing inventory or making updates to the offer without permanently removing it from the site.", + "example": false, + "default": false }, "unknownProductTitle": { "maxLength": 500, @@ -5649,8 +5765,6 @@ "FRONT" ], "items": { - "maxLength": 2, - "minLength": 1, "type": "string", "description": "The label(s) of the asset.", "example": "[\"FRONT\"]" @@ -5681,7 +5795,7 @@ } } }, - "description": "A list of attributes." + "description": "A list of attributes. Every content update request should have one \"EAN\" attribute to link changes to a proper product." }, "AttributeValue": { "required": [ @@ -5726,7 +5840,7 @@ "maxItems": 150, "minItems": 1, "type": "array", - "description": "A list of attributes.", + "description": "A list of attributes. Every content update request should have one \"EAN\" attribute to link changes to a proper product.", "items": { "$ref": "#/components/schemas/Attribute" } @@ -5856,6 +5970,214 @@ } } }, + "CommissionProducts": { + "required": [ + "products" + ], + "type": "object", + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Ean" + } + } + } + }, + "BulkCommissionRatesMultiStatusResponse": { + "required": [ + "failedQueries", + "successfulQueries" + ], + "type": "object", + "properties": { + "successfulQueries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommissionSuccessfulQuery" + } + }, + "failedQueries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommissionFailedQuery" + } + } + } + }, + "CommissionDateRange": { + "required": [ + "endDate", + "rates", + "startDate" + ], + "type": "object", + "properties": { + "startDate": { + "type": "string", + "description": "The inclusive start date (in ISO 8601 format) from which the commission applies", + "example": "1970-01-01" + }, + "endDate": { + "type": "string", + "description": "The exclusive end date (in ISO 8601 format) after which the commission no longer applies.", + "example": "1970-01-01" + }, + "rates": { + "type": "array", + "description": "An array of objects, each describing commission rates for a specific condition.", + "items": { + "$ref": "#/components/schemas/CommissionDateRate" + } + } + }, + "description": "An array of objects, each describing a period during which certain commission rates apply." + }, + "CommissionDateRate": { + "required": [ + "condition", + "priceRanges" + ], + "type": "object", + "properties": { + "condition": { + "type": "string", + "description": "Condition of the product.", + "example": "NEW" + }, + "priceRanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommissionPriceRange" + } + } + }, + "description": "An array of objects, each describing commission rates for a specific condition." + }, + "CommissionFailedQuery": { + "required": [ + "index", + "status", + "violations" + ], + "type": "object", + "properties": { + "index": { + "type": "number", + "description": "This provides the location of the entity where it was provided in the original response body.", + "example": 1 + }, + "status": { + "type": "integer", + "description": "HTTP status code for individual entity operation.", + "format": "int32", + "example": 400 + }, + "violations": { + "type": "array", + "description": "Outlines the list of violations encountered in the API for the specific index detailing the nature and reason for the issue.", + "items": { + "$ref": "#/components/schemas/Violation" + } + } + } + }, + "CommissionPriceRange": { + "required": [ + "fixedAmount", + "percentage", + "range", + "reductionApplied" + ], + "type": "object", + "properties": { + "range": { + "$ref": "#/components/schemas/CommissionRange" + }, + "fixedAmount": { + "type": "number", + "description": "The fixed commission amount excluding VAT.", + "example": 0 + }, + "percentage": { + "type": "number", + "description": "A percentage of commission, based on the intended selling price per unit, excluding VAT.", + "example": 20 + }, + "reductionApplied": { + "type": "boolean", + "description": "A boolean flag indicating whether a reduction is applied to the commission or not.", + "example": true + } + } + }, + "CommissionRange": { + "required": [ + "lower" + ], + "type": "object", + "properties": { + "lower": { + "type": "number", + "description": "The inclusive lower price threshold for which the commission is valid.", + "example": 0 + }, + "upper": { + "type": "number", + "description": "The exclusive upper price threshold for which the commission is valid.", + "example": 10 + } + }, + "description": "Defines a specific price range for which the commission rates apply including VAT." + }, + "CommissionRate": { + "required": [ + "dateRanges", + "ean" + ], + "type": "object", + "properties": { + "ean": { + "type": "string", + "description": "The EAN number associated with this product.", + "example": "0000007740404" + }, + "dateRanges": { + "type": "array", + "description": "An array of objects, each describing a period during which certain commission rates apply.", + "items": { + "$ref": "#/components/schemas/CommissionDateRange" + } + } + } + }, + "CommissionSuccessfulQuery": { + "required": [ + "commissionRates", + "index", + "status" + ], + "type": "object", + "properties": { + "index": { + "type": "number", + "description": "This provides the location of the entity where it was provided in the original response body.", + "example": 0 + }, + "status": { + "type": "integer", + "description": "HTTP status code for individual entity operation.", + "format": "int32", + "example": 200 + }, + "commissionRates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommissionRate" + } + } + } + }, "BulkCommissionQuery": { "required": [ "ean", @@ -6114,52 +6436,6 @@ } } }, - "problem": { - "type": "object", - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uri" - }, - "type": { - "type": "string", - "format": "uri" - }, - "host": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer", - "format": "int32" - }, - "violations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/violation" - } - }, - "causedBy": { - "$ref": "#/components/schemas/problem" - } - } - }, - "violation": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "reason": { - "type": "string" - } - } - }, "ReducedShipment": { "required": [ "order", @@ -9130,7 +9406,7 @@ }, "onHoldByRetailer": { "type": "boolean", - "description": "Indicates whether or not you want to put this offer for sale on the bol.com website. Defaults to false.", + "description": "This field specifies whether the retailer has temporarily suspended the listing of this offer on the bol.com website. When set to true, the offer becomes invisible to customers and is not available for purchase. The default setting, false, indicates that the offer is active and visible on the website. This feature is useful for managing inventory or making updates to the offer without permanently removing it from the site.", "example": false }, "unknownProductTitle": { @@ -9511,6 +9787,65 @@ } } }, + "ProductRanks": { + "required": [ + "hasNextPage", + "ranks" + ], + "type": "object", + "properties": { + "ranks": { + "type": "array", + "description": "The list of ranks associated with the product.", + "items": { + "$ref": "#/components/schemas/Rank" + } + }, + "hasNextPage": { + "type": "boolean", + "description": "Indicator if there is a next page of ranks (true/false).", + "example": false + } + } + }, + "Rank": { + "required": [ + "impressions", + "rank", + "wasSponsored" + ], + "type": "object", + "properties": { + "categoryId": { + "type": "string", + "description": "The ID of the category to which the product belongs.", + "example": "53495" + }, + "searchTerm": { + "type": "string", + "description": "Search term related to the rank.", + "example": "dvd" + }, + "wasSponsored": { + "type": "boolean", + "description": "Indicator if the product is sponsored or not.", + "example": false + }, + "rank": { + "type": "integer", + "description": "The rank of the product in the category or search page.", + "format": "int32", + "example": 1 + }, + "impressions": { + "type": "integer", + "description": "Number of impressions of the product.", + "format": "int32", + "example": 100 + } + }, + "description": "The list of ranks associated with the product." + }, "Details": { "required": [ "norm",