Batch Create Comment

🔒

Requires write_comments access scope. More access scope

The Batch Create Comment API allows users to create multiple comments for products in a single request. This is especially useful for bulk operations, such as importing customer reviews or adding product feedback in batch.## Use Cases

  1. Import multiple product reviews at once for efficient management.
  2. Add bulk feedback or testimonials during product updates.
  3. Simplify large-scale operations, such as migrating comments to a new store.


Request Parameters

Public Request Parameters

📘

Public Request Parameters

Body Parameters

Parameter Type Required Example Description
comments Array of Objects Yes Comments Object Array of comments to be submitted in the batch. Each object represents a single comment.
comments.product_id String Yes 33f1b4f6-9474-4e6c-9a3f-676a420ea8bb Product's ID to associate the comment with.
comments.username String Yes Joey User name for the comment.
comments.star Integer Yes 5 Star rating for the product. Must be between 1 and 5.
comments.image String No http://abc.com/img.jpg Images in the comment, separated by semicolons.
comments.like Integer Yes 100 Like count for the comment.
comments.created_at String Yes 2019-07-10T15:00:00Z Comment creation time in ISO 8601 format.
comments.content String Yes Cheap but beautiful Content of the comment.
comments.country String No CN Country code where the comment is from.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

FieldTypeExampleDescription
success_countInteger2Number of comments successfully processed.
error_countInteger0Number of comments that failed to process.
error_infoArray of ObjectArray of Error Details ObjectDetailed information about each failed comment.

Error Details (error_info Object)

FieldTypeDescriptionExample
product_idStringProduct ID associated with the failed comment.3f1b4f6-9474-4e6c-9a3f-676a420ea8bb
usernameStringUsername associated with the failed comment.test
starIntegerStar rating provided in the failed comment.1
imageArray of StringImage URLs provided in the failed comment.[ "http://abc.com/img.jpg" ]
likeIntegerLike count provided in the failed comment.100
contentStringComment content associated with the failure.Cheap but beautiful
created_atStringTimestamp when the comment was created.2019-07-10T15:00:00Z
error_messageStringError message explaining why the comment failed to process.review_error_product_not_found;

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorArray "store is not active"Indicates an error encountered during the process.

Error Details

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
404Invalid or empty store nameinvalid store name{ "errors": store is not active}
200Partial failedSome items in the batch request were processed successfully, while others failed.
review_error_product_not_foundproduct not found
评论不可为空;content is required
评分支持输入0.5-5分,最小单位为0.5分star must be integer and arranged from 1 - 5.
点赞数必须为大于等于0的整数,且最多8位;like count must be positive integer and up to 8 digits
用户名不可为空empty user name

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!