Bot for Automatic Review Processing on Marketplaces

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Bot for Automatic Review Processing on Marketplaces
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Marketplace Review Auto-Processing Bot Development

Marketplaces—Ozon, Wildberries, Yandex.Market—require prompt responses to reviews. Platforms consider the percentage of answered reviews when ranking cards. Manual processing with hundreds of reviews per month is a time sink and leads to constant delays. A bot automates three tasks: getting new reviews, generating responses, and publishing via API.

Architecture

Cron → API Polling → New Review Queue → Auto-Response Engine → Publish API
                                    ↓
                              Low-Score Alert → Human Queue

Logic: reviews with rating 4–5 are processed automatically. Reviews with rating 1–3 go to a manual response queue with Telegram notification.

Ozon API Integration

class OzonReviewApiClient
{
    private string $clientId;
    private string $apiKey;
    private string $baseUrl = 'https://api-seller.ozon.ru';

    public function getUnprocessedReviews(): array
    {
        $response = Http::withHeaders([
            'Client-Id'   => $this->clientId,
            'Api-Key'     => $this->apiKey,
            'Content-Type' => 'application/json',
        ])->post("{$this->baseUrl}/v1/review/list", [
            'processed' => false,
            'with_text' => true,
            'page'      => 1,
            'page_size' => 100,
        ]);

        return $response->json('result.reviews', []);
    }

    public function replyToReview(string $reviewId, string $text): bool
    {
        $response = Http::withHeaders([
            'Client-Id'    => $this->clientId,
            'Api-Key'      => $this->apiKey,
            'Content-Type' => 'application/json',
        ])->post("{$this->baseUrl}/v1/review/comment/create", [
            'review_id' => $reviewId,
            'text'      => $text,
        ]);

        return $response->successful();
    }
}

Response Generator

Responses are generated from templates with personalization or via GPT for uniqueness.

Template Approach:

class TemplateResponseGenerator
{
    private array $positiveTemplates = [
        "Thank you for the review, {author}! Glad you liked {product_short}. Look forward to seeing you again!",
        "{author}, thanks for rating! Nice to hear positive words about {product_short}.",
        "Thank you, {author}! Your review is very important to us. Enjoy {product_short}!",
    ];

    private array $neutralTemplates = [
        "Thank you for the review, {author}. If you have questions about {product_short}, contact our support.",
    ];

    public function generate(ReviewDTO $review): string
    {
        $templates = $review->rating >= 4
            ? $this->positiveTemplates
            : $this->neutralTemplates;

        $template = $templates[array_rand($templates)];

        return str_replace(
            ['{author}', '{product_short}'],
            [$review->author, $this->shortProductName($review->productName)],
            $template,
        );
    }
}

GPT Approach for quality unique responses:

class GptResponseGenerator
{
    public function generate(ReviewDTO $review): string
    {
        $response = $this->openai->chat()->create([
            'model'    => 'gpt-4o-mini',
            'messages' => [
                [
                    'role'    => 'system',
                    'content' => implode("\n", [
                        'You are an e-commerce support specialist. Write a reply to a customer review.',
                        'Requirements: 1–3 sentences. No bureaucratic language. Use customer name if available.',
                        'If positive—thank them. Neutral—thank and offer help.',
                        'No discount promises or specific dates.',
                    ]),
                ],
                [
                    'role'    => 'user',
                    'content' => "Product: {$review->productName}\nRating: {$review->rating}/5\nAuthor: {$review->author}\nReview: {$review->text}",
                ],
            ],
            'max_tokens'  => 150,
            'temperature' => 0.8,
        ]);

        return $response->choices[0]->message->content;
    }
}

Review Processing Job

class ProcessMarketplaceReviewJob implements ShouldQueue
{
    public int $tries = 3;

    public function handle(
        TemplateResponseGenerator $templateGen,
        GptResponseGenerator      $gptGen,
        ReviewPublisher           $publisher,
        ReviewAlertService        $alerts,
    ): void {
        $review = $this->review;

        if ($review->rating <= 3) {
            // Alert team—response needs manual handling
            $alerts->urgentReviewAlert($review);
            return;
        }

        // Select generator
        $text = config('reviews.use_gpt')
            ? $gptGen->generate($review)
            : $templateGen->generate($review);

        // Publish via marketplace API
        $success = $publisher->publish($review->platform, $review->externalId, $text);

        if (!$success) {
            throw new \RuntimeException("Failed to publish reply to {$review->platform}");
        }

        // Record response in DB
        Review::where('external_id', $review->externalId)
            ->update([
                'reply_text'       => $text,
                'reply_published_at' => now(),
                'is_processed'     => true,
            ]);
    }
}

Wildberries API

class WildberriesReviewApiClient
{
    private string $apiKey;
    private string $baseUrl = 'https://feedbacks-api.wildberries.ru';

    public function getFeedbacks(bool $onlyNew = true): array
    {
        $response = Http::withToken($this->apiKey)
            ->get("{$this->baseUrl}/api/v1/feedbacks", [
                'isAnswered' => $onlyNew ? 'false' : 'true',
                'take'       => 100,
                'skip'       => 0,
            ]);

        return $response->json('data.feedbacks', []);
    }

    public function replyToFeedback(string $id, string $text): bool
    {
        $response = Http::withToken($this->apiKey)
            ->patch("{$this->baseUrl}/api/v1/feedbacks", [
                'id'   => $id,
                'text' => $text,
            ]);

        return $response->successful();
    }
}

Quality Control of Responses

Before publishing, response passes validation:

class ReplyValidator
{
    public function validate(string $reply): ValidationResult
    {
        $errors = [];

        if (mb_strlen($reply) < 20) {
            $errors[] = 'Response too short';
        }

        if (mb_strlen($reply) > 1000) {
            $errors[] = 'Character limit exceeded';
        }

        // Marketplaces forbid competitor mentions and external links
        if (preg_match('/https?:\/\//i', $reply)) {
            $errors[] = 'Links in responses forbidden';
        }

        $forbidden = ['wildberries', 'ozon', 'yandex', 'aliexpress'];
        foreach ($forbidden as $word) {
            if (mb_stripos($reply, $word) !== false) {
                $errors[] = "Competitor mention: {$word}";
            }
        }

        return new ValidationResult(errors: $errors);
    }
}

Effectiveness Metrics

Metric Target
Processed reviews percent > 95% within 24 hours
Auto-reply share (rating 4–5) 70–80% of all reviews
Average response time < 2 hours
Publishing errors < 1%

Schedule

// Check new reviews every 30 minutes
$schedule->command('reviews:marketplace:poll')->everyThirtyMinutes();

// Weekly response statistics report
$schedule->job(new MarketplaceReviewsWeeklyReportJob)->weekly()->mondays()->at('09:00');

Timeline

  • Ozon API client + template generator: 1 day
  • Wildberries + Yandex.Market API: +1 day
  • GPT generator + validator: 1 day
  • Job system + manual response queue: 0.5 days
  • Telegram notifications + metrics: 0.5 days

Total: 3–4 working days.