Skip to main content
POST
/
v2
/
reviews
/
{platform}
cURL
curl --request POST \
  --url https://api.loyaltylion.com/v2/reviews/{platform} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "merchant_id": "<string>",
  "customer": {
    "merchant_id": "<string>",
    "email": "jsmith@example.com"
  },
  "full_text": "<string>",
  "rating": 2,
  "images_count": 500,
  "videos_count": 500,
  "date": "2026-01-01T12:00:00Z",
  "product_merchant_id": "<string>",
  "moderation_url": "<string>"
}
'
import requests

url = "https://api.loyaltylion.com/v2/reviews/{platform}"

payload = {
"merchant_id": "<string>",
"customer": {
"merchant_id": "<string>",
"email": "jsmith@example.com"
},
"full_text": "<string>",
"rating": 2,
"images_count": 500,
"videos_count": 500,
"date": "2026-01-01T12:00:00Z",
"product_merchant_id": "<string>",
"moderation_url": "<string>"
}
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({
merchant_id: '<string>',
customer: {merchant_id: '<string>', email: 'jsmith@example.com'},
full_text: '<string>',
rating: 2,
images_count: 500,
videos_count: 500,
date: '2026-01-01T12:00:00Z',
product_merchant_id: '<string>',
moderation_url: '<string>'
})
};

fetch('https://api.loyaltylion.com/v2/reviews/{platform}', 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://api.loyaltylion.com/v2/reviews/{platform}",
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([
'merchant_id' => '<string>',
'customer' => [
'merchant_id' => '<string>',
'email' => 'jsmith@example.com'
],
'full_text' => '<string>',
'rating' => 2,
'images_count' => 500,
'videos_count' => 500,
'date' => '2026-01-01T12:00:00Z',
'product_merchant_id' => '<string>',
'moderation_url' => '<string>'
]),
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://api.loyaltylion.com/v2/reviews/{platform}"

payload := strings.NewReader("{\n \"merchant_id\": \"<string>\",\n \"customer\": {\n \"merchant_id\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"full_text\": \"<string>\",\n \"rating\": 2,\n \"images_count\": 500,\n \"videos_count\": 500,\n \"date\": \"2026-01-01T12:00:00Z\",\n \"product_merchant_id\": \"<string>\",\n \"moderation_url\": \"<string>\"\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://api.loyaltylion.com/v2/reviews/{platform}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": \"<string>\",\n \"customer\": {\n \"merchant_id\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"full_text\": \"<string>\",\n \"rating\": 2,\n \"images_count\": 500,\n \"videos_count\": 500,\n \"date\": \"2026-01-01T12:00:00Z\",\n \"product_merchant_id\": \"<string>\",\n \"moderation_url\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.loyaltylion.com/v2/reviews/{platform}")

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 \"merchant_id\": \"<string>\",\n \"customer\": {\n \"merchant_id\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"full_text\": \"<string>\",\n \"rating\": 2,\n \"images_count\": 500,\n \"videos_count\": 500,\n \"date\": \"2026-01-01T12:00:00Z\",\n \"product_merchant_id\": \"<string>\",\n \"moderation_url\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "review": {
    "id": 123,
    "program_id": 123,
    "customer": {
      "id": 123,
      "email": "<string>"
    },
    "site_id": 123,
    "platform": "custom",
    "merchant_id": "<string>",
    "full_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "rating": 5,
    "images_count": 3,
    "videos_count": 0,
    "merchant_created_at": "<string>",
    "merchant_updated_at": "<string>",
    "moderation_url": "<string>"
  }
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"message": "<string>",
"details": {}
}
}
{
"error": {
"code": "<string>"
}
}
{
"error": {
"code": "<string>"
}
}
Required scope: write_reviewsThis endpoint is in preview, and is only available to partners and merchants who have opted-in
Use this endpoint to create a review in LoyaltyLion. When a review is created, if an applicable rule exists, it will be triggered based on the review’s status. If you are a review platform partner, use your platform identifier as the platform parameter. If you are a merchant integrating a custom reviews app, use custom. Reviews must be connected to a customer in LoyaltyLion, matched using their merchant_id. If you are a review partner, this must be the ID of the customer in the connected store, e.g. a Shopify customer ID.

Authorizations

Authorization
string
header
required

An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer token in the Authorization header

Path Parameters

platform
string
required

The review platform. Use your platform identifier if you are a review partner, or "custom" if you are a merchant integrating a custom reviews app

Minimum string length: 1
Example:

"custom"

Query Parameters

site_id
number

Create the review in the specified site. This is only required for programs that have multiple sites. Programs with only a single site can omit this parameter, and the review will be created in the program's only site

Body

application/json

Body

merchant_id
string
required

The ID of the review in your review platform

Minimum string length: 1
customer
object
required

The customer who left the review

status
enum<string>
required

The current status of the review, which determines how and when associated rules are triggered. One of: pending (the review is pending review), flagged (the review has been flagged for review), approved (the review has been approved/published), rejected (the review has been rejected)

Available options:
approved,
flagged,
pending,
rejected
full_text
string
required

The full text of the review

Minimum string length: 1
rating
number
required

The rating given in the review

Required range: x >= 1
images_count
number
required

The number of images attached to the review

Required range: 0 <= x <= 1000
videos_count
number
required

The number of videos attached to the review

Required range: 0 <= x <= 1000
date
string
required

The date this review was created in the review platform, as an ISO 8601 timestamp

Example:

"2026-01-01T12:00:00Z"

product_merchant_id
string | null

If this review was for a specific product, this should be set to the product ID in your ecommerce platform. If you are a review partner, this must be the ID of the product in the connected store, e.g. a Shopify product ID

Minimum string length: 1
moderation_url
string<uri> | null

Optional URL to moderate the review in the review platform

Response

201

review
object
required