Riti EnterpriseOn Shopify? Get the Shopify app →

● Try-on API · SDK v1.3 · REST + signed webhooks

The outfit try-on engine, as an API.

Riti renders up to four garments onto a shopper’s own photo in one pass, styles them into ranked looks, and attributes every order that follows. One script tag goes on any storefront, with a multi-tenant API behind it.

$<script src="https://api.rititech.app/sdk/v1/riti.js"></script>
4garments per render
1bill per outfit
7signed webhook events
browser · pk_test
<!-- 1. Load the SDK (versioned, SRI-hashed) -->
<script src="https://api.rititech.app/sdk/v1/riti.js"></script>
<div id="riti"></div>
<script>
  Riti.init({
    publishableKey: "pk_test_51Nw…",
    onAddToCart(items) { cart.add(items) }, // each carries eventId
  });
  Riti.mount("#riti", { product: { id: "JK-104", title: "Linen Jacket",
    imageUrl, url, price: 148, variants } });
  Riti.launcher({ label: "Fitting room" });
</script>
Shopper's original photo The same shopper wearing the rendered three-piece look

tryon:success livemode: false

eventIdevt_8fK2Qm…
garmentsjacket · tank · trouser
billed renders1
statussucceeded · 11.8s
Before: the shopper's own photo After: the shopper wearing a cropped linen jacket, ribbed tank and wide-leg trouser input.jpgrender · 3 garments

Engine

One photo in. The whole outfit out.

The engine layers every garment in the look onto the shopper’s own photo in a single render. Shoppers see what they would actually wear, and you pay for one outfit instead of four previews.

Garments per renderup to 4
Items in a fitting roomup to 8 (configurable)
Looks returned per room3, ranked
Shopper accounts requirednone
Render providersmulti-provider, auto-fallback
Billed when a render failsnever

Explore the platform →

Stylist

It ranks real outfits and argues with the bad ones.

Wearable combinations are computed from your catalogue first (a top and bottom or a dress, plus optional outerwear, shoes and an accessory), then ranked. Every criticism ships with a swap; a criticism with no wearable alternative is dropped.

Look 1: jacket, tank and wide-leg trouser
01 · best together3 pieces

Soft tailoring, easy layers

The cropped jacket gives the wide-leg trouser a waist to work against; the ribbed tank keeps the layering light.

Look 2: tank and wide-leg trouser
02 · also works2 pieces

Warm-evening version

The same trouser without the jacket. The tank’s higher neckline keeps the silhouette from reading top-heavy.

Look 3: cropped jacket with a pleated mini skirt
we’d pair differentlyswap

Two cropped pieces at once

Both hit at the waist, so nothing anchors the outfit and the leg reads shorter.

suggested swapTry the wide-leg trouser instead →
fitting room Cropped linen jacket Ribbed knit tank Wide-leg trouser Pleated mini skirt → Style these together → 3 looks → add the whole look to cart

Quickstart

Live on a product page in three steps.

The widget, fitting room, stylist and cart hand-off ship inside the SDK. Your backend mints short-lived session tokens and reports orders. Everything else runs on Riti.

01 · browser

Mount the widget

Point it at a product. Cart lines come back through your own callback.

Riti.init({
  getSessionToken: () =>
    fetch("/riti-session", {
      method: "POST" })
    .then(r => r.json()),
  onAddToCart(items) {…},
});
Riti.mountAll();
Riti.on("tryon:success", e => {…});

02 · your server

Mint a session token

Signed, valid 1 to 60 minutes, pinned to an origin and carrying your own shopper reference.

POST /api/v1/sessions
Authorization: Bearer sk_live_…

{ "ttlSeconds": 900,
  "origin": "shop.example.com",
  "shopperRef": "cus_4471" }

→ 201 { "token": "rst_…",
        "expiresAt": "…",
        "livemode": false }

03 · your server

Report the order

Lines matched to a try-on are credited once per order line, so the revenue is auditable.

POST /api/v1/conversions
Authorization: Bearer sk_live_…

