Skip to content

Check garment compatibility

POST
/v1/compatibility/check
curl --request POST \
--url https://example.com/v1/compatibility/check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "product_garment_category_public_id": "example", "candidate_complementary_image_public_ids": [ "example" ] }'

Evaluate candidate complementary garments against a product category.

Unknown candidate image ids come back as per-candidate catalog_ref_missing verdicts inside the 200; an unknown product category is a 404 RESOURCE_NOT_FOUND.

X-Shopify-Hmac-Sha256
Any of:
string
Media type application/json
CompatibilityCheckRequest

POST /v1/compatibility/check body.

The product side is a garment category public_id; the candidate side is a list of complementary-garment catalog image public_ids (what the wizard’s picker holds — each is resolved to its category server-side).

object
product_garment_category_public_id
required
Product Garment Category Public Id

ULID public_id of the product’s garment category.

string
candidate_complementary_image_public_ids
Candidate Complementary Image Public Ids

Complementary-garment catalog image public_ids to evaluate.

Array<string>
Example generated
{
"product_garment_category_public_id": "example",
"candidate_complementary_image_public_ids": [
"example"
]
}

Successful Response

Media type application/json
CompatibilityCheckResponse

POST /v1/compatibility/check response — one verdict per candidate, in request order.

object
product_garment_category_public_id
required
Product Garment Category Public Id

The product garment category (echoed).

string
results
Results

Per-candidate verdicts, in request order.

Array<object>
CompatibilityResultResponse

The per-candidate verdict of a compatibility check.

object
public_id
required
Public Id

The candidate’s catalog image public_id (echoed).

string
compatible
required
Compatible

Whether the candidate may appear with the product garment.

boolean
reasons
Reasons

Structured reasons for the verdict.

Array<object>
CompatibilityReasonResponse

One structured reason inside a candidate verdict.

object
code
required
Code

Structured compatibility code (or catalog_ref_missing).

string
message
required
Message

Human-readable explanation of the code.

string
Example generated
{
"product_garment_category_public_id": "example",
"results": [
{
"public_id": "example",
"compatible": true,
"reasons": [
{
"code": "example",
"message": "example"
}
]
}
]
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}