Developer Access

APIDOCUMENTATIONFOR TRY-ON FLOWS

Use the MEFIT API to send garment try-on requests, track queued jobs, and return generated images inside your own product.

Quick Start

Three Calls To Your First Result

Authenticate your request, submit the person and garment images, then poll the returned job id until the result is ready.

POSTsubmit try-on
GETpoll job status
Base64direct image payloads
01

Authenticate

Use your approved platform key or JWT token in the request headers.

02

Submit Images

Send the person image, garment image, garment description, and customer_id for business API calls.

03

Read Result

Poll the job endpoint and display the generated try-on image when ready.

Integration
How To Connect
BASEMEFIT_API_URL

Use the production base URL issued with your business account. Keep it in an environment variable and never hard-code secret keys in frontend code.

MEFIT_API_URL=https://api.your-mefit-domain.com
AUTHHeaders

Server-side integrations should use the issued platform key. Logged-in user flows can use a JWT bearer token. Business API calls must include a stable customer ID for usage tracking.

X-API-Key: vton_pk_your_key
X-Customer-ID: shop_user_12345
X-Session-ID: cart_session_789

Authorization: Bearer <jwt_token>
TRACKCustomer Attribution

For business keys, every generation is logged by API key and customer_id. Use your own stable customer/user ID so billing and analytics can be grouped per shopper.

customer_id=shop_user_12345
customer_email=optional@example.com
session_id=cart_session_789
metadata={"store":"delhi","sku":"dress_42"}
CURLSubmit a try-on job
curl -X POST "$MEFIT_API_URL/api/tryon" \
  -H "X-API-Key: vton_pk_your_key" \
  -H "X-Customer-ID: shop_user_12345" \
  -H "X-Session-ID: cart_session_789" \
  -F "human_image=@person.jpg" \
  -F "garment_image=@dress.png" \
  -F "garment_description=rose gold evening gown" \
  -F "customer_id=shop_user_12345"
CURLPoll the result
curl -X GET "$MEFIT_API_URL/api/jobs/job_12345" \
  -H "X-API-Key: vton_pk_your_key"
JSBrowser or Node upload flow
const form = new FormData();
form.append("human_image", personFile);
form.append("garment_image", garmentFile);
form.append("garment_description", "rose gold evening gown");
form.append("customer_id", "shop_user_12345");
form.append("session_id", "cart_session_789");

const submit = await fetch(apiUrl + "/api/tryon", {
  method: "POST",
  headers: {
    "X-API-Key": "vton_pk_your_key",
    "X-Customer-ID": "shop_user_12345"
  },
  body: form
});

const job = await submit.json();

const status = await fetch(apiUrl + "/api/jobs/" + job.job_id, {
  headers: { "X-API-Key": "vton_pk_your_key" }
});

const result = await status.json();
ERRORSStatus codes
400 Bad Request: missing image or invalid payload
401 Unauthorized: missing or invalid token/API key
429 Rate Limited: plan limit or queue protection reached
500 Server Error: generation failed unexpectedly
Reference
Endpoints

Submit a virtual try-on job with a person image and garment image. Returns a job id for status tracking.

Headers:
Authorization: Bearer <jwt_token>
or
X-API-Key: vton_pk_your_key

Body: multipart/form-data
human_image: file
garment_image: file
garment_description: string
customer_id: string, required with X-API-Key
customer_email: string, optional
session_id: string, optional
metadata: string, optional
seed: number, optional

Response:
{
  "job_id": "job_12345",
  "status": "queued"
}

Need API Access?

Submit your business request and we will review the integration use case.