{ "orderId": "1042",
  "currency": "USD",
  "lineItems": [{
    "lineItemId": "1042-1",
    "productId": "jacket-001",
    "quantity": 1,
    "unitPrice": 148,
    "eventId": "…" }] }

→ 202 { "attributed": 1, "ignored": 0 }

Read the full docs →

Architecture

Two keys, two paths, one engine.

The browser only ever holds a publishable key or a short-lived session token. Secret keys stay server-to-server. Every tenant query runs under Postgres row-level security, scoped to tenant and mode.

Your storefront @riti/sdk · riti.js Widget · fitting room · stylist UI onAddToCart(items) → your cart pk_ key or rst_ session token Your backend sk_ key · server-to-server Mints session tokens Reports orders · receives webhooks Riti API · multi-tenant /api/widget/* origin allowlist · Turnstile · rate limit · quota Engine render providers + fallback · circuit breaker stylist · garment traits · recommendations /api/v1/* sessions · conversions · tenant Webhook worker HMAC-SHA256 · 8 attempts with backoff Postgres Row-level security per tenant and live/test mode app.tenant_id · app.livemode Object storage Rendered looks, prefixed per tenant t/<tenant>/<mode>/looks/ X-Riti-Key Bearer sk_ Riti-Signature rst_ token

Platform

The boring parts are the product.

Isolation, quotas, signatures and versioning are built in, tested against real Postgres, and documented in an OpenAPI 3.1 spec that a test keeps in sync with the routes.

keys

Publishable + secret

pk_ for the browser, sk_ for servers, each live or test. Hashed at rest, shown once, rolled with a grace window.

modes

Live and test never mix

Every shopper and usage row carries livemode. Test renders use the real engine and are never billed.

origins

Origin allowlist

A publishable key only works from your allowed origins. A request with no Origin header is refused.

sessions

Short-lived tokens

rst_ tokens, 1–60 min, optionally pinned to one origin. Require them for every caller with one setting.

webhooks

Signed events

tryon.succeeded, tryon.failed, cart.added, look.saved, conversion.attributed, catalog.sync.*.

isolation

Row-level security

Postgres refuses another tenant’s or mode’s rows even if a filter is missing. A test fails the build if a table lacks a policy.

limits

Atomic quotas

Daily and period caps are reserved before the provider is called and hold across any number of API instances.

resilience

Provider fallback

Multiple render providers sit behind a circuit breaker. An unhealthy provider is paused and the next one takes over.

sdk

Versioned + SRI

Pin /sdk/v1.3.2/ with integrity hashes from the manifest, or follow /sdk/v1/.

spec

OpenAPI 3.1

Widget and v1 routes, with a written versioning and deprecation policy.

console

Tenant console

Owner, developer and viewer roles; keys, origins, widget settings, webhooks, analytics and CSV export.

events

SDK events

ready, tryon:*, add-to-cart, look:saved, room:open|close, also dispatched as DOM events.

Console

Your keys, your usage, every delivery.

Flip between test and live data, roll a key without downtime, and redeliver any webhook from its delivery log.

Northwind/console/keysTESTLIVE
Renders this period2,480
Daily cap400
Failed (unbilled)31
KeyTypeStatusLast used
pk_test_…4f2apublishableactive2 min ago
sk_test_…91ccsecretactive14 min ago
sk_test_…07besecretrolling · 23h left1 h ago

Example data

Webhook deliverieshttps://shop.example.com/hooks/riti
  1. 17:42:09conversion.attributed200
  2. 17:41:55cart.added · 3 lines200
  3. 17:41:31look.saved · consent ✓200
  4. 17:41:02tryon.succeeded · 3 garments200
  5. 17:38:47tryon.succeeded · 1 garmentretry 2/8
  6. 17:36:12tryon.failed · provider_timeout200
Riti-Signature: t=1730480529,v1=9b1f0c7e2a… · example data

Attribution

Revenue matched to an order line, not a session guess.

Each cart line carries the try-on’s eventId. When your backend reports the order, matching lines are credited once. The multi-item funnel sits next to the ordinary try-on funnel.

Fitting-room funnel · last 30 days

Example data
Items added to a room
2,106
Rooms styled
611
Combinations proposed
1,833
Looks rendered
742
Looks added to cart
268
Orders with a look
97

Modules

Switch on what you need.

Optional modules are turned on per tenant and loaded by the SDK only where they are on. The first is Recommendations. The roadmap is listed beside it.

module · available

Recommendations

Sync your catalogue by feed or API, and Riti suggests the pieces that complete the look on the product page. Suggestions stay inside a price band you set and come from items you stock.

Viewing: cropped linen jacket
viewing
Suggested: ribbed knit tank
+ tank
Suggested: wide-leg trouser
+ trouser
on the roadmap

What we’re building next

  • SSO for the console (SAML / OIDC)roadmap
  • @riti/sdk on npm · React, Vue, <riti-try-on>roadmap
  • Headless API mode · async render jobsroadmap
  • Native iOS and Android SDKsroadmap
  • Data residency · DSR API · audit logroadmap

Security & privacy

Built for a security review.

Shoppers never create an account. Photos are used for the render; saved looks require an email and explicit consent, and are handed to you via look.saved so you send the email.

Isolation

  • Postgres row-level security per tenant and mode
  • Tenant-prefixed object storage
  • Integration tests against real Postgres

Transport & secrets

  • Keys stored as SHA-256 hashes
  • Webhook secrets AES-256-GCM encrypted
  • SSRF-safe sender: public https only, checked on the resolved address

Abuse & cost

  • Origin allowlist, optional Turnstile
  • Per-shopper and per-tenant rate limits
  • Daily caps and atomic period quotas

SOC 2 compliant infrastructure. Hosting, Postgres and object storage run on Railway, which holds a SOC 2 Type II report. Rendering runs through Google Cloud.

Security details →

on the roadmap  SSO, a DPA template and regional data residency are planned, not yet available.

Pricing

Pay for renders, not seats.

Usage is metered from the same ledger your console shows. Contract plans are sized to your catalogue and traffic.

Enterprise · usage-based

Priced per successful render.

Committed volume, caps you set, and a test environment that costs nothing. We size a plan with you after a look at your catalogue and traffic.

A styled outfit counts onceUp to four garments in one render, billed as one.
Failed renders are freeOnly a successful render is metered.
Test mode is never billedReal engine, separate daily cap, zero charge.
Caps you controlDaily and period limits stop a viral week becoming a surprise invoice.

Demos

Two reference stores, both integration paths.

Fictional storefronts running against the production API, with a live webhook feed and isolation probes beside the product page.

Sample render: a black belted trench over a floral midi skirt
publishable key

Northwind

The simplest path: one script tag, a pk_ key and an origin allowlist.

See the demo →
Sample render: a textured monochrome outfit
session tokens

Ember & Oak

Backend-minted rst_ tokens with a shopper ref, order reporting and signed webhooks.

See the demo →

FAQ

Questions engineering asks first.

Do we need to be on a particular commerce platform?

No. The SDK runs on any site that can load a script, and your cart integration is a single onAddToCart(items) callback. Order reporting is one authenticated POST from your backend.

Can a scraped publishable key be abused?

A publishable key is refused without a browser Origin from your allowlist. For stricter setups, turn on requireSessionToken so every caller needs a token your backend minted with the secret key.

How is test data kept out of production numbers?

Test keys and tokens produce rows with livemode: false; row-level security scopes every query to the mode, and test renders are never billed.

What happens to a shopper’s photo?

It is used for the render. Rendered looks are stored under your tenant’s prefix; saved looks require an email and consent, and the email itself is yours to send via the look.saved webhook.

What if the render provider has a bad day?

Riti runs multiple providers behind a circuit breaker. Failed renders are not billed, and quota units are returned when the provider was never called.

Do you offer SSO, SOC 2 or data residency?

Riti runs on SOC 2 compliant infrastructure: hosting, Postgres and object storage on Railway, which holds a SOC 2 Type II report, and rendering through Google Cloud. SSO for the console and regional data residency are on the roadmap. We walk through the full stack in a security review.

Get test keys and a working demo in one call.

We set up a test tenant, wire it to one of your product pages, and walk your team through the console.