Create comment
curl --request POST \
--url https://store.salesive.com/api/v1/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"productId": "<string>",
"content": "<string>",
"parentId": "<string>",
"image": "<string>"
}
'import requests
url = "https://store.salesive.com/api/v1/comments"
payload = {
"productId": "<string>",
"content": "<string>",
"parentId": "<string>",
"image": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productId: '<string>',
content: '<string>',
parentId: '<string>',
image: '<string>'
})
};
fetch('https://store.salesive.com/api/v1/comments', 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://store.salesive.com/api/v1/comments",
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([
'productId' => '<string>',
'content' => '<string>',
'parentId' => '<string>',
'image' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <api-key>"
],
]);
$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://store.salesive.com/api/v1/comments"
payload := strings.NewReader("{\n \"productId\": \"<string>\",\n \"content\": \"<string>\",\n \"parentId\": \"<string>\",\n \"image\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
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://store.salesive.com/api/v1/comments")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"<string>\",\n \"content\": \"<string>\",\n \"parentId\": \"<string>\",\n \"image\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"<string>\",\n \"content\": \"<string>\",\n \"parentId\": \"<string>\",\n \"image\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"success": true,
"message": "Comment created",
"data": {
"_id": "<string>",
"productId": "<string>",
"content": "<string>",
"user": {},
"createdAt": "2023-11-07T05:31:56Z"
}
}Comments
Create comment
Create a new comment on a product.
POST
/
comments
Create comment
curl --request POST \
--url https://store.salesive.com/api/v1/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop-id: <api-key>' \
--data '
{
"productId": "<string>",
"content": "<string>",
"parentId": "<string>",
"image": "<string>"
}
'import requests
url = "https://store.salesive.com/api/v1/comments"
payload = {
"productId": "<string>",
"content": "<string>",
"parentId": "<string>",
"image": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'x-shop-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
productId: '<string>',
content: '<string>',
parentId: '<string>',
image: '<string>'
})
};
fetch('https://store.salesive.com/api/v1/comments', 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://store.salesive.com/api/v1/comments",
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([
'productId' => '<string>',
'content' => '<string>',
'parentId' => '<string>',
'image' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop-id: <api-key>"
],
]);
$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://store.salesive.com/api/v1/comments"
payload := strings.NewReader("{\n \"productId\": \"<string>\",\n \"content\": \"<string>\",\n \"parentId\": \"<string>\",\n \"image\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
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://store.salesive.com/api/v1/comments")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"<string>\",\n \"content\": \"<string>\",\n \"parentId\": \"<string>\",\n \"image\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"<string>\",\n \"content\": \"<string>\",\n \"parentId\": \"<string>\",\n \"image\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"success": true,
"message": "Comment created",
"data": {
"_id": "<string>",
"productId": "<string>",
"content": "<string>",
"user": {},
"createdAt": "2023-11-07T05:31:56Z"
}
}Request
POST /comments
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json
{
"productId": "68e5bb463a1fc56a8ac150bf",
"content": "This product looks interesting! Does it come in blue?",
"image": "https://example.com/image.png"
}
Headers
| Header | Type | Description |
|---|---|---|
Authorization | string | Provide the customer token as Bearer <jwt>. |
x-shop-id | string | Identify the shop. |
Content-Type | string | Always set to application/json. |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
productId | string | Yes | Product identifier to comment on. |
content | string | Yes | Comment text content. |
image | string | No | Optional image URL to attach. |
Successful response
{
"status": 200,
"success": true,
"message": "Comment created successfully",
"data": {
"_id": "6a27d777289b87893fcbde5a",
"content": "This product looks interesting! Does it come in blue?",
"image": null,
"user": {
"_id": "69360693a7a8f7dc8ae32d6d",
"name": "Jane Smith",
"avatar": "https://cdn.salesive.com/avatars/jane.jpg"
},
"product": "69fb494e51280f9f65d059ae",
"shop": "68b8f52575da81b332af29f1",
"parent": null,
"likes": [],
"dislikes": [],
"likeCount": 0,
"dislikeCount": 0,
"replyCount": 0,
"isDeleted": false,
"createdAt": "2026-06-09T09:05:59.337Z",
"updatedAt": "2026-06-09T09:05:59.337Z",
"__v": 0
}
}
Error response
{
"status": 400,
"success": false,
"message": "Product ID and content are required",
"data": {}
}
Authorizations
JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Body
application/json
Was this page helpful?
⌘I

