Skip to content

Render a person wearing one or more trial garments

POST
/v1/try-on
curl --request POST \
--url https://example.com/v1/try-on \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "user_image": "uploads/01JUSER000000000000000000/person.jpg", "user_category": "FEMALE", "items": [ { "trial_image": "uploads/01JITEM000000000000000000/shirt.jpg", "trial_item_category": "top" } ] }'

Dispatch a virtual try-on: apply one or more trial garments to a person image. Pass the upload_key (from POST /v1/uploads) of the person photo as user_image, and one entry per garment in items (each with its own trial-image key + category). Returns 202 immediately with a job_id; poll GET /v1/jobs/{job_id}/events for live progress and GET /v1/jobs/{job_id} for the terminal render. Costs 10 credits, refunded automatically on any failure path.

X-Shopify-Hmac-Sha256
Any of:
string
Media type application/json
TryOnRequest

Try-on submission.

object
user_image
required
User Image

S3 object key of the person image to try the items on.

string
user_category
Any of:
UserCategory

User gender. Matches studio.schema.common.UserCategory.

string
Allowed values: MALE FEMALE
items
required
Items

One or more trial items to apply to the user image.

Array<object>
>= 1 items
TrialItemInput

One trial garment passed to /v1/try-on.

object
trial_image
required
Trial Image

S3 object key of the trial garment image.

string
trial_item_category
required
Trial Item Category

Garment category key (e.g. ‘top’, ‘shirt’, ‘jeans’). See studio.schema.common.TryItemCategory for the full list.

string
runtime_config
Any of:
object
key
additional properties
any
render_params
Any of:
RenderParams

Rendering options for the try-on output. Mirrors studio.schema.tryon.RenderParams.

object
resolution
Any of:
RenderResolution

Output image-size tier. Mirrors studio.schema.tryon.RenderResolution.

string
Allowed values: 0.5K 1K 2K 4K
Examples
Example single_garment

One garment on a person image

{
"user_image": "uploads/01JUSER000000000000000000/person.jpg",
"user_category": "FEMALE",
"items": [
{
"trial_image": "uploads/01JITEM000000000000000000/shirt.jpg",
"trial_item_category": "top"
}
]
}

Accepted — job queued. Poll /v1/jobs/{job_id} for progress.

Media type application/json
WorkflowAcceptedResponse

Returned synchronously from any POST /v1/{name} (202).

object
request_id
required
Request Id

26-char ULID — correlates with the row in request_logs.

string
job_id
required
Any of:
string
status
JobStatus

Studio’s job status at submit time. Almost always NOT_STARTED in this 202.

string
default: NOT_STARTED
Allowed values: NOT_STARTED IN_PROGRESS SUCCESS FAILURE
credits_cost
required
Credits Cost

Credits deducted from the calling client. Refunded automatically on any failure path.

integer
Example
{
"request_id": "01JREQREQREQREQREQREQREQ00",
"job_id": "01JOBJOBJOBJOBJOBJOBJOBJOB0",
"status": "NOT_STARTED",
"credits_cost": 10
}

Insufficient credit balance — the request cost exceeds the client’s balance. No job created.

Media type application/json
Example
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Account balance is below the cost of this request.",
"request_id": "01JREQREQREQREQREQREQREQ00"
}
}

Request body failed validation (missing/invalid fields). No credits charged.

Media type application/json
Example
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request body or parameters failed validation.",
"request_id": "01JREQREQREQREQREQREQREQ00"
}
}

Per-credential rate limit exceeded. Retry after a short backoff.

Media type application/json
Example
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded; try again shortly.",
"request_id": "01JREQREQREQREQREQREQREQ00"
}
}