Errors
Every error code the GenFashion API returns, what it means and what to do about it.
Every error has the same shape:
{ "error": "NO_CREDITS", "message": "This workspace is out of credits." }Branch on error. Messages are written for people and can change. Any failure not listed here comes back as INTERNAL_ERROR.
Authentication#
| Code | HTTP | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | The x-api-key header is missing or the key is unknown |
KEY_REVOKED | 401 | The key has been revoked |
PUBLISHABLE_KEY_REFUSED | 401 | A publishable key was sent to an endpoint that needs a secret key |
NOT_FOUND | 404 | No such generation or customer on this account |
The request#
| Code | HTTP | Meaning |
|---|---|---|
BAD_REQUEST | 400 | The body is not JSON, or a required field is malformed |
PERSON_REQUIRED | 400 | No person was sent |
GARMENT_REQUIRED | 400 | No products were sent |
TOO_MANY_GARMENTS | 400 | More than 6 products |
BAD_IMAGE | 400 | The data could not be read as an image |
EMPTY_IMAGE | 400 | The image is empty |
UNSUPPORTED_IMAGE_TYPE | 400 | The image is not JPEG, PNG, WebP or HEIC |
FILE_TOO_LARGE | 413 | The image is over 10 MB |
SUBJECT_REQUIRED | 400 | The customer ID is missing |
Your catalogue#
| Code | HTTP | Meaning |
|---|---|---|
PRODUCT_NOT_FOUND | 400 | The external ID is not in your catalogue |
PRODUCT_IMAGES_REQUIRED | 400 | The product has no usable image |
Your account and availability#
| Code | HTTP | Meaning |
|---|---|---|
NO_CREDITS | 402 | Buy credits, then try again |
RATE_LIMITED | 429 | Wait for the time in the retry-after header |
MODEL_NOT_FOUND | 400 | The modelId you sent is not available |
BAD_MODEL | 400 | The modelId you sent is not a model code (mdl_) |
NO_MODEL | 503 | No model is available right now |
UNAVAILABLE | 503 | Try-on is briefly unavailable. Try again |
ERASURE_FAILED | 502 | The erasure could not be completed. Try again |
Photo screening#
Photos are screened before any try-on starts. A refusal uses no credit.
| Code | HTTP | Meaning |
|---|---|---|
IMAGE_REJECTED | 422 | The shopper photo was refused. The message is deliberately general |
GARMENT_REJECTED | 422 | A product image was refused. Replace it in your catalogue |
SCREENING_UNAVAILABLE | 503 | Screening could not run, so no try-on started. Try again |
Photo quality#
These checks also run before any try-on starts, and a refusal uses no credit.
| Code | HTTP | Meaning |
|---|---|---|
IMAGE_TOO_SMALL | 422 | The shopper photo is too small. The message gives its size |
IMAGE_TOO_BLURRY | 422 | The shopper photo is badly out of focus |
IMAGE_BAD_ASPECT | 422 | The shopper photo is an extreme shape, such as a banner |
GARMENT_TOO_SMALL | 422 | A product image is too small. The message names the product |
GARMENT_TOO_BLURRY | 422 | A product image is badly out of focus |
GARMENT_BAD_ASPECT | 422 | A product image is an extreme shape |
These checks do not guarantee a good photo. Only severe blur is caught, so a slightly soft photo passes.
Framing is not checked. A photo cropped at the chest passes, and the model may then invent the rest of the body. If your shoppers upload portraits, check for this on your side.
Anything else#
| Code | HTTP | Meaning |
|---|---|---|
INTERNAL_ERROR | 500 | Something went wrong on our side |
Storefront widget errors#
The storefront endpoint returns a shorter list, because its messages reach shoppers. Some messages are reworded for them while the code stays the same.
| Code | HTTP | Meaning |
|---|---|---|
CONSENT_REQUIRED | 400 | The request has no consent object |
SHOPPER_REQUIRED | 400 | The request has no X-Shopper-Id header |
Failed try-ons#
A failed try-on is not charged. The credit is only spent when a try-on reaches COMPLETED.