DrapeItOnDrapeItOn
Guides

Handling results

Poll generation status or use webhooks to receive try-on outcomes.

Handling results

Generations are asynchronous. After POST /v1/generations returns 202, wait for a terminal status before showing a result to a shopper.

Customer-facing statuses

StatusClient action
submittedIn progress — wait
queuedIn progress — wait
processingIn progress — wait
succeededUse output_url
failedRead error.code / error.message; do not use output_url

Option A — Polling

curl -sS "https://api.drapeiton.com/v1/generations/JOB_ID" \
  -H "X-API-Key: YOUR_API_KEY"

Poll on an interval appropriate for your UX (for example every few seconds) until status is succeeded or failed. Back off if you poll aggressively; the API is rate-limited per API key (see Errors and retries).

On success, fields of interest include output_url, category, and timestamps. On failure, error is present.

Option B — Webhooks

If a webhook is configured for the account, the platform POSTs when a job finishes:

  • generation.completed — success (data.status is succeeded, includes output_url)
  • generation.failed — failure (data.status is failed, includes error)

Verify signatures and return 2xx quickly. Full payload schemas and delivery behavior: Webhooks and API Reference — Webhooks.

Combining both

Common pattern: register a webhook for production, and use polling as a fallback (e.g. timeout if no webhook, or for tools/scripts).

On this page