Import reviews in bulk
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/reviews/bulk-import';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"reviews":[{"product_external_id":"example","variant_name":"example","external_review_id":"example","rating":1,"content":"example","reviewer_name":"example","reviewer_avatar":"example","images":["example"],"helpful":1,"created_at":"example"}],"options":{"auto_approve":true,"skip_duplicates":true,"update_duplicates":false,"update_stats":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://apibase.ecomweb.app/api/v1/stores/example/reviews/bulk-import \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "reviews": [ { "product_external_id": "example", "variant_name": "example", "external_review_id": "example", "rating": 1, "content": "example", "reviewer_name": "example", "reviewer_avatar": "example", "images": [ "example" ], "helpful": 1, "created_at": "example" } ], "options": { "auto_approve": true, "skip_duplicates": true, "update_duplicates": false, "update_stats": true } }'Imports up to 500 reviews collected from another platform. Each review is matched to a product by product_external_id; reviews whose product is not found are skipped. Reviews already imported, recognised by external_review_id, are skipped; options.update_duplicates does not update them yet and only skips them too. Setting options.skip_duplicates to false without it imports them again as new reviews. Imported reviews are approved unless options.auto_approve is false, are never marked as verified buyers, and product rating statistics are recalculated unless options.update_stats is false. The response counts what happened to each review; a 201 does not mean every review was imported.
Required scopes: write:reviews
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The reviews to import, from 1 to 500.
object
External ID of the product the review belongs to, matched against the product’s external ID. Reviews with no matching product are skipped.
Name of the variant the review is about.
The review’s ID on the source platform, used to detect duplicates.
Star rating, 1 to 5.
Review text.
Reviewer’s display name.
URL of the reviewer’s avatar.
URLs of images attached to the review.
How many people found the review helpful on the source platform. It is kept in the review’s moderation notes.
The review’s original date, as an ISO 8601 timestamp. An unparseable value is ignored with a warning.
Options for this import.
object
Approve imported reviews straight away. When false they are imported as PENDING.
Skip reviews whose external_review_id was already imported. When false they are imported again as new reviews.
Not implemented yet: duplicates are skipped, not updated.
Recalculate product rating statistics after the import.
Responses
Section titled “Responses”object
Number of reviews imported.
Number of reviews that could not be imported.
Number of reviews skipped, as duplicates or because their product was not found.
One message for each review that failed.
Notes about reviews that were imported or skipped with a caveat.
Example generated
{ "success": 1, "failed": 1, "skipped": 1, "errors": [ "example" ], "warnings": [ "example" ]}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}