All integrations

API

For teams building their own UI. You call the same REST endpoints the SDK uses under the hood.

When to use the API

For teams building their own UI: mobile apps, server-rendered sites, or anything that does not want our JS bundle. You call the same REST endpoints the SDK uses under the hood.

Setup steps

  1. Get keys

    Same as SDK: POST /partner/v1/admin/merchants returns your secret and publishable keys.
  2. Allow your domain

    Add your origin to allowed_origins or PARTNER_CORS_ORIGINS.
  3. Create shopper sessions (server only)

    POST /partner/v1/sessions
    Authorization: Bearer dress_sk_live_…
    
    {
      "external_user_ref": "customer-12345"
    }
    
    // Response: { "access_token": "…" }  (JWT — safe for the client)

    Never send the secret key to the client; only pass the access token.

  4. Sync catalog (server only)

    POST /partner/v1/products
    Authorization: Bearer dress_sk_live_…
    
    {
      "external_id": "SKU-001",
      "title": "Blue dress",
      "url": "https://yoursite.com/p/blue-dress",
      "image_urls": ["https://yoursite.com/img/1.jpg"],
      "gender": "women"
    }
    
    // Store the returned product_id for try-on calls
  5. Check if the shopper has a model

    GET /user-model/current
    Authorization: Bearer <shopper access_token>
    
    // null or empty → they need onboarding first
  6. Model creation

    Send the shopper to DressApp's model studio:

    Embed model studio
    GET /embed/model-studio?access_token=<token>&partner_return=https://yoursite.com/return

    Or build the URL from GET /partner/v1/embed-config (publishable key) → use public_app_url + /onboarding?access_token=….

  7. Start a try-on

    POST /tryon/{product_id}?async=true
    Authorization: Bearer <shopper access_token>
    
    // Response (HTTP 202): { "job_id": "…" }
  8. Poll for the result

    GET /tryon/jobs/{job_id}
    Authorization: Bearer <shopper access_token>
    
    // When status is "completed", the response includes image URL(s)

    Alternative: register webhooks via POST /partner/v1/webhooks for tryon.job.completed / tryon.job.failed and skip polling.

  9. Optional extras

    • Try-on history:
    • GET /tryon/history
    • Usage / quota:
    • GET /partner/v1/merchants/me/usage
    • (secret key)
    • Bill Gemini on your Google project:
    • PUT /partner/v1/integrations/google-api-key
  10. Verify before launch

    HTTPS everywhere, secret key never in client code, one full test run end to end.