Marketplace catalog
Create product review
Submit a marketplace review as the current session user. A supplied user_id is ignored. New reviews await approval and are not featured. Images and videos accept uploads or existing file IDs.
POST
/
catalog
/
marketplace
/
products
/
{product_id}
/
reviews
Create product review
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_number": "<string>",
"rating": 3,
"review_text": "",
"images": [
"<string>"
],
"videos": [
"<string>"
],
"name": "<string>",
"email": "jsmith@example.com",
"tags": [
"<string>"
],
"review_date": "2023-11-07T05:31:56Z",
"user_id": "<unknown>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews"
payload = {
"order_number": "<string>",
"rating": 3,
"review_text": "",
"images": ["<string>"],
"videos": ["<string>"],
"name": "<string>",
"email": "jsmith@example.com",
"tags": ["<string>"],
"review_date": "2023-11-07T05:31:56Z",
"user_id": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order_number: '<string>',
rating: 3,
review_text: '',
images: ['<string>'],
videos: ['<string>'],
name: '<string>',
email: 'jsmith@example.com',
tags: ['<string>'],
review_date: '2023-11-07T05:31:56Z',
user_id: '<unknown>'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_number' => '<string>',
'rating' => 3,
'review_text' => '',
'images' => [
'<string>'
],
'videos' => [
'<string>'
],
'name' => '<string>',
'email' => 'jsmith@example.com',
'tags' => [
'<string>'
],
'review_date' => '2023-11-07T05:31:56Z',
'user_id' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews"
payload := strings.NewReader("{\n \"order_number\": \"<string>\",\n \"rating\": 3,\n \"review_text\": \"\",\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"tags\": [\n \"<string>\"\n ],\n \"review_date\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_number\": \"<string>\",\n \"rating\": 3,\n \"review_text\": \"\",\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"tags\": [\n \"<string>\"\n ],\n \"review_date\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_number\": \"<string>\",\n \"rating\": 3,\n \"review_text\": \"\",\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"tags\": [\n \"<string>\"\n ],\n \"review_date\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Review submitted successfully.",
"success": true,
"content": {
"review": {
"product_id": "<string>",
"rating": 3,
"review_text": "<string>",
"name": "<string>",
"status": "pending",
"is_featured": false,
"tags": [
"<string>"
],
"review_date": "2023-11-07T05:31:56Z",
"images": [
{
"id": "<string>",
"thumbnail_url": "<string>",
"blur_url": "<string>",
"standard_url": "<string>"
}
],
"videos": [
{
"id": "<string>",
"cover_image_url": "<string>",
"video_preview_url": "<string>",
"playback": {
"hls": "<string>",
"dash": "<string>"
},
"duration": "<string>",
"size": "<string>"
}
]
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"errors": {},
"content": {}
}{
"message": "Not authorized for given operation on the Resource.",
"success": false,
"code": "unauthorized",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"success": true,
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"success": true,
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"success": true,
"details": "<string>"
}Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Review authorship always uses the current session user. A supplied user_id is ignored.
Was this page helpful?
⌘I
Create product review
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_number": "<string>",
"rating": 3,
"review_text": "",
"images": [
"<string>"
],
"videos": [
"<string>"
],
"name": "<string>",
"email": "jsmith@example.com",
"tags": [
"<string>"
],
"review_date": "2023-11-07T05:31:56Z",
"user_id": "<unknown>"
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews"
payload = {
"order_number": "<string>",
"rating": 3,
"review_text": "",
"images": ["<string>"],
"videos": ["<string>"],
"name": "<string>",
"email": "jsmith@example.com",
"tags": ["<string>"],
"review_date": "2023-11-07T05:31:56Z",
"user_id": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
order_number: '<string>',
rating: 3,
review_text: '',
images: ['<string>'],
videos: ['<string>'],
name: '<string>',
email: 'jsmith@example.com',
tags: ['<string>'],
review_date: '2023-11-07T05:31:56Z',
user_id: '<unknown>'
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'order_number' => '<string>',
'rating' => 3,
'review_text' => '',
'images' => [
'<string>'
],
'videos' => [
'<string>'
],
'name' => '<string>',
'email' => 'jsmith@example.com',
'tags' => [
'<string>'
],
'review_date' => '2023-11-07T05:31:56Z',
'user_id' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews"
payload := strings.NewReader("{\n \"order_number\": \"<string>\",\n \"rating\": 3,\n \"review_text\": \"\",\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"tags\": [\n \"<string>\"\n ],\n \"review_date\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_number\": \"<string>\",\n \"rating\": 3,\n \"review_text\": \"\",\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"tags\": [\n \"<string>\"\n ],\n \"review_date\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/storefront/catalog/marketplace/products/{product_id}/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_number\": \"<string>\",\n \"rating\": 3,\n \"review_text\": \"\",\n \"images\": [\n \"<string>\"\n ],\n \"videos\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"tags\": [\n \"<string>\"\n ],\n \"review_date\": \"2023-11-07T05:31:56Z\",\n \"user_id\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Review submitted successfully.",
"success": true,
"content": {
"review": {
"product_id": "<string>",
"rating": 3,
"review_text": "<string>",
"name": "<string>",
"status": "pending",
"is_featured": false,
"tags": [
"<string>"
],
"review_date": "2023-11-07T05:31:56Z",
"images": [
{
"id": "<string>",
"thumbnail_url": "<string>",
"blur_url": "<string>",
"standard_url": "<string>"
}
],
"videos": [
{
"id": "<string>",
"cover_image_url": "<string>",
"video_preview_url": "<string>",
"playback": {
"hls": "<string>",
"dash": "<string>"
},
"duration": "<string>",
"size": "<string>"
}
]
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"errors": {},
"content": {}
}{
"message": "Not authorized for given operation on the Resource.",
"success": false,
"code": "unauthorized",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"success": true,
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"success": true,
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"success": true,
"details": "<string>"
}