{ "openapi": "3.0.0", "info": { "title": "Reviews and Ratings API", "description": "Reviews and Ratings is a VTEX IO native solution that allows shoppers to submit reviews and ratings for products, as well as see them while navigating the store.", "contact": {}, "version": "1.0" }, "servers": [ { "url": "https://{accountName}.{environment}.com.br/reviews-and-ratings/api", "description": "VTEX server URL", "variables": { "accountName": { "description": "Name of the VTEX account. Used as part of the URL.", "default": "{accountName}" }, "environment": { "description": "Environment to use. Used as part of the URL.", "default": "{environment}" } } } ], "paths": { "/rating/{productId}": { "get": { "tags": [ "Rating" ], "summary": "Get Product Rating", "description": "Retrieves the rating of a specific product.", "operationId": "GetProductRating", "parameters": [ { "name": "productId", "in": "path", "description": "Product ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "1" } }, { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "", "type": "object", "properties": { "average": { "description": "Avarage rating of the product.", "type": "number", "example": 3.86 }, "totalCount": { "description": "Total amount of ranting of the product.", "type": "number", "example": 7 } }, "example": { "average": 3.86, "totalCount": 7 } } } } } }, "deprecated": false } }, "/review/{reviewId}": { "get": { "tags": [ "Review" ], "summary": "Get Review by Review ID", "description": "Retrieves information of a product review by its ID.", "operationId": "GetReviewbyReviewId", "parameters": [ { "name": "reviewId", "in": "path", "description": "Review ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "1" } }, { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "", "type": "object", "properties": { "id": { "description": "Review ID.", "type": "string" }, "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "number" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" }, "shopperId": { "description": "Shopper email.", "type": "string" }, "reviewDateTime": { "description": "Review's date and time.", "type": "string" }, "searchDate": { "description": "Review's search date.", "type": "string" }, "verifiedPurchaser": { "description": "If the reviewer is a verified purchaser (`true`) or not (`false`).", "type": "boolean" }, "sku": { "description": "SKU ID.", "type": "string", "nullable": true }, "approved": { "description": "If the review was approved (`true`) or not (`false`).", "type": "boolean" }, "location": { "description": "Review's origin location.", "type": "string", "nullable": true }, "locale": { "description": "Review's locale.", "type": "string", "nullable": true }, "pastReviews": { "description": "Past reviews of the same product.", "type": "string", "nullable": true } }, "example": { "id": "5323fdaa-c012-11ec-835d-0ebee58edbb3", "productId": "1", "rating": 5, "title": "Great product", "text": "Great product.", "reviewerName": "Arturo", "shopperId": "user@email.com", "reviewDateTime": "04/19/2022 18:55:58", "searchDate": "2022-04-19T18:55:58Z", "verifiedPurchaser": false, "sku": "2", "approved": false, "location": null, "locale": "en-US", "pastReviews": null } } } } } }, "deprecated": false }, "delete": { "tags": [ "Review" ], "summary": "Delete Review", "description": "Deletes an existing review.", "operationId": "DeleteReview", "parameters": [ { "name": "reviewId", "in": "path", "description": "Review ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "1" } }, { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "If the review was deleted (`true`) or not (`false`).", "type": "boolean", "example": true } } } } }, "deprecated": false }, "patch": { "tags": [ "Review" ], "summary": "Update a Review", "description": "Updates the information of a review.", "operationId": "EditReview", "parameters": [ { "name": "reviewId", "in": "path", "description": "Review ID.", "required": true, "style": "simple", "schema": { "type": "string", "example": "5323fdaa-c012-11ec-835d-0ebee58edbb3" } }, { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "description": "", "type": "object", "required": [ "productId", "rating", "title", "text", "reviewerName" ], "properties": { "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "number" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" }, "shopperId": { "description": "Shopper email.", "type": "string" }, "verifiedPurchaser": { "description": "If the reviewer is a verified purchaser (`true`) or not (`false`).", "type": "boolean" }, "locale": { "description": "Review's locale.", "type": "string", "nullable": true } }, "example": { "productId": "1", "rating": 5, "title": "Great product", "text": "Great product.", "reviewerName": "Arturo", "shopperId": "user@email.com", "verifiedPurchaser": false, "locale": "en-US" } } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "", "type": "object", "properties": { "id": { "description": "Review ID.", "type": "string" }, "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "number" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" }, "shopperId": { "description": "Shopper email.", "type": "string" }, "reviewDateTime": { "description": "Review's date and time.", "type": "string" }, "searchDate": { "description": "Review's search date.", "type": "string" }, "verifiedPurchaser": { "description": "If the reviewer is a verified purchaser (`true`) or not (`false`).", "type": "boolean" }, "sku": { "description": "SKU ID.", "type": "string", "nullable": true }, "approved": { "description": "If the review was approved (`true`) or not (`false`).", "type": "boolean" }, "location": { "description": "Review's origin location.", "type": "string", "nullable": true }, "locale": { "description": "Review's locale.", "type": "string", "nullable": true }, "pastReviews": { "description": "Past reviews of the same product.", "type": "string", "nullable": true } }, "example": { "id": "5323fdaa-c012-11ec-835d-0ebee58edbb3", "productId": "1", "rating": 5, "title": "Great product", "text": "Great product.", "reviewerName": "Arturo", "shopperId": "user@email.com", "reviewDateTime": "04/19/2022 18:55:58", "searchDate": "2022-04-19T18:55:58Z", "verifiedPurchaser": false, "sku": "2", "approved": false, "location": null, "locale": "en-US", "pastReviews": null } } } } } }, "deprecated": false } }, "/reviews": { "get": { "tags": [ "Review" ], "summary": "Get a list of Reviews", "description": "Retrieves a list of reviews.", "operationId": "GetalistofReviews", "parameters": [ { "name": "search_term", "in": "query", "description": "Returns Reviews that contain the search term in `productId`, `sku`, `shopperId`, or `reviewerName`.", "required": true, "style": "form", "explode": true, "schema": { "type": "string", "example": "search_term" } }, { "name": "from", "in": "query", "description": "Zero base starting record number, `0` is the default value.", "required": true, "style": "form", "explode": true, "schema": { "type": "string", "example": "0" } }, { "name": "to", "in": "query", "description": "Zero base ending record number, `3` is the default value.", "required": true, "style": "form", "explode": true, "schema": { "type": "string", "example": "3" } }, { "name": "order_by", "in": "query", "description": "Case-sensitive fieldName to order records (optionally add `:asc` or `:desc`).", "required": true, "style": "form", "explode": true, "schema": { "type": "string", "example": ":asc" } }, { "name": "status", "in": "query", "description": "Status of the review, approved (`true`) or not (`false`).", "required": true, "style": "form", "explode": true, "schema": { "type": "boolean", "example": true } }, { "name": "product_id", "in": "query", "description": "Filter the reviews by product ID.", "required": true, "style": "form", "explode": true, "schema": { "type": "string", "example": "1" } }, { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "", "type": "object", "properties": { "data": { "description": "Array of reviews.", "type": "array", "items": { "description": "Review's information.", "type": "object", "properties": { "id": { "description": "Review ID.", "type": "string" }, "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "number" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" }, "shopperId": { "description": "Shopper email.", "type": "string" }, "reviewDateTime": { "description": "Review's date and time.", "type": "string" }, "searchDate": { "description": "Review's search date.", "type": "string" }, "verifiedPurchaser": { "description": "If the reviewer is a verified purchaser (`true`) or not (`false`).", "type": "boolean" }, "sku": { "description": "SKU ID.", "type": "string", "nullable": true }, "approved": { "description": "If the review was approved (`true`) or not (`false`).", "type": "boolean" }, "location": { "description": "Review's origin location.", "type": "string", "nullable": true }, "locale": { "description": "Review's locale.", "type": "string", "nullable": true }, "pastReviews": { "description": "Past reviews of the same product.", "type": "string", "nullable": true } } } }, "range": { "description": "Range of the review's list.", "type": "object", "properties": { "total": { "description": "Total number of reviews on the list.", "type": "number" }, "from": { "description": "Zero base starting record number.", "type": "number" }, "to": { "description": "Zero base ending record number.", "type": "number" } } } }, "example": { "data": [ { "id": "1", "productId": "880035", "rating": 3, "title": "anon", "text": "anon", "reviewerName": "anon", "shopperId": "anon@email.com", "reviewDateTime": "06/02/2021 20:58:43", "searchDate": "2021-06-02T20:58:43Z", "verifiedPurchaser": false, "sku": null, "approved": true, "location": "", "locale": null, "pastReviews": null }, { "id": "2", "productId": "880035", "rating": 5, "title": "logged in", "text": "it's cool", "reviewerName": "Brian", "shopperId": "brian@email.com.br", "reviewDateTime": "06/02/2021 21:00:00", "searchDate": "2021-06-02T21:00:00Z", "verifiedPurchaser": false, "sku": null, "approved": true, "location": "", "locale": null, "pastReviews": null }, { "id": "c66d8bc0-787c-11ec-82ac-028dd4526e77", "productId": "880035", "rating": 3, "title": "Korean", "text": "ko-KR", "reviewerName": "ko-KR", "shopperId": "user@email.com", "reviewDateTime": "01/18/2022 16:36:33", "searchDate": "2022-01-18T16:36:33Z", "verifiedPurchaser": false, "sku": null, "approved": true, "location": null, "locale": "ko-KR", "pastReviews": null } ], "range": { "total": 26, "from": 0, "to": 3 } } } } } } }, "deprecated": false }, "post": { "tags": [ "Review" ], "summary": "Create Multiple Reviews", "description": "Creates multiple reviews.", "operationId": "SaveMultipleReviews", "parameters": [ { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SaveMultipleReviewsRequest" }, "description": "" }, "example": [ { "productId": "1", "rating": 4, "title": "test multiple reviews", "text": "test multiple reviews", "reviewerName": "Arturo", "approved": false, "verifiedPurchaser": false }, { "productId": "2", "rating": 4, "title": "test review 2 multiple reviews", "text": "test review 2 multiple reviews", "reviewerName": "Arturo", "approved": false, "verifiedPurchaser": false } ] } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json":{ "schema": { "description": "List of review IDs.", "type": "array", "items": { "description": "Review ID.", "type": "string" } }, "example": [ "8e1a5e11-c0c9-11ec-835d-0a591b8a3ec1", "9257c203-c0c9-11ec-835d-0e02dd207951" ] } } } }, "deprecated": false }, "delete": { "tags": [ "Review" ], "summary": "Delete Multiple Reviews", "description": "Deletes multiple reviews at once.", "operationId": "DeleteMultipleReviews", "parameters": [ { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "description": "Array of reviews IDs.", "type": "array", "items":{ "type": "string", "description": "Review ID." }, "example": [ "1", "2", "c66d8bc0-787c-11ec-82ac-028dd4526e77" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "If the review was deleted (`true`) or not (`false`).", "type": "boolean", "example": true } } } } }, "deprecated": false } }, "/review": { "post": { "tags": [ "Review" ], "summary": "Create a Review", "description": "Creates a single review", "operationId": "SaveReview", "parameters": [ { "name": "Content-Type", "in": "header", "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } }, { "name": "Accept", "in": "header", "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { "type": "string", "default": "application/json" } } ], "requestBody": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SaveReviewRequest" }, "example": { "productId": "65444", "rating": 5, "title": "Good Product", "text": "It is the best product that I have seen", "reviewerName": "Arturo" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "", "type": "object", "properties": { "id": { "description": "Review ID.", "type": "string" }, "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "number" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" }, "shopperId": { "description": "Shopper email.", "type": "string" }, "reviewDateTime": { "description": "Review's date and time.", "type": "string" }, "searchDate": { "description": "Review's search date.", "type": "string" }, "verifiedPurchaser": { "description": "If the reviewer is a verified purchaser (`true`) or not (`false`).", "type": "boolean" }, "sku": { "description": "SKU ID.", "type": "string", "nullable": true }, "approved": { "description": "If the review was approved (`true`) or not (`false`).", "type": "boolean" }, "location": { "description": "Review's origin location.", "type": "string", "nullable": true }, "locale": { "description": "Review's locale.", "type": "string", "nullable": true }, "pastReviews": { "description": "Past reviews of the same product.", "type": "string", "nullable": true } }, "example": { "id": "5323fdaa-c012-11ec-835d-0ebee58edbb3", "productId": "65444", "rating": 5, "title": "Good Product", "text": "It is the best product that I have seen", "reviewerName": "Arturo", "shopperId": "user@email.com", "reviewDateTime": "04/19/2022 18:55:58", "searchDate": "2022-04-19T18:55:58Z", "verifiedPurchaser": false, "sku": "2", "approved": false, "location": null, "locale": "en-US", "pastReviews": null } } } } } }, "deprecated": false } } }, "security": [ { "appKey": [], "appToken": [] } ], "components": { "securitySchemes": { "appKey": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppKey" }, "appToken": { "type": "apiKey", "in": "header", "name": "X-VTEX-API-AppToken" } }, "schemas": { "SaveReviewRequest": { "title": "SaveReviewRequest", "required": [ "productId", "rating", "title", "text", "reviewerName" ], "type": "object", "properties": { "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "integer", "format": "int32" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" } }, "example": { "productId": "65444", "rating": 5, "title": "Good Product", "text": "It is the best product that I have seen", "reviewerName": "Arturo" } }, "SaveMultipleReviewsRequest": { "title": "SaveMultipleReviewsRequest", "required": [ "productId", "rating", "title", "text", "reviewerName", "approved", "verifiedPurchaser" ], "type": "object", "properties": { "id": { "description": "Review ID.", "type": "string" }, "productId": { "description": "Product ID.", "type": "string" }, "rating": { "description": "Customer rating.", "type": "number" }, "title": { "description": "Review's title.", "type": "string" }, "text": { "description": "Review's text.", "type": "string" }, "reviewerName": { "description": "Reviewer name.", "type": "string" }, "verifiedPurchaser": { "description": "If the reviewer is a verified purchaser (`true`) or not (`false`).", "type": "boolean" }, "approved": { "description": "If the review was approved (`true`) or not (`false`).", "type": "boolean" } }, "example": { "productId": "1", "rating": 4, "title": "Great product", "text": "Great product!", "reviewerName": "Arturo", "approved": false, "verifiedPurchaser": false } } } }, "tags": [ { "name": "Rating" }, { "name": "Review" } ] }