评论

商品评论属性

属性名说明必返回类型限制

meta

分页meta信息

[string]

links

分页links信息

[string]

comment_ID

评论ID

[int]

comment_date

评论时间

[datetime]

comment_approved

是否已审核

[int]

user_id

评论用户ID

[string]

agent

UA

[string]

content

评论内容

[string]

country

所属国家

[string]

email

电子邮箱

[string]

ip

IP

[string]

like_account

点赞数

[string]

name

评论者名称

[string]

product_id

关联商品ID

[int]

top_date

评论置顶时间

[datetime]

rating

评分星级

[string]

status

状态

[string]

verified

是否验证

[string]

like_account_ip

点赞者IP

[string]

abuse

点踩数

[number]

products

评论关联商品

[object]

gallery

相册

[array]

purchased_times

购买次数

[string]

获取商品评论

权限:read_comments

GET /openapi/2021-08/comments

Query Parameters

NameTypeDescription

filter[approving]

String

获取是否含有评论 yes和no

filter[content]

String

获取评论内容

filter[include_id]

String

获取指定商品评论,多个标签用逗号隔开

filter[rating]

String

取出指定星级数的记录,多个星级数用逗号隔开,例:1,2,3,4,5

sort

String

排序,目前支持ID,正向排序sort=ID 反向sort=-ID.

page

String

页码,从1开始

page_size

String

每页数量,默认25

filter[gallery]

String

1或者0

filter[product_id]

String

获取多个商品的评论(12,23)

filter[product_comment_status]

String

获取开启商品评论的评论(true或false)

filter[comment_id]

String

获取指定评论(11,2222)

filter[exclude_id]

String

获取除指定评论外的评论(例:11,22)

filter[on_sale_product]

String

获取上架商品的评论(例:true和false)

{
    "data": [
        {
            "user_id": 0,
            "email": "2343423@qq.com",
            "ip": "45.79.72.43",
            "content": "商品评论",
            "country": "US",
            "gallery": [],
            "rating": "5",
            "top_date": "2015-01-01 00:00:00",
            "status": "publish",
            "comment_date": "2024-02-29 14:24:28",
            "purchased_times": null,
            "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
            "comment_ID": 1,
            "comment_approved": false,
            "like_account": "0",
            "like_account_ip": [],
            "name": "comment_name",
            "product_id": 7865,
            "reply": [],
            "products": {
                "title": "变种商品",
                "slug": "saas--bian-zhong-shang-pin-121-8",
                "spu": "",
                "sku": "sku",
                "weight": "0.00",
                "weight_unit": "kg",
                "weight_local": "0.000",
                "price": 121,
                "regular_price": 121,
                "max_discount": 0,
                "min_price": 121,
                "max_price": 121,
                "manage_stock": "no",
                "backorders": "no",
                "stock": 0,
                "available_map": true,
                "available_store_show": true,
                "bar_code": "",
                "subtitle": "",
                "supplier": "",
                "image_id": 58399,
                "gallery": "58399,58398",
                "seo_title": "",
                "seo_description": "",
                "source": null,
                "snow_flake_id": "588180020166393856",
                "comment_status": "open",
                "product_order": 0,
                "type": 1,
                "is_overseas_depot": 0,
                "min_purchase_quantity": 1,
                "variant_attrs": [],
                "shop_id": 7865,
                "public_url": "https://shop.com/products/saas--bian-zhong-shang-pin-121-8",
                "path": "/products/saas--bianzhong-shang-pin-121-8",
                "short_content": "真的很复杂哦",
                "feature_image": null,
                "ID": 7865,
                "post_status": "publish",
                "post_name": "saas--bian-zhong-shang-pin-121-8",
                "post_title": "SAAS-变种商品121",
                "review_status": "open"
            }
        }
    ],
    "links": {
        "first": "https://shop.com/openapi/2021-08/comments?page=1",
        "last": "https://shop.com/openapi/2021-08/comments?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://shop.com/openapi/2021-08/comments",
        "per_page": 25,
        "to": 4,
        "total": 4
    }
}

创建商品评论

权限:write_comments

POST /openapi/2021-08/comments/batches

Request Body

NameTypeDescription

like_account

String

点赞数

name

String

姓名

rating

String

评论星数

comment_post_ID

String

商品id

date

String

日期

country

String

国家

content

String

内容

gallery

String

图库

purchased_times

String

购买次数,可为空

{
   {
        "content": "内容",
        "country": "AX",
        "like_account": 1,
        "rating": 4,
        "purchased_times": 5,
        "name": "姓名",
        "comment_date": "2023-11-08 10:59:14",
        "comment_post_ID": 7939,
        "gallery": []
    }
}

Last updated