Update a product / control try-on
const url = 'https://api.integration.tryonvirtual.com/v1/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"example","category":"eyewear","handle":"example","external_id":"example","mode":"realtime","tryon_enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.integration.tryonvirtual.com/v1/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "example", "category": "eyewear", "handle": "example", "external_id": "example", "mode": "realtime", "tryon_enabled": true }'Partial update. mode selects the try-on experience: realtime (3D asset AR) or swap (AI photo swap). Changing mode disables try-on until you re-enable it. Enabling try-on requires a category and a mode; realtime additionally requires an active 3D asset.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”Updated product
object
object
Your own product identifier (SKU, database id…). Set it at create or via PATCH, filter with GET /products?external_id=…, and use it directly in the storefront button/script in place of our id. Read-only for Shopify-platform shops.
Try-on experience. Null when no mode is set yet.
UUID of the active 3D asset (realtime mode only).
True once the product’s images have been processed for AI try-on (processing starts when images are added, typically under a minute). Only show the storefront button when this is true and tryon_status is active.
object
Example
{ "product": { "category": "eyewear", "model_type": "realtime", "tryon_status": "active" }}Invalid input
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Resource not found (or belongs to another shop)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}