@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Reviews and Ratings API
@base https://storecomponents.myvtex.com
@version 1.0
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@common_fields {Content-Type: str=application/json, Accept: str=application/json}
@endpoints 8
@toc reviews-and-ratings(8)

@endpoint GET /reviews-and-ratings/api/rating/{productId}
@required {productId: str}
@returns(200) {average: num, totalCount: num, starsFive: num, starsFour: num, starsThree: num, starsTwo: num, starsOne: num}
@errors {404}

@endpoint GET /reviews-and-ratings/api/review/{reviewId}
@required {reviewId: str}
@returns(200) {id: str, productId: str, rating: num, title: str, text: str, reviewerName: str, shopperId: str, reviewDateTime: str, searchDate: str, verifiedPurchaser: bool, sku: str?, approved: bool, location: str?, locale: str?, pastReviews: str?}
@errors {404, 500}

@endpoint DELETE /reviews-and-ratings/api/review/{reviewId}
@required {reviewId: str}
@returns(200)

@endpoint PATCH /reviews-and-ratings/api/review/{reviewId}
@required {reviewId: str, productId: str, rating: num, title: str, text: str, reviewerName: str}
@optional {shopperId: str, verifiedPurchaser: bool, locale: str}
@returns(200) {id: str, productId: str, rating: num, title: str, text: str, reviewerName: str, shopperId: str, reviewDateTime: str, searchDate: str, verifiedPurchaser: bool, sku: str?, approved: bool, location: str?, locale: str?, pastReviews: str?}

@endpoint GET /reviews-and-ratings/api/reviews
@optional {search_term: str, from: str, to: str, order_by: str, status: bool, product_id: str}
@returns(200) {data: [map], range: map{total: num, from: num, to: num}}

@endpoint POST /reviews-and-ratings/api/reviews
@returns(200)

@endpoint DELETE /reviews-and-ratings/api/reviews
@returns(200)

@endpoint POST /reviews-and-ratings/api/review
@required {productId: str, rating: int(int32), title: str, text: str, reviewerName: str, approved: bool}
@returns(200) {id: str, productId: str, rating: num, title: str, text: str, reviewerName: str, shopperId: str, reviewDateTime: str, searchDate: str, verifiedPurchaser: bool, sku: str?, approved: bool, location: str?, locale: str?, pastReviews: str?}

@end
