Skip to main content
UniFit
Developer Engineering7 min read•Published 2026-11-24•Updated 2026-11-27

How to Integrate a Size Recommendation API Into an Ecommerce Store

Architecture blueprint for engineers connecting React, Shopify, or native mobile checkouts to a privacy-scoped sizing API.

Author: UniFit Platform Engineering (Developer Relations)
Sizing APIOAuth PKCEWebhooksSDK

Key Takeaways

  • Keep server secret keys (uf_live_*) strictly on backend services while using publishable keys on product pages.
  • Use OAuth 2.0 + PKCE (S256) to obtain short-lived size recommendation tokens and verify webhook HMAC signatures.

1. Sync Product Catalogs and Garment Size Specs

Begin by synchronizing product IDs, SKU variants, apparel category tags, fabric stretch classification, and canonical centimetre garment tables via REST endpoints or CSV batch import.

2. Obtain Shopper Permission via OAuth 2.0 + PKCE

When a shopper clicks Find My Size on a storefront, redirect or open a popup to UniFit authorization using a S256 PKCE code challenge. Exchange the one-time authorization code server-side for a short-lived scoped grant.

3. Request Garment Recommendations & Handle Feedback

POST the productId, variantId, and scoped grantToken to /v1/recommendations from your server or via our 1-line auto-mount storefront widget. Subscribe to HMAC-signed webhooks to sync fit feedback and return attribution automatically.

Put This Guide Into Practice

Use UniFit's interactive sizing tools or connect your brand storefront.

Open Fashion Sizing API & Docs

Related Articles

All Articles