Point a variant at one of its product's images
Chooses the photo the picker swaps to when a buyer selects this variant. image_id: null CLEARS it and the variant falls back to the product cover.
THE PRODUCT IS DERIVED FROM THE VARIANT, never taken from the body. The whole fence on this route is "the image must belong to the same product as the variant", and a body field naming the product would be a second source of truth the caller controls.
image_id IS NULLABLE RATHER THAN OPTIONAL so "clear it" and "I forgot the field" are different requests — one of which must be a 400.
DELETING THE IMAGE LATER DOES NOT DELETE THE VARIANT: the reference is ON DELETE SET NULL, because the variant is a sellable thing with stock and orders behind it and the image is presentation.
Permission pos.catalog.write.
Authorization
bearerAuth In: header
Path Parameters
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://sandbox.505pay.link/v1/marketplace/variants/497f6eca-6276-4993-bfeb-53cbbbba6f08/image" \ -H "Content-Type: application/json" \ -d '{ "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0", "image_id": "84c230fd-5520-4984-8119-37365b66fd80" }'{
"error": "not_found",
"message": "resource not found",
"request_id": "01916b2a-f3c0-7000-0000-0000000000ff"
}{
"error": "not_found",
"message": "resource not found",
"request_id": "01916b2a-f3c0-7000-0000-0000000000ff"
}{
"error": "not_found",
"message": "resource not found",
"request_id": "01916b2a-f3c0-7000-0000-0000000000ff"
}{
"error": "not_found",
"message": "resource not found",
"request_id": "01916b2a-f3c0-7000-0000-0000000000ff"
}{
"error": "rate_limit_exceeded",
"message": "too many requests",
"request_id": "01916b2a-f3c0-7000-0000-0000000000ff"
}Was this page helpful?