Headless & Custom Storefront API

Prescription Form Builder for Custom & Headless Eyewear Sites.

Embed guided lens configuration, prescription slip uploads, and dynamic pricing add-on flows into React, Next.js, and headless ecommerce storefronts.

Embeddable Multi-Step Lens Funnel

Deploy an intuitive visual configurator modal with a single button click. Captures usage, lens package, Rx upload, manual entries, and priced coating add-ons.

  • Plug-and-play JavaScript client SDK
  • TypeScript types and callback signatures
  • Fully responsive modal overlay

Structured JSON Output for Custom Carts

Receive pristine, structured prescription metadata and price modifiers to pass directly into your custom cart state, database, or ERP.

  • Structured optical parameters (Sphere, Cylinder, Axis, PD)
  • Automated price delta calculation
  • Secure signed URLs for uploaded doctor slips

Dynamic Conditional Logic

Configure rule-based branch logic in TrynShop Studio. Show specific lens materials only when sphere power exceeds -4.00, or hide progressive options for readers.

  • Visual conditional flow builder in Studio
  • Power range validation thresholds
  • Custom question prompts and tooltips

Full CSS Customization & White-Labeling

Match your store's luxury aesthetic. Configure brand colors, border radiuses, typography, and button micro-copy directly via Studio or CSS custom properties.

  • Custom CSS variables support
  • Zero TrynShop watermarks on enterprise plans
  • Dark and light theme support

Secure Encrypted Prescription Storage

All doctor slips and patient details are handled with bank-grade encryption and GDPR/HIPAA compliance standards.

  • Encrypted at rest and in transit
  • Time-limited signed download URLs
  • Zero public bucket exposure

Pair with Virtual Try-On API

Build a seamless omnichannel optical experience by combining TrynShop's Virtual Try-On SDK with our Prescription Form SDK.

  • Shared frame and SKU identification
  • Direct handoff from AR try-on to lens selection
  • Universal optical commerce architecture

Implementation

How to Get Started in Minutes

01

Create Flow in Studio

Design your lens options, upgrade prices, and prescription questions in TrynShop Studio.

02

Embed the Script

Include the lightweight SpecForm JavaScript bundle into your web application.

03

Attach to Cart

Pass the validated prescription JSON payload directly to your headless cart API.

04

Fulfill Orders

Transmit complete lens requirements straight to your optical lab grinding system.

JavaScript Rx Modal Integration
<script src="https://cdn.trynshop.com/specform-v2.js" async></script>

<button id="choose-lenses-btn">Choose Lenses</button>

<script>
  const rxModal = TrynShopRx.create({
    apiKey: 'pk_live_your_studio_key',
    flowId: 'flow_single_vision_progressives',
    productSku: 'FRAME-AV-01',
    onComplete: (rxPayload) => {
      console.log('User completed Rx selection:', rxPayload);
      // rxPayload contains: { lensType, package, coatings: [...], rxData, fileUrl, addedPrice }
      myCustomCart.addItem({
        sku: 'FRAME-AV-01',
        attributes: rxPayload,
        priceAdjustment: rxPayload.addedPrice,
      });
    },
  });

  document.getElementById('choose-lenses-btn').addEventListener('click', () => {
    rxModal.open();
  });
</script>
FAQ

Frequently Asked Questions

Yes. SpecForm returns a structured JSON payload via the `onComplete` JavaScript callback containing selected lens types, package upgrades, doctor slip download URLs, and total priced add-ons.

Related Guides & Integrations