Channels

Shopify Plugin

Add an AI-powered "Request Warranty" button to your Shopify product and order pages. When a customer clicks it, W-Scrut opens a guided claim flow and evaluates their evidence automatically.

Installation — Theme App Extension

Paste this snippet into your Shopify theme's order-confirmation.liquid or product.liquid file:

<script>
  (function() {
    var WSCRUT_TENANT = 'YOUR_TENANT_ID'; // from Settings → API Keys
    var WSCRUT_API_KEY = 'wsc_live_xxx';  // from Settings → API Keys

    var btn = document.createElement('button');
    btn.textContent = '🔧 Request Warranty Return';
    btn.style.cssText = [
      'padding:12px 24px', 'border-radius:8px',
      'background:#7c3aed', 'color:#fff',
      'border:none', 'cursor:pointer',
      'font-size:14px', 'font-weight:600',
    ].join(';');

    btn.onclick = function() {
      var orderId = '{{ order.id }}';
      var sku     = '{{ line_item.sku }}';
      var modal = document.createElement('iframe');
      modal.src = 'https://wscrut.silnt.in/widget/claim'
        + '?tenant=' + WSCRUT_TENANT
        + '&order=' + orderId
        + '&sku=' + sku;
      modal.style.cssText = [
        'position:fixed', 'inset:0', 'width:100%', 'height:100%',
        'border:none', 'z-index:99999', 'background:rgba(0,0,0,0.6)',
      ].join(';');
      document.body.appendChild(modal);
      window.addEventListener('message', function(e) {
        if (e.data === 'wscrut:close') document.body.removeChild(modal);
      });
    };

    document.getElementById('wscrut-btn-container')?.appendChild(btn);
  })();
</script>
<div id="wscrut-btn-container"></div>

Configuration

Replace the two values at the top of the script:

  • WSCRUT_TENANT — Your tenant ID from Settings → API Keys
  • WSCRUT_API_KEY — A live API key from Settings → API Keys

How it works

When a customer clicks the button:

  1. An overlay opens with a claim submission form
  2. The customer describes the defect and uploads a photo
  3. W-Scrut submits the claim via the REST API using your API key
  4. Gemini Vision AI evaluates the evidence against your SKU policy
  5. The result (approved / rejected / escalated) is shown in the overlay and emailed to the customer

Receiving decisions in Shopify

Set your callback_url in Settings to a Shopify Flow webhook receiver or your own backend. See the REST Webhook guide for the callback format.

WooCommerce Plugin →REST API guide