Quickstart
Run your first virtual try-on with the Integration API — from API key to result image.
Quickstart
This tutorial walks through one complete try-on: obtain a public URL for a shopper photo, submit a generation, then fetch the result.
Prerequisites
- An invite-only beta business account (request access via Introduction — no self-serve signup)
- An API key created in the dashboard (copy the secret when it is shown — it is not shown again)
- A person (shopper) image file and a garment image that is already reachable over HTTPS
Base URL for the Integration API:
https://api.drapeiton.comReplace YOUR_API_KEY and file paths below with your own values.
1. Authenticate
Every Integration API request must include your API key, either as:
X-API-Key: YOUR_API_KEYor:
Authorization: Bearer YOUR_API_KEYThe examples use X-API-Key.
2. Get a presigned upload URL (person image)
Shopper photos are often not on a public CDN. Request a short-lived upload URL, then PUT the image bytes.
curl -sS -X POST "https://api.drapeiton.com/v1/uploads/presigned" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content_type":"image/jpeg"}'Example response:
{
"upload_url": "https://…",
"public_url": "https://…"
}Upload the file (same Content-Type as requested):
curl -sS -X PUT "$UPLOAD_URL" \
-H "Content-Type: image/jpeg" \
--data-binary @./person.jpgSave public_url as PERSON_URL for the next step.
You will pass a garment image as a normal HTTPS URL (for example your product CDN). Both person_image_url and garment_image_url accept any publicly reachable URL; presign is only required when you need the platform to host the bytes. See Uploading images.
3. Submit a generation
curl -sS -X POST "https://api.drapeiton.com/v1/generations" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"person_image_url": "PERSON_URL",
"garment_image_url": "https://cdn.example.com/products/shirt.jpg",
"category": "tops"
}'Successful submit returns 202 with a job id and initial status:
{
"id": "job_…",
"status": "submitted",
"created_at": "…"
}One credit is reserved when the job is accepted. See Credits.
category must be one of: tops, bottoms, one-pieces.
4. Get the result
Option A — Poll
curl -sS "https://api.drapeiton.com/v1/generations/JOB_ID" \
-H "X-API-Key: YOUR_API_KEY"Poll until status is succeeded or failed. On success, use output_url for the result image. On failure, inspect error.
Statuses and recommended client behavior: Handling results.
Option B — Webhook
If you configured a webhook URL in the dashboard, the platform POSTs generation.completed or generation.failed when the job finishes. Verify the signature before trusting the body. See Webhooks and the API Reference — Webhooks.
5. Check balance (optional)
curl -sS "https://api.drapeiton.com/v1/credits" \
-H "X-API-Key: YOUR_API_KEY"