diff --git a/composer.json b/composer.json index 655b3bfa..16928158 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "phpstan/phpstan-guzzle": "^0.7.0", "fr3d/swagger-assertions": "^0.8.1", "php-vcr/php-vcr": "^1.3", - "symfony/yaml": "^3.2" + "symfony/yaml": "^3.2", + "justinrainbow/json-schema": "^5.2.1" }, "autoload-dev": { "psr-4": { "Wizaplace\\Tests\\": "tests/" } diff --git a/src/Catalog/CatalogService.php b/src/Catalog/CatalogService.php index 9c1c873c..c8c57a71 100644 --- a/src/Catalog/CatalogService.php +++ b/src/Catalog/CatalogService.php @@ -51,7 +51,7 @@ public function getCategory(int $id): CatalogCategory return new CatalogCategory($category); } - public function search($query = '', $filters = [], $sorting = [], $resultsPerPage = 12, $page = 1): SearchResult + public function search(string $query = '', array $filters = [], array $sorting = [], int $resultsPerPage = 12, int $page = 1): SearchResult { $results = $this->get( 'catalog/search/products', diff --git a/src/Catalog/ProductSummary.php b/src/Catalog/ProductSummary.php index e1245d33..a0950354 100644 --- a/src/Catalog/ProductSummary.php +++ b/src/Catalog/ProductSummary.php @@ -174,4 +174,9 @@ public function getCategoryPath(): array { return $this->categoryPath; } + + public function getSlug(): string + { + return $this->slug; + } } diff --git a/tests/ApiTest.php b/tests/ApiTest.php index c9417347..ef3fcef2 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -13,6 +13,8 @@ use GuzzleHttp\Client; use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; +use JsonSchema\Constraints\Constraint; +use JsonSchema\Validator; use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Yaml; use VCR\VCR; @@ -28,7 +30,7 @@ abstract class ApiTest extends TestCase /** * @var array[] */ - private static $historyContainer = []; + protected static $historyContainer = []; public static function getApiBaseUrl(): string { @@ -86,4 +88,9 @@ protected function tearDown(): void } parent::tearDown(); } + + protected function getValidator(): Validator + { + return new Validator(Constraint::CHECK_MODE_TYPE_CAST); + } } diff --git a/tests/Catalog/CatalogServiceTest.php b/tests/Catalog/CatalogServiceTest.php index aabc39ea..52dfd6c1 100644 --- a/tests/Catalog/CatalogServiceTest.php +++ b/tests/Catalog/CatalogServiceTest.php @@ -27,6 +27,7 @@ public function testGetProductById() $this->assertEquals(1, $product->getId()); $this->assertEquals('test-product-slug', $product->getSlug()); + // @TODO: more assertions } finally { VCR::turnOff(); } @@ -46,4 +47,27 @@ public function testGetNonExistingProductById() VCR::turnOff(); } } + + public function testSearchOneProductByName() + { + try { + VCR::turnOn(); + VCR::insertCassette($this->getName()); + + $catalogService = new CatalogService($this->getGuzzleClient()); + + $result = $catalogService->search('optio corporis similique voluptatum'); + + $products = $result->getProducts(); + $this->assertCount(1, $products); + + $product = $products[0]; + $this->assertEquals(1, $product->getId()); + $this->assertEquals('test-product-slug', $product->getSlug()); + // @TODO: more assertions + } finally { + VCR::turnOff(); + static::$historyContainer = []; // @FIXME: small hack due to fr3d/swagger-assertions not properly checking URL query non-string types. + } + } } diff --git a/tests/fixtures/VCR/Swagger-schema b/tests/fixtures/VCR/Swagger-schema index d571c0b2..49acff24 100644 --- a/tests/fixtures/VCR/Swagger-schema +++ b/tests/fixtures/VCR/Swagger-schema @@ -11,12 +11,12 @@ code: '200' message: OK headers: - Date: 'Mon, 29 May 2017 10:21:13 GMT' + Date: 'Mon, 29 May 2017 11:11:42 GMT' Server: 'Apache/2.4.10 (Debian)' Cache-Control: 'no-cache, private' - X-Debug-Token: 34f81f - X-Debug-Token-Link: 'http://wizaplace.loc/_profiler/34f81f' + X-Debug-Token: cfb8dd + X-Debug-Token-Link: 'http://wizaplace.loc/_profiler/cfb8dd' Vary: Accept-Encoding Transfer-Encoding: chunked Content-Type: 'text/html; charset=UTF-8' - body: "swagger: '2.0'\ninfo:\n version: v1\n title: 'Wizaplace API'\n description: \"**This is the documentation of the API of your marketplace.**\\n\\nSome API endpoints require to be authenticated. For that you will need to provide a\\n`Authorization` header with a valid API key:\\n\\n```\\nAuthorization: token your_api_key_here\\n```\\n\\nTo get the API key the first time, you can use the `/users/authenticate` endpoint. This\\nendpoint requires a HTTP basic authentication with a user's email and password. The\\nresponse will contain the API key to use for that user.\\n\"\nbasePath: /api/v1\nschemes:\n - https\nproduces:\n - application/json\ntags:\n -\n name: Favorites\n description: on-demand\n -\n name: CMS\n -\n name: Images\n -\n name: Orders\n -\n name: PIM\n -\n name: SEO\n -\n name: Basket\n -\n name: Users\n -\n name: MailingLists\n -\n name: Catalog\nsecurityDefinitions:\n basicAuth:\n type: basic\n description: 'HTTP Basic Authentication, with email and password'\n apiKey:\n type: apiKey\n in: header\n name: Authorization\n description: 'Example: `Authorization: token your_api_key_here`'\nparameters:\n productId:\n name: productId\n in: path\n description: 'The product identifier number'\n type: integer\n required: true\n declinationId:\n name: declinationId\n in: path\n description: 'The declination identifier number'\n type: string\n required: true\n companyId:\n name: companyId\n in: path\n description: 'The company identifier number'\n type: integer\n required: true\n attributeId:\n name: attributeId\n in: path\n description: 'The attribute identifier number'\n type: integer\n required: true\n categoryId:\n name: categoryId\n in: path\n description: 'The category identifier number'\n type: integer\n required: true\n orderId:\n name: orderId\n in: path\n description: 'The order identifier number'\n type: integer\n required: true\n returnId:\n name: returnId\n in: path\n description: 'The return identifier number'\n type: integer\n required: true\n imageId:\n name: imageId\n in: path\n description: 'The image Id'\n type: integer\n required: true\n multiVendorProductId:\n name: multiVendorProductId\n in: path\n description: 'Multi vendor product identifier'\n type: string\n format: uuid\n required: true\n basketId:\n name: basketId\n in: path\n description: 'Basket identifier'\n type: string\n format: uuid\n required: true\n coupon:\n name: coupon\n in: path\n description: 'Coupon code'\n type: string\n required: true\n userId:\n name: userId\n in: path\n description: 'The user identifier'\n type: integer\n required: true\n mailingListId:\n name: mailingListId\n in: path\n description: 'The mailing list identifier number'\n type: integer\n required: true\n mailingListEmail:\n name: mailingListEmail\n in: path\n description: 'The email address to (un)subscribe to the mailing list'\n type: string\n format: email\n required: true\npaths:\n /favorites/declinations:\n get:\n tags:\n - Favorites\n security:\n -\n apiKey: { }\n description: 'List all declinations defined as favorite'\n responses:\n 200:\n description: 'List of favorites'\n schema:\n type: array\n items:\n $ref: '#/definitions/DeclinationId'\n '/favorites/declinations/{declinationId}':\n parameters:\n -\n $ref: '#/parameters/declinationId'\n put:\n tags:\n - Favorites\n security:\n -\n apiKey: { }\n description: 'Add a product to favorites'\n responses:\n 201:\n description: 'Product has been add'\n 409:\n description: 'Product already is a favorite'\n 400:\n description: 'The id is not valid'\n delete:\n tags:\n - Favorites\n security:\n -\n apiKey: { }\n description: 'Remove a product from favorites'\n responses:\n 204:\n description: 'Product has been removed'\n /cms/menus:\n get:\n tags:\n - CMS\n description: 'Get all menus with associated items'\n responses:\n 200:\n description: 'An array of menus'\n schema:\n type: array\n items:\n $ref: '#/definitions/Menus'\n /cms/banners:\n parameters:\n -\n name: device\n type: string\n in: query\n required: false\n enum:\n - mobile\n - desktop\n description: 'If provided, value must be ''mobile'' or ''desktop''. If not provided, the device criteria is ignored.'\n get:\n tags:\n - CMS\n description: 'Get homepage banners'\n responses:\n 200:\n description: 'An array of banners'\n schema:\n type: array\n items:\n $ref: '#/definitions/Banner'\n '/cms/banners/category/{categoryId}':\n parameters:\n -\n $ref: '#/parameters/categoryId'\n -\n name: device\n type: string\n in: query\n required: false\n enum:\n - mobile\n - desktop\n description: 'If provided, value must be ''mobile'' or ''desktop''. If not provided, the device criteria is ignored.'\n get:\n tags:\n - CMS\n description: 'Get category banners'\n responses:\n 200:\n description: 'An array of banners'\n schema:\n type: array\n items:\n $ref: '#/definitions/Banner'\n '/image/{imageId}':\n parameters:\n -\n $ref: '#/parameters/imageId'\n get:\n tags:\n - Images\n description: 'Get an image by Id'\n responses:\n 302:\n description: 'The image url is in the HTTP Location header'\n 404:\n description: 'The image doesn''t exist'\n /user/orders:\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get orders'\n responses:\n 200:\n description: 'An array of orders'\n schema:\n type: array\n items:\n $ref: '#/definitions/Order'\n '/user/orders/{orderId}':\n parameters:\n -\n $ref: '#/parameters/orderId'\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get an order'\n responses:\n 200:\n description: 'The order object'\n schema:\n $ref: '#/definitions/Order'\n 404:\n description: 'Order not found'\n /user/orders/returns:\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get the list of returns'\n responses:\n 200:\n description: 'List of returns'\n schema:\n type: array\n items:\n $ref: '#/definitions/OrderReturn'\n '/user/orders/returns/{returnId}':\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get one return'\n parameters:\n -\n $ref: '#/parameters/returnId'\n responses:\n 200:\n description: 'Return data'\n schema:\n $ref: '#/definitions/OrderReturn'\n /orders/returns/reasons:\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get list of return reasons'\n responses:\n 200:\n description: 'List of reasons'\n schema:\n type: array\n items:\n type: object\n properties:\n id:\n type: int\n name:\n type: string\n '/user/orders/{orderId}/returns':\n post:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Create a return'\n parameters:\n -\n $ref: '#/parameters/orderId'\n -\n name: createReturn\n required: true\n description: 'Create a return'\n in: body\n schema:\n type: object\n required:\n - comments\n - items\n properties:\n returnTypeId:\n type: int\n comments:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/ReturnItem'\n responses:\n 201:\n description: 'The return id'\n schema:\n $ref: '#/definitions/Order'\n 404:\n description: 'Order not found'\n /pim/multi-vendor-products:\n get:\n parameters:\n -\n name: page\n in: query\n type: integer\n description: 'Page to return (starts at 1)'\n default: 1\n -\n name: resultsPerPage\n in: query\n type: integer\n description: 'Number of results per page'\n default: 50\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'List all multi vendor products (this feature is only available on-demand)'\n responses:\n 200:\n description: 'List of multi vendor products'\n schema:\n type: object\n properties:\n total:\n type: integer\n count:\n type: integer\n _embedded:\n type: array\n items:\n $ref: '#/definitions/MultiVendorProduct'\n post:\n tags:\n - PIM\n description: 'Create a new multi vendor product (this feature is only available on-demand)'\n parameters:\n -\n name: 'multi vendor products'\n required: true\n description: 'The data for the multi vendor product'\n in: body\n schema:\n type: object\n required:\n - name\n - categoryId\n properties:\n name:\n type: string\n code:\n type: string\n supplierReference:\n type: string\n slug:\n type: string\n shortDescription:\n type: string\n description:\n type: string\n status:\n type: string\n categoryId:\n type: integer\n responses:\n 201:\n description: 'Multi vendor products created'\n schema:\n $ref: '#/definitions/MultiVendorProduct'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n '/pim/multi-vendor-products/{multiVendorProductId}':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Retrieve a multi vendor product (this feature is only available on-demand)'\n responses:\n 200:\n description: 'Multi vendor product retrieved'\n schema:\n $ref: '#/definitions/MultiVendorProduct'\n 404:\n description: 'Multi vendor product not found'\n put:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Update a multi vendor product (this feature is only available on-demand)'\n responses:\n 201:\n description: 'Multi vendor product added'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n delete:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Remove a multi vendor product (this feature is only available on-demand)'\n responses:\n 204:\n description: 'Multi vendor product removed'\n 404:\n description: 'Multi vendor product not found'\n '/pim/multi-vendor-products/{multiVendorProductId}/links':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'List all links between MVP and product (this feature is only available on-demand)'\n responses:\n 200:\n description: 'List of links between MVP and product'\n schema:\n type: array\n items:\n $ref: '#/definitions/MultiVendorProductLink'\n post:\n tags:\n - PIM\n description: 'Create a new link between a MVP and a product (this feature is only available on-demand)'\n parameters:\n -\n name: link\n required: true\n description: 'The data for the link'\n in: body\n schema:\n type: object\n required:\n - multiVendorProductId\n - productId\n properties:\n multiVendorProductId:\n type: string\n productId:\n type: integer\n responses:\n 201:\n description: 'Product are linked to MVP (this feature is only available on-demand)'\n schema:\n $ref: '#/definitions/MultiVendorProductLink'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n '/pim/multi-vendor-products/{multiVendorProductId}/links/{productId}':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n -\n $ref: '#/parameters/productId'\n delete:\n tags:\n - PIM\n description: 'Detach a product from a MVP (this feature is only available on-demand)'\n responses:\n 204:\n description: 'Product is detached from MVP'\n 404:\n description: 'Link not found'\n '/pim/multi-vendor-products/{multiVendorProductId}/images':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n post:\n tags:\n - PIM\n description: 'Upload and associate an image to an MVP. The request should be in multipart.'\n parameters:\n -\n name: file\n required: true\n description: 'image file'\n in: formData\n type: file\n format: file\n responses:\n 200:\n description: 'Image is uploaded and associated'\n schema:\n $ref: '#/definitions/MultiVendorProduct'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n /categories:\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'List all categories'\n parameters:\n -\n name: leaves\n in: query\n description: 'Retrieve only leaves'\n type: boolean\n required: false\n -\n name: category_ids\n in: query\n description: 'Retrieve only categories matching specified ids'\n type: array\n items:\n type: integer\n required: false\n responses:\n 200:\n description: 'List of multi categories'\n schema:\n type: array\n items:\n $ref: '#/definitions/Category'\n '/categories/{categoryId}':\n parameters:\n -\n $ref: '#/parameters/categoryId'\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Retrieve a specific category by Id'\n responses:\n 200:\n description: Category\n schema:\n $ref: '#/definitions/Category'\n 404:\n description: 'Category does not exist'\n /seo/slugs:\n parameters:\n -\n name: slugs\n type: array\n in: query\n required: true\n description: 'List of slugs to resolve. You can provide it in the query string as an array, for example ''?slugs[]=iphone&slugs[]=mobile'''\n get:\n tags:\n - SEO\n description: 'Each slug is unique in the system and points to a single ''object'' (called a target). This API endpoint resolves each slug provided and returns the targets to which they point. If a slug is not found (it is unknown), it will not be returned in the response.'\n responses:\n 200:\n description: 'The response is a JSON object where keys are slugs and values are the (resolved) target of the slug.'\n schema:\n type: object\n additionalProperties:\n $ref: '#/definitions/SlugTarget'\n /basket:\n post:\n tags:\n - Basket\n description: 'Create a new basket and returns its ID.'\n responses:\n 201:\n description: 'The ID returned is a UUID, for example: `3f79d867-f325-47a6-9e82-2ba6b9cade14`.'\n '/basket/{basketId}':\n parameters:\n -\n $ref: '#/parameters/basketId'\n get:\n tags:\n - Basket\n description: 'Get a basket by its ID.'\n responses:\n 200:\n description: 'The basket object.'\n schema:\n $ref: '#/definitions/Basket'\n 404:\n description: 'The basket doesn''t exist.'\n '/basket/{basketId}/coupons/{coupon}':\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n $ref: '#/parameters/coupon'\n post:\n tags:\n - Basket\n description: 'Add a coupon code to the basket'\n responses:\n 204:\n description: 'The coupon code has been added.'\n 409:\n description: 'The coupon code is already added.'\n delete:\n tags:\n - Basket\n description: 'Remove a coupon code from the basket'\n responses:\n 204:\n description: 'The coupon code has been removed.'\n 404:\n description: 'The coupon code is not in the basket.'\n '/basket/{basketId}/payments':\n parameters:\n -\n $ref: '#/parameters/basketId'\n get:\n tags:\n - Basket\n description: 'Get available payments on this basket'\n responses:\n 200:\n description: 'A list of payments.'\n schema:\n type: array\n items:\n $ref: '#/definitions/Payment'\n 404:\n description: 'The basket doesn''t exist.'\n '/basket/{basketId}/add':\n post:\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: addBasket\n required: true\n description: 'Add an item in basket'\n in: body\n schema:\n type: object\n required:\n - declinationId\n - quantity\n properties:\n declinationId:\n type: string\n quantity:\n type: integer\n description: 'should be > 0'\n tags:\n - Basket\n description: 'Add an item in basket'\n responses:\n 200:\n description: 'Product added'\n schema:\n properties:\n quantity:\n type: integer\n description: 'Quantity of product in basket.'\n 404:\n description: 'Basket not found'\n 400:\n description: 'Some parameters are not correct'\n '/basket/{basketId}/remove':\n post:\n tags:\n - Basket\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: declinationId\n required: true\n description: 'Item to remove'\n in: body\n schema:\n $ref: '#/definitions/DeclinationId'\n responses:\n 204:\n description: 'item is removed from basket'\n 400:\n description: 'declination id is missing'\n 404:\n description: 'the basket is not found'\n '/basket/{basketId}/modify':\n post:\n tags:\n - Basket\n description: 'Change quantity of a product in the basket'\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: editQuantity\n required: true\n description: 'Item and the new quantity'\n in: body\n schema:\n type: object\n required:\n - declinationId\n - quantity\n properties:\n declinationId:\n type: string\n quantity:\n type: integer\n description: 'should be > 0'\n responses:\n 404:\n description: 'Basket not found'\n 400:\n description: 'Some parameters are not correct'\n 200:\n description: 'Quantity has been modified'\n schema:\n properties:\n quantity:\n type: integer\n description: 'New quantity of item in basket.'\n '/basket/{basketId}/order':\n post:\n tags:\n - Basket\n description: 'Checkout: turn the basket into an order (or several orders)'\n security:\n -\n apiKey: { }\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: checkout\n in: body\n schema:\n type: object\n required:\n - acceptTermsAndConditions\n properties:\n acceptTermsAndConditions:\n type: boolean\n description: 'Whether the customer accepts the terms and conditions'\n paymentId:\n type: integer\n description: 'ID of the payment to use for paying the order'\n responses:\n 404:\n description: 'Basket not found'\n 400:\n description: 'Some parameters are not correct'\n 200:\n description: 'The orders have been created, the customer now needs to proceed to the payment (either through the redirectUrl or through the returned HTML page)'\n schema:\n properties:\n orders:\n type: array\n description: 'List of orders'\n items:\n type: object\n properties:\n id:\n type: integer\n required:\n - id\n redirectUrl:\n type: string\n description: 'If present, the customer must be redirected to this URL to proceed to the payment'\n html:\n type: string\n description: 'If present, the HTML must be rendered as a web page to the customer to proceed to the payment'\n required:\n - orders\n /users/authenticate:\n get:\n tags:\n - Users\n security:\n -\n basicAuth: { }\n description: 'Get an Api key with email/password'\n responses:\n 200:\n description: 'You are authenticated, here is your Api key'\n schema:\n properties:\n id:\n type: integer\n apiKey:\n type: string\n 401:\n description: 'Bad credentials'\n '/users/{userId}':\n parameters:\n -\n $ref: '#/parameters/userId'\n get:\n tags:\n - Users\n security:\n -\n apiKey: { }\n description: 'Get a user profile'\n responses:\n 200:\n description: 'User profile'\n schema:\n $ref: '#/definitions/User'\n 404:\n description: 'User not found'\n put:\n tags:\n - Users\n description: 'Update a user profile'\n security:\n -\n apiKey: { }\n parameters:\n -\n name: user\n required: true\n description: 'The new data for the user'\n in: body\n schema:\n type: object\n required:\n - email\n - firstName\n - lastName\n properties:\n email:\n type: string\n firstName:\n type: string\n lastName:\n type: string\n responses:\n 200:\n description: 'Updated user profile'\n schema:\n $ref: '#/definitions/User'\n 404:\n description: 'User not found'\n '/users/{userId}/password':\n parameters:\n -\n $ref: '#/parameters/userId'\n put:\n tags:\n - Users\n description: 'Change user password'\n security:\n -\n apiKey: { }\n parameters:\n -\n name: user\n required: true\n description: 'The new password for the user.'\n in: body\n schema:\n type: object\n required:\n - password\n properties:\n password:\n type: string\n responses:\n 204:\n description: 'Password was updated'\n 400:\n description: 'Some parameters are not correct'\n 404:\n description: 'User not found'\n /users:\n post:\n tags:\n - Users\n description: 'Create a new user'\n parameters:\n -\n name: user\n required: true\n description: 'The data for the user'\n in: body\n schema:\n type: object\n required:\n - email\n - password\n properties:\n email:\n type: string\n password:\n type: string\n firstName:\n type: string\n lastName:\n type: string\n responses:\n 201:\n description: 'User created'\n schema:\n $ref: '#/definitions/User'\n 409:\n description: 'User already exists'\n 400:\n description: 'Some parameters are not correct'\n '/users/{userId}/addresses':\n parameters:\n -\n $ref: '#/parameters/userId'\n put:\n tags:\n - Users\n description: 'Update a user''s addresses'\n security:\n -\n apiKey: { }\n parameters:\n -\n name: addresses\n required: true\n description: 'The new addresses'\n in: body\n schema:\n type: object\n required:\n - billing\n - shipping\n properties:\n billing:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n shipping:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n responses:\n 200:\n description: 'Updated user profile'\n 404:\n description: 'User not found'\n /users/password/recover:\n post:\n tags:\n - Users\n parameters:\n -\n name: email\n required: true\n description: 'the user''s email'\n in: body\n schema:\n type: object\n required:\n - email\n properties:\n email:\n type: string\n responses:\n 204:\n description: 'An email is sent to the user with a link to change its password'\n /mailinglists:\n get:\n tags:\n - MailingLists\n description: 'Get mailinglists'\n responses:\n 200:\n description: 'An array of mailing lists'\n schema:\n type: array\n items:\n $ref: '#/definitions/MailingList'\n '/mailinglists/{mailingListId}/subscriptions/{mailingListEmail}':\n parameters:\n -\n $ref: '#/parameters/mailingListId'\n -\n $ref: '#/parameters/mailingListEmail'\n post:\n tags:\n - MailingLists\n description: 'Subscribe to the mailing list'\n responses:\n 201:\n description: Subscribed\n delete:\n tags:\n - MailingLists\n description: 'Unsubscribe to the mailing list'\n responses:\n 204:\n description: Unsubscribed\n '/catalog/products/{productId}':\n parameters:\n -\n name: productId\n in: path\n required: true\n $ref: '#/parameters/productId'\n get:\n tags:\n - Catalog\n description: 'Get catalog information about a product.'\n responses:\n 200:\n description: 'The desired product object'\n schema:\n $ref: '#/definitions/Product'\n 404:\n description: 'Product not found'\n /catalog/products:\n parameters:\n -\n name: code\n in: query\n description: 'The product code (EAN or similar)'\n required: false\n type: string\n -\n name: supplierRef\n in: query\n description: 'The product supplier reference'\n required: false\n type: string\n get:\n tags:\n - Catalog\n description: 'Get products by productCode or supplierRef'\n responses:\n 200:\n description: 'An array of products'\n schema:\n type: array\n items:\n $ref: '#/definitions/Product'\n /catalog/search/products:\n parameters:\n -\n name: query\n in: query\n type: string\n description: 'Query terms'\n -\n name: page\n in: query\n type: integer\n description: 'Page to return (starts at 1)'\n default: 1\n -\n name: resultsPerPage\n in: query\n type: integer\n description: 'Number of results per page'\n -\n name: sorting\n in: query\n type: array\n description: 'Key-value map of sorting codes mapped to the order (ASC/DESC)'\n items:\n type: string\n collectionFormat: multi\n -\n name: filters\n in: query\n type: array\n description: 'Key-value map of fields to filter mapped to their value'\n items:\n type: string\n -\n name: 'geo[lat]'\n in: query\n type: number\n description: Latitude\n -\n name: 'geo[lng]'\n in: query\n type: number\n description: Longitude\n -\n name: 'geo[radius]'\n in: query\n type: integer\n description: 'Radius from lat-lng in meters'\n get:\n tags:\n - Catalog\n description: 'Search for products'\n responses:\n 200:\n description: 'Search results'\n schema:\n $ref: '#/definitions/ProductSearchResult'\n 400:\n description: 'Invalid sorting criteria'\n '/catalog/products/{productId}/reviews':\n parameters:\n -\n $ref: '#/parameters/productId'\n get:\n tags:\n - Catalog\n description: 'Get product reviews.'\n responses:\n 200:\n description: 'List of reviews for a product'\n schema:\n type: array\n items:\n $ref: '#/definitions/ProductReview'\n 404:\n description: 'Product not found'\n post:\n tags:\n - Catalog\n description: 'Post a review about a product'\n parameters:\n -\n name: review\n required: true\n description: 'A review'\n in: body\n schema:\n type: object\n required:\n - author\n properties:\n author:\n type: string\n rating:\n type: integer\n description: 'Should be >=1 and <=5'\n message:\n type: string\n responses:\n 204:\n description: 'Review created'\n 404:\n description: 'Product not found'\n 400:\n description: 'Bad request: probably rating or message missing (at least one is required)'\n /catalog/companies:\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of companies'\n responses:\n 200:\n description: 'An array of companies'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogCompany'\n '/catalog/companies/{companyId}':\n parameters:\n -\n $ref: '#/parameters/companyId'\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of a company'\n responses:\n 200:\n description: 'The company object'\n schema:\n $ref: '#/definitions/CatalogCompany'\n 404:\n description: 'Company not found'\n '/companies/{companyId}/reviews':\n parameters:\n -\n $ref: '#/parameters/companyId'\n get:\n tags:\n - Catalog\n description: 'List all reviews for a company'\n responses:\n 200:\n description: 'List of reviews for a company'\n schema:\n type: object\n properties:\n averageRating:\n type: integer\n _embedded:\n type: array\n items:\n $ref: '#/definitions/Review'\n 404:\n description: 'The company does not exist'\n post:\n tags:\n - Catalog\n description: 'Review a company'\n parameters:\n -\n name: review\n required: true\n description: 'The data for the review'\n in: body\n schema:\n type: object\n required:\n - message\n - rating\n properties:\n message:\n type: string\n rating:\n type: integer\n responses:\n 201:\n description: 'Review created'\n schema:\n $ref: '#/definitions/Review'\n 404:\n description: 'Company not found'\n 401:\n description: 'Invalid credential : you must be logged'\n 400:\n description: 'Invalid argument : see error message in the body'\n /catalog/categories:\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of categories'\n responses:\n 200:\n description: 'An array of categories'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogCategory'\n '/catalog/categories/{categoryId}':\n parameters:\n -\n $ref: '#/parameters/categoryId'\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of a category'\n responses:\n 200:\n description: 'The category object'\n schema:\n $ref: '#/definitions/CatalogCategory'\n 404:\n description: 'Category not found'\n /catalog/categories/tree:\n get:\n tags:\n - Catalog\n description: 'Get the tree view of categories'\n responses:\n 200:\n description: 'An array of categories, with a tree structure'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogCategoryTreeBranch'\n /catalog/attributes:\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of attributes'\n responses:\n 200:\n description: 'An array of attributes'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogAttribute'\n '/catalog/attributes/{attributeId}':\n parameters:\n -\n $ref: '#/parameters/attributeId'\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of an attribute'\n responses:\n 200:\n description: 'The attribute object'\n schema:\n $ref: '#/definitions/CatalogAttribute'\n 404:\n description: 'Attribute not found'\ndefinitions:\n Menus:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/MenuItem'\n required:\n - id\n - name\n - items\n MenuItem:\n type: object\n properties:\n name:\n type: string\n position:\n type: integer\n url:\n type: string\n required:\n - name\n - position\n Banner:\n type: object\n properties:\n link:\n type: string\n format: uri\n shouldOpenInNewWindow:\n type: boolean\n image:\n $ref: '#/definitions/Image'\n required:\n - image\n Image:\n type: object\n properties:\n id:\n type: integer\n required:\n - id\n Order:\n type: object\n properties:\n id:\n type: integer\n companyId:\n type: integer\n total:\n type: number\n subtotal:\n type: number\n timestamp:\n type: integer\n format: timestamp\n status:\n type: string\n enum:\n - STANDBY_BILLING\n - STANDBY_VENDOR\n - PROCESSING_SHIPPING\n - PROCESSED\n - COMPLETED\n - BILLING_FAILED\n - VENDOR_DECLINED\n - STANDBY_SUPPLYING\n - UNPAID\n - REFUNDED\n - CANCELED\n - INCOMPLETED\n - PARENT_ORDER\n shippingName:\n type: string\n shippingAddress:\n $ref: '#/definitions/OrderAddress'\n billingAddress:\n $ref: '#/definitions/OrderAddress'\n items:\n type: array\n items:\n $ref: '#/definitions/OrderItem'\n required:\n - id\n - companyId\n - total\n - subtotal\n - timestamp\n - status\n - shippingName\n OrderItem:\n type: object\n properties:\n declinationId:\n type: string\n productName:\n type: string\n productCode:\n type: string\n price:\n type: number\n amount:\n type: integer\n required:\n - declinationId\n - productName\n - productCode\n - price\n - amount\n OrderReturn:\n type: object\n properties:\n orderId:\n type: int\n userId:\n type: int\n createdAt:\n type: dateTime\n comments:\n type: string\n status:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/OrderItem'\n ReturnItem:\n type: object\n properties:\n declinationId:\n type: string\n product:\n type: string\n price:\n type: float\n reason:\n type: int\n amount:\n type: int\n required:\n - declinationId\n - reason\n - amount\n OrderAddress:\n type: object\n properties:\n firstname:\n type: string\n lastname:\n type: string\n address:\n type: string\n address2:\n type: string\n city:\n type: string\n zipcode:\n type: string\n country:\n type: string\n required:\n - firstname\n - lastname\n - address\n - address2\n - city\n - zipcode\n - country\n MultiVendorProduct:\n type: object\n properties:\n id:\n type: string\n name:\n type: string\n code:\n type: string\n supplierReference:\n type: string\n slug:\n type: string\n shortDescription:\n type: string\n description:\n type: string\n status:\n type: string\n enum:\n - A\n - D\n - H\n category:\n $ref: '#/definitions/CategorySummary'\n categoryId:\n type: integer\n imageIds:\n type: array\n items:\n type: integer\n attributes:\n type: object\n description: 'Key : attribute id - Value : attribute value'\n properties:\n id:\n type: integer\n MultiVendorProductLink:\n type: object\n properties:\n id:\n type: integer\n multiVendorProductId:\n type: string\n productId:\n type: integer\n required:\n - multiVendorProductId\n - productId\n Category:\n type: object\n properties:\n category:\n type: string\n category_id:\n type: integer\n status:\n type: string\n enum:\n - A\n - D\n - H\n parent_id:\n type: integer\n is_fillable:\n type: boolean\n CategorySummary:\n type: object\n properties:\n name:\n type: string\n id:\n type: integer\n SlugTarget:\n type: object\n properties:\n type:\n type: string\n enum:\n - product\n - category\n - attribute_variant\n - company\n - cms_page\n description: 'Type of the object the slug is pointing to.'\n id:\n type: integer\n description: 'ID of the object the slug is pointing to (for example product ID, category ID, etc.).'\n required:\n - type\n - name\n DeclinationId:\n type: string\n Basket:\n type: object\n properties:\n id:\n type: string\n coupons:\n type: array\n items:\n type: string\n description: 'List of coupons applied to the basket.'\n companyGroups:\n type: array\n items:\n $ref: '#/definitions/BasketCompanyGroup'\n description: 'Items are grouped by companies.'\n subtotal:\n type: number\n description: 'Total of all item prices, tax and discounts included but shipping excluded.'\n totalDiscount:\n type: number\n description: 'Total of all discounts applied to the basket.'\n totalShipping:\n type: number\n description: 'Total of all shippings, tax included.'\n totalTax:\n type: number\n description: 'Tax total for the whole basket.'\n total:\n type: number\n description: 'Total of the basket, tax included.'\n totalQuantity:\n type: integer\n description: 'Total number of items in the basket.'\n BasketCompanyGroup:\n type: object\n properties:\n id:\n type: string\n company:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n shippingGroups:\n type: array\n items:\n $ref: '#/definitions/BasketShippingGroup'\n BasketShippingGroup:\n type: object\n properties:\n id:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/BasketItem'\n shippings:\n type: array\n items:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n price:\n type: number\n deliveryTime:\n type: string\n selected:\n type: boolean\n BasketItem:\n type: object\n properties:\n declinationId:\n type: string\n productId:\n type: integer\n productName:\n type: string\n productUrl:\n type: string\n individualPrice:\n type: number\n crossedOutPrice:\n type: number\n mainImage:\n $ref: '#/definitions/Image'\n quantity:\n type: integer\n total:\n type: number\n Payment:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n description:\n type: string\n position:\n type: number\n image:\n $ref: '#/definitions/Image'\n required:\n - id\n - name\n - description\n - position\n User:\n type: object\n properties:\n id:\n type: integer\n email:\n type: string\n format: email\n description: 'Must be unique.'\n firstName:\n type: string\n lastName:\n type: string\n addresses:\n type: object\n properties:\n billing:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n shipping:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n required:\n - id\n - email\n MailingList:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n required:\n - id\n - name\n Product:\n type: object\n properties:\n id:\n type: integer\n code:\n type: string\n supplierReference:\n type: string\n name:\n type: string\n url:\n type: string\n format: uri\n shortDescription:\n type: string\n description:\n type: string\n slug:\n type: string\n minPrice:\n type: number\n greenTax:\n type: number\n attributes:\n type: array\n items:\n $ref: '#/definitions/ProductAttribute'\n isTransactional:\n type: boolean\n shippings:\n type: array\n items:\n $ref: '#/definitions/Shipping'\n companies:\n type: array\n items:\n $ref: '#/definitions/ProductCompany'\n categoryPath:\n type: array\n items:\n $ref: '#/definitions/ProductCategory'\n declinations:\n type: array\n minItems: 1\n items:\n $ref: '#/definitions/Declination'\n required:\n - id\n - name\n - url\n - minPrice\n - isTransactional\n - declinations\n ProductSummary:\n type: object\n properties:\n productId:\n type: integer\n name:\n type: string\n subtitle:\n type: string\n minimumPrice:\n type: number\n crossedOutPrice:\n type: number\n isAvailable:\n type: boolean\n url:\n type: string\n format: uri\n createdAt:\n type: string\n description: Timestamp\n updatedAt:\n type: string\n description: Timestamp\n declinationCount:\n type: number\n affiliateLink:\n type: string\n mainImage:\n $ref: '#/definitions/Image'\n averageRating:\n type: number\n conditions:\n type: array\n items:\n type: string\n attributes:\n type: array\n items:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n slug:\n type: string\n categoryPath:\n type: array\n items:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n slug:\n type: string\n ProductReview:\n type: object\n properties:\n author:\n type: string\n description: 'Displayed name in review'\n message:\n type: string\n postedAt:\n type: integer\n description: timestamp\n rating:\n type: integer\n ProductAttribute:\n type: object\n properties:\n name:\n type: string\n value:\n type: array\n minItems: 1\n items:\n type: string\n children:\n type: array\n items:\n $ref: '#/definitions/ProductAttribute'\n subfeatures:\n description: 'DEPRECATED, use children instead'\n type: array\n items:\n $ref: '#/definitions/ProductAttribute'\n imageUrls:\n type: array\n items:\n type: string\n format: uri\n required:\n - name\n - value\n Shipping:\n type: object\n properties:\n name:\n type: string\n image:\n type: string\n firstRate:\n type: number\n nextRate:\n type: number\n required:\n - name\n - firstRate\n ProductCompany:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n required:\n - id\n - name\n ProductCategory:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n slug:\n type: string\n required:\n - id\n - name\n - slug\n Declination:\n type: object\n properties:\n code:\n type: string\n supplierReference:\n type: string\n price:\n type: number\n originalPrice:\n type: number\n crossedOutPrice:\n type: number\n greenTax:\n type: numeric\n amount:\n type: integer\n affiliateLink:\n type: string\n format: uri\n images:\n type: array\n items:\n $ref: '#/definitions/Image'\n required:\n - price\n - originalPrice\n - amount\n CatalogProductPrices:\n type: object\n properties:\n priceWithoutVat:\n type: number\n priceWithTaxes:\n type: number\n vat:\n type: number\n CatalogCompany:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n description:\n type: string\n description: 'Company description, can contain HTML.'\n professional:\n type: boolean\n description: 'Whether the company is a professional company (B2C/B2B) or a private individual (C2C).'\n slug:\n type: string\n required:\n - id\n - name\n - description\n - professional\n CatalogCategory:\n type: object\n properties:\n id:\n type: integer\n parentId:\n type: integer\n name:\n type: string\n description:\n type: string\n slug:\n type: string\n image:\n $ref: '#/definitions/Image'\n position:\n type: integer\n productCount:\n type: integer\n required:\n - id\n - parentId\n - name\n - description\n - slug\n - position\n - productCount\n CatalogCategoryTreeBranch:\n type: object\n properties:\n category:\n $ref: '#/definitions/CatalogCategory'\n children:\n type: array\n items:\n $ref: '#/definitions/CatalogCategoryTreeBranch'\n required:\n - category\n CatalogAttribute:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n type:\n type: string\n enum:\n - CHECKBOX_UNIQUE\n - CHECKBOX_MULTIPLE\n - LIST_TEXT\n - LIST_NUMBER\n - LIST_BRAND\n - FREE_TEXT\n - FREE_NUMBER\n - FREE_DATE\n - GROUP\n position:\n type: integer\n parentId:\n type: integer\n categories:\n type: array\n items:\n type: integer\n required:\n - id\n - name\n - type\n - position\n - categories\n Pagination:\n type: object\n properties:\n page:\n type: integer\n description: 'Current page number'\n nbResults:\n type: integer\n description: 'Total number of results'\n nbPages:\n type: integer\n description: 'Total number of pages'\n resultsPerPage:\n type: integer\n description: 'Number of results per pages'\n required:\n - page\n - nbResults\n - nbPages\n - resultsPerPage\n Facet:\n type: object\n properties:\n name:\n type: string\n label:\n type: string\n isNumeric:\n type: boolean\n values:\n type: object\n ProductSearchResult:\n type: object\n properties:\n results:\n type: array\n items:\n $ref: '#/definitions/ProductSummary'\n pagination:\n $ref: '#/definitions/Pagination'\n facets:\n type: array\n items:\n $ref: '#/definitions/Facet'\n Review:\n type: object\n properties:\n message:\n type: string\n rating:\n type: integer\n user: '$ref:''#/definitions/User'''\n createdAt:\n type: integer\n description: timestamp\n required:\n - message\n - rating\n" + body: "swagger: '2.0'\ninfo:\n version: v1\n title: 'Wizaplace API'\n description: \"**This is the documentation of the API of your marketplace.**\\n\\nSome API endpoints require to be authenticated. For that you will need to provide a\\n`Authorization` header with a valid API key:\\n\\n```\\nAuthorization: token your_api_key_here\\n```\\n\\nTo get the API key the first time, you can use the `/users/authenticate` endpoint. This\\nendpoint requires a HTTP basic authentication with a user's email and password. The\\nresponse will contain the API key to use for that user.\\n\"\nbasePath: /api/v1\nschemes:\n - https\nproduces:\n - application/json\ntags:\n -\n name: Favorites\n description: on-demand\n -\n name: CMS\n -\n name: Images\n -\n name: Orders\n -\n name: PIM\n -\n name: SEO\n -\n name: Basket\n -\n name: Users\n -\n name: MailingLists\n -\n name: Catalog\nsecurityDefinitions:\n basicAuth:\n type: basic\n description: 'HTTP Basic Authentication, with email and password'\n apiKey:\n type: apiKey\n in: header\n name: Authorization\n description: 'Example: `Authorization: token your_api_key_here`'\nparameters:\n productId:\n name: productId\n in: path\n description: 'The product identifier number'\n type: integer\n required: true\n declinationId:\n name: declinationId\n in: path\n description: 'The declination identifier number'\n type: string\n required: true\n companyId:\n name: companyId\n in: path\n description: 'The company identifier number'\n type: integer\n required: true\n attributeId:\n name: attributeId\n in: path\n description: 'The attribute identifier number'\n type: integer\n required: true\n categoryId:\n name: categoryId\n in: path\n description: 'The category identifier number'\n type: integer\n required: true\n orderId:\n name: orderId\n in: path\n description: 'The order identifier number'\n type: integer\n required: true\n returnId:\n name: returnId\n in: path\n description: 'The return identifier number'\n type: integer\n required: true\n imageId:\n name: imageId\n in: path\n description: 'The image Id'\n type: integer\n required: true\n multiVendorProductId:\n name: multiVendorProductId\n in: path\n description: 'Multi vendor product identifier'\n type: string\n format: uuid\n required: true\n basketId:\n name: basketId\n in: path\n description: 'Basket identifier'\n type: string\n format: uuid\n required: true\n coupon:\n name: coupon\n in: path\n description: 'Coupon code'\n type: string\n required: true\n userId:\n name: userId\n in: path\n description: 'The user identifier'\n type: integer\n required: true\n mailingListId:\n name: mailingListId\n in: path\n description: 'The mailing list identifier number'\n type: integer\n required: true\n mailingListEmail:\n name: mailingListEmail\n in: path\n description: 'The email address to (un)subscribe to the mailing list'\n type: string\n format: email\n required: true\npaths:\n /favorites/declinations:\n get:\n tags:\n - Favorites\n security:\n -\n apiKey: { }\n description: 'List all declinations defined as favorite'\n responses:\n 200:\n description: 'List of favorites'\n schema:\n type: array\n items:\n $ref: '#/definitions/DeclinationId'\n '/favorites/declinations/{declinationId}':\n parameters:\n -\n $ref: '#/parameters/declinationId'\n put:\n tags:\n - Favorites\n security:\n -\n apiKey: { }\n description: 'Add a product to favorites'\n responses:\n 201:\n description: 'Product has been add'\n 409:\n description: 'Product already is a favorite'\n 400:\n description: 'The id is not valid'\n delete:\n tags:\n - Favorites\n security:\n -\n apiKey: { }\n description: 'Remove a product from favorites'\n responses:\n 204:\n description: 'Product has been removed'\n /cms/menus:\n get:\n tags:\n - CMS\n description: 'Get all menus with associated items'\n responses:\n 200:\n description: 'An array of menus'\n schema:\n type: array\n items:\n $ref: '#/definitions/Menus'\n /cms/banners:\n parameters:\n -\n name: device\n type: string\n in: query\n required: false\n enum:\n - mobile\n - desktop\n description: 'If provided, value must be ''mobile'' or ''desktop''. If not provided, the device criteria is ignored.'\n get:\n tags:\n - CMS\n description: 'Get homepage banners'\n responses:\n 200:\n description: 'An array of banners'\n schema:\n type: array\n items:\n $ref: '#/definitions/Banner'\n '/cms/banners/category/{categoryId}':\n parameters:\n -\n $ref: '#/parameters/categoryId'\n -\n name: device\n type: string\n in: query\n required: false\n enum:\n - mobile\n - desktop\n description: 'If provided, value must be ''mobile'' or ''desktop''. If not provided, the device criteria is ignored.'\n get:\n tags:\n - CMS\n description: 'Get category banners'\n responses:\n 200:\n description: 'An array of banners'\n schema:\n type: array\n items:\n $ref: '#/definitions/Banner'\n '/image/{imageId}':\n parameters:\n -\n $ref: '#/parameters/imageId'\n get:\n tags:\n - Images\n description: 'Get an image by Id'\n responses:\n 302:\n description: 'The image url is in the HTTP Location header'\n 404:\n description: 'The image doesn''t exist'\n /user/orders:\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get orders'\n responses:\n 200:\n description: 'An array of orders'\n schema:\n type: array\n items:\n $ref: '#/definitions/Order'\n '/user/orders/{orderId}':\n parameters:\n -\n $ref: '#/parameters/orderId'\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get an order'\n responses:\n 200:\n description: 'The order object'\n schema:\n $ref: '#/definitions/Order'\n 404:\n description: 'Order not found'\n /user/orders/returns:\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get the list of returns'\n responses:\n 200:\n description: 'List of returns'\n schema:\n type: array\n items:\n $ref: '#/definitions/OrderReturn'\n '/user/orders/returns/{returnId}':\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get one return'\n parameters:\n -\n $ref: '#/parameters/returnId'\n responses:\n 200:\n description: 'Return data'\n schema:\n $ref: '#/definitions/OrderReturn'\n /orders/returns/reasons:\n get:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Get list of return reasons'\n responses:\n 200:\n description: 'List of reasons'\n schema:\n type: array\n items:\n type: object\n properties:\n id:\n type: int\n name:\n type: string\n '/user/orders/{orderId}/returns':\n post:\n tags:\n - Orders\n security:\n -\n apiKey: { }\n description: 'Create a return'\n parameters:\n -\n $ref: '#/parameters/orderId'\n -\n name: createReturn\n required: true\n description: 'Create a return'\n in: body\n schema:\n type: object\n required:\n - comments\n - items\n properties:\n returnTypeId:\n type: int\n comments:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/ReturnItem'\n responses:\n 201:\n description: 'The return id'\n schema:\n $ref: '#/definitions/Order'\n 404:\n description: 'Order not found'\n /pim/multi-vendor-products:\n get:\n parameters:\n -\n name: page\n in: query\n type: integer\n description: 'Page to return (starts at 1)'\n default: 1\n -\n name: resultsPerPage\n in: query\n type: integer\n description: 'Number of results per page'\n default: 50\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'List all multi vendor products (this feature is only available on-demand)'\n responses:\n 200:\n description: 'List of multi vendor products'\n schema:\n type: object\n properties:\n total:\n type: integer\n count:\n type: integer\n _embedded:\n type: array\n items:\n $ref: '#/definitions/MultiVendorProduct'\n post:\n tags:\n - PIM\n description: 'Create a new multi vendor product (this feature is only available on-demand)'\n parameters:\n -\n name: 'multi vendor products'\n required: true\n description: 'The data for the multi vendor product'\n in: body\n schema:\n type: object\n required:\n - name\n - categoryId\n properties:\n name:\n type: string\n code:\n type: string\n supplierReference:\n type: string\n slug:\n type: string\n shortDescription:\n type: string\n description:\n type: string\n status:\n type: string\n categoryId:\n type: integer\n responses:\n 201:\n description: 'Multi vendor products created'\n schema:\n $ref: '#/definitions/MultiVendorProduct'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n '/pim/multi-vendor-products/{multiVendorProductId}':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Retrieve a multi vendor product (this feature is only available on-demand)'\n responses:\n 200:\n description: 'Multi vendor product retrieved'\n schema:\n $ref: '#/definitions/MultiVendorProduct'\n 404:\n description: 'Multi vendor product not found'\n put:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Update a multi vendor product (this feature is only available on-demand)'\n responses:\n 201:\n description: 'Multi vendor product added'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n delete:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Remove a multi vendor product (this feature is only available on-demand)'\n responses:\n 204:\n description: 'Multi vendor product removed'\n 404:\n description: 'Multi vendor product not found'\n '/pim/multi-vendor-products/{multiVendorProductId}/links':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'List all links between MVP and product (this feature is only available on-demand)'\n responses:\n 200:\n description: 'List of links between MVP and product'\n schema:\n type: array\n items:\n $ref: '#/definitions/MultiVendorProductLink'\n post:\n tags:\n - PIM\n description: 'Create a new link between a MVP and a product (this feature is only available on-demand)'\n parameters:\n -\n name: link\n required: true\n description: 'The data for the link'\n in: body\n schema:\n type: object\n required:\n - multiVendorProductId\n - productId\n properties:\n multiVendorProductId:\n type: string\n productId:\n type: integer\n responses:\n 201:\n description: 'Product are linked to MVP (this feature is only available on-demand)'\n schema:\n $ref: '#/definitions/MultiVendorProductLink'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n '/pim/multi-vendor-products/{multiVendorProductId}/links/{productId}':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n -\n $ref: '#/parameters/productId'\n delete:\n tags:\n - PIM\n description: 'Detach a product from a MVP (this feature is only available on-demand)'\n responses:\n 204:\n description: 'Product is detached from MVP'\n 404:\n description: 'Link not found'\n '/pim/multi-vendor-products/{multiVendorProductId}/images':\n parameters:\n -\n $ref: '#/parameters/multiVendorProductId'\n post:\n tags:\n - PIM\n description: 'Upload and associate an image to an MVP. The request should be in multipart.'\n parameters:\n -\n name: file\n required: true\n description: 'image file'\n in: formData\n type: file\n format: file\n responses:\n 200:\n description: 'Image is uploaded and associated'\n schema:\n $ref: '#/definitions/MultiVendorProduct'\n 404:\n description: 'Multi vendor product not found'\n 400:\n description: 'Invalid argument : see error message in the body'\n /categories:\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'List all categories'\n parameters:\n -\n name: leaves\n in: query\n description: 'Retrieve only leaves'\n type: boolean\n required: false\n -\n name: category_ids\n in: query\n description: 'Retrieve only categories matching specified ids'\n type: array\n items:\n type: integer\n required: false\n responses:\n 200:\n description: 'List of multi categories'\n schema:\n type: array\n items:\n $ref: '#/definitions/Category'\n '/categories/{categoryId}':\n parameters:\n -\n $ref: '#/parameters/categoryId'\n get:\n tags:\n - PIM\n security:\n -\n apiKey: { }\n description: 'Retrieve a specific category by Id'\n responses:\n 200:\n description: Category\n schema:\n $ref: '#/definitions/Category'\n 404:\n description: 'Category does not exist'\n /seo/slugs:\n parameters:\n -\n name: slugs\n type: array\n in: query\n required: true\n description: 'List of slugs to resolve. You can provide it in the query string as an array, for example ''?slugs[]=iphone&slugs[]=mobile'''\n get:\n tags:\n - SEO\n description: 'Each slug is unique in the system and points to a single ''object'' (called a target). This API endpoint resolves each slug provided and returns the targets to which they point. If a slug is not found (it is unknown), it will not be returned in the response.'\n responses:\n 200:\n description: 'The response is a JSON object where keys are slugs and values are the (resolved) target of the slug.'\n schema:\n type: object\n additionalProperties:\n $ref: '#/definitions/SlugTarget'\n /basket:\n post:\n tags:\n - Basket\n description: 'Create a new basket and returns its ID.'\n responses:\n 201:\n description: 'The ID returned is a UUID, for example: `3f79d867-f325-47a6-9e82-2ba6b9cade14`.'\n '/basket/{basketId}':\n parameters:\n -\n $ref: '#/parameters/basketId'\n get:\n tags:\n - Basket\n description: 'Get a basket by its ID.'\n responses:\n 200:\n description: 'The basket object.'\n schema:\n $ref: '#/definitions/Basket'\n 404:\n description: 'The basket doesn''t exist.'\n '/basket/{basketId}/coupons/{coupon}':\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n $ref: '#/parameters/coupon'\n post:\n tags:\n - Basket\n description: 'Add a coupon code to the basket'\n responses:\n 204:\n description: 'The coupon code has been added.'\n 409:\n description: 'The coupon code is already added.'\n delete:\n tags:\n - Basket\n description: 'Remove a coupon code from the basket'\n responses:\n 204:\n description: 'The coupon code has been removed.'\n 404:\n description: 'The coupon code is not in the basket.'\n '/basket/{basketId}/payments':\n parameters:\n -\n $ref: '#/parameters/basketId'\n get:\n tags:\n - Basket\n description: 'Get available payments on this basket'\n responses:\n 200:\n description: 'A list of payments.'\n schema:\n type: array\n items:\n $ref: '#/definitions/Payment'\n 404:\n description: 'The basket doesn''t exist.'\n '/basket/{basketId}/add':\n post:\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: addBasket\n required: true\n description: 'Add an item in basket'\n in: body\n schema:\n type: object\n required:\n - declinationId\n - quantity\n properties:\n declinationId:\n type: string\n quantity:\n type: integer\n description: 'should be > 0'\n tags:\n - Basket\n description: 'Add an item in basket'\n responses:\n 200:\n description: 'Product added'\n schema:\n properties:\n quantity:\n type: integer\n description: 'Quantity of product in basket.'\n 404:\n description: 'Basket not found'\n 400:\n description: 'Some parameters are not correct'\n '/basket/{basketId}/remove':\n post:\n tags:\n - Basket\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: declinationId\n required: true\n description: 'Item to remove'\n in: body\n schema:\n $ref: '#/definitions/DeclinationId'\n responses:\n 204:\n description: 'item is removed from basket'\n 400:\n description: 'declination id is missing'\n 404:\n description: 'the basket is not found'\n '/basket/{basketId}/modify':\n post:\n tags:\n - Basket\n description: 'Change quantity of a product in the basket'\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: editQuantity\n required: true\n description: 'Item and the new quantity'\n in: body\n schema:\n type: object\n required:\n - declinationId\n - quantity\n properties:\n declinationId:\n type: string\n quantity:\n type: integer\n description: 'should be > 0'\n responses:\n 404:\n description: 'Basket not found'\n 400:\n description: 'Some parameters are not correct'\n 200:\n description: 'Quantity has been modified'\n schema:\n properties:\n quantity:\n type: integer\n description: 'New quantity of item in basket.'\n '/basket/{basketId}/order':\n post:\n tags:\n - Basket\n description: 'Checkout: turn the basket into an order (or several orders)'\n security:\n -\n apiKey: { }\n parameters:\n -\n $ref: '#/parameters/basketId'\n -\n name: checkout\n in: body\n schema:\n type: object\n required:\n - acceptTermsAndConditions\n properties:\n acceptTermsAndConditions:\n type: boolean\n description: 'Whether the customer accepts the terms and conditions'\n paymentId:\n type: integer\n description: 'ID of the payment to use for paying the order'\n responses:\n 404:\n description: 'Basket not found'\n 400:\n description: 'Some parameters are not correct'\n 200:\n description: 'The orders have been created, the customer now needs to proceed to the payment (either through the redirectUrl or through the returned HTML page)'\n schema:\n properties:\n orders:\n type: array\n description: 'List of orders'\n items:\n type: object\n properties:\n id:\n type: integer\n required:\n - id\n redirectUrl:\n type: string\n description: 'If present, the customer must be redirected to this URL to proceed to the payment'\n html:\n type: string\n description: 'If present, the HTML must be rendered as a web page to the customer to proceed to the payment'\n required:\n - orders\n /users/authenticate:\n get:\n tags:\n - Users\n security:\n -\n basicAuth: { }\n description: 'Get an Api key with email/password'\n responses:\n 200:\n description: 'You are authenticated, here is your Api key'\n schema:\n properties:\n id:\n type: integer\n apiKey:\n type: string\n 401:\n description: 'Bad credentials'\n '/users/{userId}':\n parameters:\n -\n $ref: '#/parameters/userId'\n get:\n tags:\n - Users\n security:\n -\n apiKey: { }\n description: 'Get a user profile'\n responses:\n 200:\n description: 'User profile'\n schema:\n $ref: '#/definitions/User'\n 404:\n description: 'User not found'\n put:\n tags:\n - Users\n description: 'Update a user profile'\n security:\n -\n apiKey: { }\n parameters:\n -\n name: user\n required: true\n description: 'The new data for the user'\n in: body\n schema:\n type: object\n required:\n - email\n - firstName\n - lastName\n properties:\n email:\n type: string\n firstName:\n type: string\n lastName:\n type: string\n responses:\n 200:\n description: 'Updated user profile'\n schema:\n $ref: '#/definitions/User'\n 404:\n description: 'User not found'\n '/users/{userId}/password':\n parameters:\n -\n $ref: '#/parameters/userId'\n put:\n tags:\n - Users\n description: 'Change user password'\n security:\n -\n apiKey: { }\n parameters:\n -\n name: user\n required: true\n description: 'The new password for the user.'\n in: body\n schema:\n type: object\n required:\n - password\n properties:\n password:\n type: string\n responses:\n 204:\n description: 'Password was updated'\n 400:\n description: 'Some parameters are not correct'\n 404:\n description: 'User not found'\n /users:\n post:\n tags:\n - Users\n description: 'Create a new user'\n parameters:\n -\n name: user\n required: true\n description: 'The data for the user'\n in: body\n schema:\n type: object\n required:\n - email\n - password\n properties:\n email:\n type: string\n password:\n type: string\n firstName:\n type: string\n lastName:\n type: string\n responses:\n 201:\n description: 'User created'\n schema:\n $ref: '#/definitions/User'\n 409:\n description: 'User already exists'\n 400:\n description: 'Some parameters are not correct'\n '/users/{userId}/addresses':\n parameters:\n -\n $ref: '#/parameters/userId'\n put:\n tags:\n - Users\n description: 'Update a user''s addresses'\n security:\n -\n apiKey: { }\n parameters:\n -\n name: addresses\n required: true\n description: 'The new addresses'\n in: body\n schema:\n type: object\n required:\n - billing\n - shipping\n properties:\n billing:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n shipping:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n responses:\n 200:\n description: 'Updated user profile'\n 404:\n description: 'User not found'\n /users/password/recover:\n post:\n tags:\n - Users\n parameters:\n -\n name: email\n required: true\n description: 'the user''s email'\n in: body\n schema:\n type: object\n required:\n - email\n properties:\n email:\n type: string\n responses:\n 204:\n description: 'An email is sent to the user with a link to change its password'\n /mailinglists:\n get:\n tags:\n - MailingLists\n description: 'Get mailinglists'\n responses:\n 200:\n description: 'An array of mailing lists'\n schema:\n type: array\n items:\n $ref: '#/definitions/MailingList'\n '/mailinglists/{mailingListId}/subscriptions/{mailingListEmail}':\n parameters:\n -\n $ref: '#/parameters/mailingListId'\n -\n $ref: '#/parameters/mailingListEmail'\n post:\n tags:\n - MailingLists\n description: 'Subscribe to the mailing list'\n responses:\n 201:\n description: Subscribed\n delete:\n tags:\n - MailingLists\n description: 'Unsubscribe to the mailing list'\n responses:\n 204:\n description: Unsubscribed\n '/catalog/products/{productId}':\n parameters:\n -\n name: productId\n in: path\n required: true\n $ref: '#/parameters/productId'\n get:\n tags:\n - Catalog\n description: 'Get catalog information about a product.'\n responses:\n 200:\n description: 'The desired product object'\n schema:\n $ref: '#/definitions/Product'\n 404:\n description: 'Product not found'\n /catalog/products:\n parameters:\n -\n name: code\n in: query\n description: 'The product code (EAN or similar)'\n required: false\n type: string\n -\n name: supplierRef\n in: query\n description: 'The product supplier reference'\n required: false\n type: string\n get:\n tags:\n - Catalog\n description: 'Get products by productCode or supplierRef'\n responses:\n 200:\n description: 'An array of products'\n schema:\n type: array\n items:\n $ref: '#/definitions/Product'\n /catalog/search/products:\n parameters:\n -\n name: query\n in: query\n type: string\n description: 'Query terms'\n -\n name: page\n in: query\n type: integer\n description: 'Page to return (starts at 1)'\n default: 1\n -\n name: resultsPerPage\n in: query\n type: integer\n description: 'Number of results per page'\n -\n name: sorting\n in: query\n type: array\n description: 'Key-value map of sorting codes mapped to the order (ASC/DESC)'\n items:\n type: string\n collectionFormat: multi\n -\n name: filters\n in: query\n type: array\n description: 'Key-value map of fields to filter mapped to their value'\n items:\n type: string\n -\n name: 'geo[lat]'\n in: query\n type: number\n description: Latitude\n -\n name: 'geo[lng]'\n in: query\n type: number\n description: Longitude\n -\n name: 'geo[radius]'\n in: query\n type: integer\n description: 'Radius from lat-lng in meters'\n get:\n tags:\n - Catalog\n description: 'Search for products'\n responses:\n 200:\n description: 'Search results'\n schema:\n $ref: '#/definitions/ProductSearchResult'\n 400:\n description: 'Invalid sorting criteria'\n '/catalog/products/{productId}/reviews':\n parameters:\n -\n $ref: '#/parameters/productId'\n get:\n tags:\n - Catalog\n description: 'Get product reviews.'\n responses:\n 200:\n description: 'List of reviews for a product'\n schema:\n type: array\n items:\n $ref: '#/definitions/ProductReview'\n 404:\n description: 'Product not found'\n post:\n tags:\n - Catalog\n description: 'Post a review about a product'\n parameters:\n -\n name: review\n required: true\n description: 'A review'\n in: body\n schema:\n type: object\n required:\n - author\n properties:\n author:\n type: string\n rating:\n type: integer\n description: 'Should be >=1 and <=5'\n message:\n type: string\n responses:\n 204:\n description: 'Review created'\n 404:\n description: 'Product not found'\n 400:\n description: 'Bad request: probably rating or message missing (at least one is required)'\n /catalog/companies:\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of companies'\n responses:\n 200:\n description: 'An array of companies'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogCompany'\n '/catalog/companies/{companyId}':\n parameters:\n -\n $ref: '#/parameters/companyId'\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of a company'\n responses:\n 200:\n description: 'The company object'\n schema:\n $ref: '#/definitions/CatalogCompany'\n 404:\n description: 'Company not found'\n '/companies/{companyId}/reviews':\n parameters:\n -\n $ref: '#/parameters/companyId'\n get:\n tags:\n - Catalog\n description: 'List all reviews for a company'\n responses:\n 200:\n description: 'List of reviews for a company'\n schema:\n type: object\n properties:\n averageRating:\n type: integer\n _embedded:\n type: array\n items:\n $ref: '#/definitions/Review'\n 404:\n description: 'The company does not exist'\n post:\n tags:\n - Catalog\n description: 'Review a company'\n parameters:\n -\n name: review\n required: true\n description: 'The data for the review'\n in: body\n schema:\n type: object\n required:\n - message\n - rating\n properties:\n message:\n type: string\n rating:\n type: integer\n responses:\n 201:\n description: 'Review created'\n schema:\n $ref: '#/definitions/Review'\n 404:\n description: 'Company not found'\n 401:\n description: 'Invalid credential : you must be logged'\n 400:\n description: 'Invalid argument : see error message in the body'\n /catalog/categories:\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of categories'\n responses:\n 200:\n description: 'An array of categories'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogCategory'\n '/catalog/categories/{categoryId}':\n parameters:\n -\n $ref: '#/parameters/categoryId'\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of a category'\n responses:\n 200:\n description: 'The category object'\n schema:\n $ref: '#/definitions/CatalogCategory'\n 404:\n description: 'Category not found'\n /catalog/categories/tree:\n get:\n tags:\n - Catalog\n description: 'Get the tree view of categories'\n responses:\n 200:\n description: 'An array of categories, with a tree structure'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogCategoryTreeBranch'\n /catalog/attributes:\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of attributes'\n responses:\n 200:\n description: 'An array of attributes'\n schema:\n type: array\n items:\n $ref: '#/definitions/CatalogAttribute'\n '/catalog/attributes/{attributeId}':\n parameters:\n -\n $ref: '#/parameters/attributeId'\n get:\n tags:\n - Catalog\n description: 'Get the catalog view of an attribute'\n responses:\n 200:\n description: 'The attribute object'\n schema:\n $ref: '#/definitions/CatalogAttribute'\n 404:\n description: 'Attribute not found'\ndefinitions:\n Menus:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/MenuItem'\n required:\n - id\n - name\n - items\n MenuItem:\n type: object\n properties:\n name:\n type: string\n position:\n type: integer\n url:\n type: string\n required:\n - name\n - position\n Banner:\n type: object\n properties:\n link:\n type: string\n format: uri\n shouldOpenInNewWindow:\n type: boolean\n image:\n $ref: '#/definitions/Image'\n required:\n - image\n Image:\n type: object\n properties:\n id:\n type: integer\n required:\n - id\n Order:\n type: object\n properties:\n id:\n type: integer\n companyId:\n type: integer\n total:\n type: number\n subtotal:\n type: number\n timestamp:\n type: integer\n format: timestamp\n status:\n type: string\n enum:\n - STANDBY_BILLING\n - STANDBY_VENDOR\n - PROCESSING_SHIPPING\n - PROCESSED\n - COMPLETED\n - BILLING_FAILED\n - VENDOR_DECLINED\n - STANDBY_SUPPLYING\n - UNPAID\n - REFUNDED\n - CANCELED\n - INCOMPLETED\n - PARENT_ORDER\n shippingName:\n type: string\n shippingAddress:\n $ref: '#/definitions/OrderAddress'\n billingAddress:\n $ref: '#/definitions/OrderAddress'\n items:\n type: array\n items:\n $ref: '#/definitions/OrderItem'\n required:\n - id\n - companyId\n - total\n - subtotal\n - timestamp\n - status\n - shippingName\n OrderItem:\n type: object\n properties:\n declinationId:\n type: string\n productName:\n type: string\n productCode:\n type: string\n price:\n type: number\n amount:\n type: integer\n required:\n - declinationId\n - productName\n - productCode\n - price\n - amount\n OrderReturn:\n type: object\n properties:\n orderId:\n type: int\n userId:\n type: int\n createdAt:\n type: dateTime\n comments:\n type: string\n status:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/OrderItem'\n ReturnItem:\n type: object\n properties:\n declinationId:\n type: string\n product:\n type: string\n price:\n type: float\n reason:\n type: int\n amount:\n type: int\n required:\n - declinationId\n - reason\n - amount\n OrderAddress:\n type: object\n properties:\n firstname:\n type: string\n lastname:\n type: string\n address:\n type: string\n address2:\n type: string\n city:\n type: string\n zipcode:\n type: string\n country:\n type: string\n required:\n - firstname\n - lastname\n - address\n - address2\n - city\n - zipcode\n - country\n MultiVendorProduct:\n type: object\n properties:\n id:\n type: string\n name:\n type: string\n code:\n type: string\n supplierReference:\n type: string\n slug:\n type: string\n shortDescription:\n type: string\n description:\n type: string\n status:\n type: string\n enum:\n - A\n - D\n - H\n category:\n $ref: '#/definitions/CategorySummary'\n categoryId:\n type: integer\n imageIds:\n type: array\n items:\n type: integer\n attributes:\n type: object\n description: 'Key : attribute id - Value : attribute value'\n properties:\n id:\n type: integer\n MultiVendorProductLink:\n type: object\n properties:\n id:\n type: integer\n multiVendorProductId:\n type: string\n productId:\n type: integer\n required:\n - multiVendorProductId\n - productId\n Category:\n type: object\n properties:\n category:\n type: string\n category_id:\n type: integer\n status:\n type: string\n enum:\n - A\n - D\n - H\n parent_id:\n type: integer\n is_fillable:\n type: boolean\n CategorySummary:\n type: object\n properties:\n name:\n type: string\n id:\n type: integer\n SlugTarget:\n type: object\n properties:\n type:\n type: string\n enum:\n - product\n - category\n - attribute_variant\n - company\n - cms_page\n description: 'Type of the object the slug is pointing to.'\n id:\n type: integer\n description: 'ID of the object the slug is pointing to (for example product ID, category ID, etc.).'\n required:\n - type\n - name\n DeclinationId:\n type: string\n Basket:\n type: object\n properties:\n id:\n type: string\n coupons:\n type: array\n items:\n type: string\n description: 'List of coupons applied to the basket.'\n companyGroups:\n type: array\n items:\n $ref: '#/definitions/BasketCompanyGroup'\n description: 'Items are grouped by companies.'\n subtotal:\n type: number\n description: 'Total of all item prices, tax and discounts included but shipping excluded.'\n totalDiscount:\n type: number\n description: 'Total of all discounts applied to the basket.'\n totalShipping:\n type: number\n description: 'Total of all shippings, tax included.'\n totalTax:\n type: number\n description: 'Tax total for the whole basket.'\n total:\n type: number\n description: 'Total of the basket, tax included.'\n totalQuantity:\n type: integer\n description: 'Total number of items in the basket.'\n BasketCompanyGroup:\n type: object\n properties:\n id:\n type: string\n company:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n shippingGroups:\n type: array\n items:\n $ref: '#/definitions/BasketShippingGroup'\n BasketShippingGroup:\n type: object\n properties:\n id:\n type: string\n items:\n type: array\n items:\n $ref: '#/definitions/BasketItem'\n shippings:\n type: array\n items:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n price:\n type: number\n deliveryTime:\n type: string\n selected:\n type: boolean\n BasketItem:\n type: object\n properties:\n declinationId:\n type: string\n productId:\n type: integer\n productName:\n type: string\n productUrl:\n type: string\n individualPrice:\n type: number\n crossedOutPrice:\n type: number\n mainImage:\n $ref: '#/definitions/Image'\n quantity:\n type: integer\n total:\n type: number\n Payment:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n description:\n type: string\n position:\n type: number\n image:\n $ref: '#/definitions/Image'\n required:\n - id\n - name\n - description\n - position\n User:\n type: object\n properties:\n id:\n type: integer\n email:\n type: string\n format: email\n description: 'Must be unique.'\n firstName:\n type: string\n lastName:\n type: string\n addresses:\n type: object\n properties:\n billing:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n shipping:\n type: array\n items:\n type: object\n description: 'List of fields and their values'\n required:\n - id\n - email\n MailingList:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n required:\n - id\n - name\n Product:\n type: object\n properties:\n id:\n type: integer\n code:\n type: string\n supplierReference:\n type: string\n name:\n type: string\n url:\n type: string\n format: uri\n shortDescription:\n type: string\n description:\n type: string\n slug:\n type: string\n minPrice:\n type: number\n greenTax:\n type: number\n attributes:\n type: array\n items:\n $ref: '#/definitions/ProductAttribute'\n isTransactional:\n type: boolean\n shippings:\n type: array\n items:\n $ref: '#/definitions/Shipping'\n companies:\n type: array\n items:\n $ref: '#/definitions/ProductCompany'\n categoryPath:\n type: array\n items:\n $ref: '#/definitions/ProductCategory'\n declinations:\n type: array\n minItems: 1\n items:\n $ref: '#/definitions/Declination'\n required:\n - id\n - name\n - url\n - minPrice\n - isTransactional\n - declinations\n ProductSummary:\n type: object\n properties:\n productId:\n type: integer\n name:\n type: string\n slug:\n type: string\n subtitle:\n type: string\n minimumPrice:\n type: number\n crossedOutPrice:\n type: number\n isAvailable:\n type: boolean\n url:\n type: string\n format: uri\n createdAt:\n type: string\n description: Timestamp\n updatedAt:\n type: string\n description: Timestamp\n declinationCount:\n type: number\n affiliateLink:\n type: string\n mainImage:\n $ref: '#/definitions/Image'\n averageRating:\n type: number\n conditions:\n type: array\n items:\n type: string\n attributes:\n type: array\n items:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n slug:\n type: string\n categoryPath:\n type: array\n items:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n slug:\n type: string\n ProductReview:\n type: object\n properties:\n author:\n type: string\n description: 'Displayed name in review'\n message:\n type: string\n postedAt:\n type: integer\n description: timestamp\n rating:\n type: integer\n ProductAttribute:\n type: object\n properties:\n name:\n type: string\n value:\n type: array\n minItems: 1\n items:\n type: string\n children:\n type: array\n items:\n $ref: '#/definitions/ProductAttribute'\n subfeatures:\n description: 'DEPRECATED, use children instead'\n type: array\n items:\n $ref: '#/definitions/ProductAttribute'\n imageUrls:\n type: array\n items:\n type: string\n format: uri\n required:\n - name\n - value\n Shipping:\n type: object\n properties:\n name:\n type: string\n image:\n type: string\n firstRate:\n type: number\n nextRate:\n type: number\n required:\n - name\n - firstRate\n ProductCompany:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n required:\n - id\n - name\n ProductCategory:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n slug:\n type: string\n required:\n - id\n - name\n - slug\n Declination:\n type: object\n properties:\n code:\n type: string\n supplierReference:\n type: string\n price:\n type: number\n originalPrice:\n type: number\n crossedOutPrice:\n type: number\n greenTax:\n type: numeric\n amount:\n type: integer\n affiliateLink:\n type: string\n format: uri\n images:\n type: array\n items:\n $ref: '#/definitions/Image'\n required:\n - price\n - originalPrice\n - amount\n CatalogProductPrices:\n type: object\n properties:\n priceWithoutVat:\n type: number\n priceWithTaxes:\n type: number\n vat:\n type: number\n CatalogCompany:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n description:\n type: string\n description: 'Company description, can contain HTML.'\n professional:\n type: boolean\n description: 'Whether the company is a professional company (B2C/B2B) or a private individual (C2C).'\n slug:\n type: string\n required:\n - id\n - name\n - description\n - professional\n CatalogCategory:\n type: object\n properties:\n id:\n type: integer\n parentId:\n type: integer\n name:\n type: string\n description:\n type: string\n slug:\n type: string\n image:\n $ref: '#/definitions/Image'\n position:\n type: integer\n productCount:\n type: integer\n required:\n - id\n - parentId\n - name\n - description\n - slug\n - position\n - productCount\n CatalogCategoryTreeBranch:\n type: object\n properties:\n category:\n $ref: '#/definitions/CatalogCategory'\n children:\n type: array\n items:\n $ref: '#/definitions/CatalogCategoryTreeBranch'\n required:\n - category\n CatalogAttribute:\n type: object\n properties:\n id:\n type: integer\n name:\n type: string\n type:\n type: string\n enum:\n - CHECKBOX_UNIQUE\n - CHECKBOX_MULTIPLE\n - LIST_TEXT\n - LIST_NUMBER\n - LIST_BRAND\n - FREE_TEXT\n - FREE_NUMBER\n - FREE_DATE\n - GROUP\n position:\n type: integer\n parentId:\n type: integer\n categories:\n type: array\n items:\n type: integer\n required:\n - id\n - name\n - type\n - position\n - categories\n Pagination:\n type: object\n properties:\n page:\n type: integer\n description: 'Current page number'\n nbResults:\n type: integer\n description: 'Total number of results'\n nbPages:\n type: integer\n description: 'Total number of pages'\n resultsPerPage:\n type: integer\n description: 'Number of results per pages'\n required:\n - page\n - nbResults\n - nbPages\n - resultsPerPage\n Facet:\n type: object\n properties:\n name:\n type: string\n label:\n type: string\n isNumeric:\n type: boolean\n values:\n type: object\n ProductSearchResult:\n type: object\n properties:\n results:\n type: array\n items:\n $ref: '#/definitions/ProductSummary'\n pagination:\n $ref: '#/definitions/Pagination'\n facets:\n type: array\n items:\n $ref: '#/definitions/Facet'\n Review:\n type: object\n properties:\n message:\n type: string\n rating:\n type: integer\n user: '$ref:''#/definitions/User'''\n createdAt:\n type: integer\n description: timestamp\n required:\n - message\n - rating\n" diff --git a/tests/fixtures/VCR/testSearchOneProductByName b/tests/fixtures/VCR/testSearchOneProductByName new file mode 100644 index 00000000..45a22676 --- /dev/null +++ b/tests/fixtures/VCR/testSearchOneProductByName @@ -0,0 +1,24 @@ + +- + request: + method: GET + url: 'http://wizaplace.loc/api/v1/catalog/search/products?resultsPerPage=12&page=1&query=optio%20corporis%20similique%20voluptatum' + headers: + Host: wizaplace.loc + Accept-Encoding: null + User-Agent: 'GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.1.4-1+deb.sury.org~xenial+1' + Accept: null + response: + status: + http_version: '1.1' + code: '200' + message: OK + headers: + Date: 'Mon, 29 May 2017 10:43:50 GMT' + Server: 'Apache/2.4.10 (Debian)' + Cache-Control: 'no-cache, private' + X-Debug-Token: 0dde58 + X-Debug-Token-Link: 'http://wizaplace.loc/_profiler/0dde58' + Content-Length: '1082' + Content-Type: application/json + body: '{"results":[{"productId":1,"name":"optio corporis similique voluptatum","slug":"test-product-slug","minimumPrice":40,"crossedOutPrice":451,"isAvailable":true,"createdAt":1,"updatedAt":1495619550,"transactionMode":"T","conditions":["N"],"declinationCount":1,"affiliateLink":null,"mainImage":null,"url":"\/informatique\/test-product-slug.html","subtitle":"","averageRating":null,"attributes":[],"categoryPath":[{"id":3,"name":"Informatique","slug":"informatique"}]}],"pagination":{"page":1,"nbResults":1,"nbPages":1,"resultsPerPage":12},"facets":[{"name":"categories","label":"Cat\u00e9gorie","values":{"3":{"label":"Informatique","count":"1"}},"isNumeric":false},{"name":"company_type","label":"Type de vendeur","values":{"":{"label":"w_type_product_","count":"1"}},"isNumeric":false},{"name":1,"label":"Couleur","values":{"2":{"label":"Blanc","count":0},"4":{"label":"Bleu","count":0},"1":{"label":"Noir","count":0},"3":{"label":"Rouge","count":0},"5":{"label":"test-attribute-variant-slug","count":0}},"isNumeric":false},{"name":3,"label":"Hauteur","values":[],"isNumeric":false}]}'