Developer Docs/Virtual Try-On API

Virtual Try-On API

Build Virtual Try-On integrations with A2E. Review authentication, request parameters, task creation, status, and result endpoints.

Overview

Generate a realistic preview of a person wearing a specific garment from a product image - no physical samples required.

Primary Endpoint

POST/api/v1/virtualTryOn/start

Start virtual try-on task

Request Parameters

NameTypeRequiredDescription
namestringNoName of the virtual try-on task
image_urlsarray<string>YesArray of 2 image URLs - [0] person image, [1] clothing image
timeoutnumberNoProcessing timeout in seconds
webhook_urlstringNoHTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth.
webhook_tokenstringNoOptional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e.

Request Example

curl -X POST "https://www.a2e.com.cn/api/v1/virtualTryOn/start" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Summer Dress Try-On",
  "image_urls": [
    "https://example.com/person.jpg",
    "https://example.com/dress.jpg"
  ],
  "timeout": 120,
  "webhook_url": "https://your-server.example.com/a2e/webhook",
  "webhook_token": "a-shared-secret"
}'

Related Endpoints

POST/api/v1/virtualTryOn/start

Start virtual try-on task

GET/api/v1/virtualTryOn/allRecords

Get all virtual try-on records

POST/api/v1/virtualTryOn/batchDetail

Batch query task details

GET/api/v1/virtualTryOn/{_id}

Get virtual try-on task detail

DELETE/api/v1/virtualTryOn/{_id}

Delete virtual try-on task

Responses

200

Virtual try-on task started successfully

400

Bad Request - Invalid parameters

401

Unauthorized - Invalid or missing bearer token