OPTION 5 — REST API
For retailers, agencies, and platforms who want full control over the UI. Hit one endpoint with the shopper's photo + a product image URL — get back a personalized try-on image.
POST https://www.fitmymirror.com/api/public/widget/tryon
Content-Type: application/json
{
"shopperPhoto": "data:image/jpeg;base64,..." // or https URL
"clothingUrl": "https://shop.example.com/img/blue-tee.jpg",
"itemName": "Blue Tee" // optional, used for prompting
}200 OK
{ "image": "data:image/jpeg;base64,..." // try-on result, ~1024px }
4xx / 5xx
{ "error": "Try-on failed: <reason>" }curl -X POST https://www.fitmymirror.com/api/public/widget/tryon \
-H 'Content-Type: application/json' \
-d '{
"shopperPhoto": "https://example.com/me.jpg",
"clothingUrl": "https://shop.example.com/blue-tee.jpg",
"itemName": "Blue Tee"
}'const res = await fetch("https://www.fitmymirror.com/api/public/widget/tryon", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
shopperPhoto: shopperPhotoDataUrl,
clothingUrl: product.imageUrl,
itemName: product.name,
}),
});
const { image, error } = await res.json();
if (!res.ok) throw new Error(error);
return image; // render anywherex-fmm-key)