Products
Get product media
Returns the media of the Product and of each Variant.
GET
Returns, in one response, the Product media (product) and the media of every Variant (variants), in the order of List variants. A Variant with no media comes with media: []. Each item points to an Asset (assetId) and has a role and a position.
Use it before replacing the media, to see what is already there. To see the picture itself, fetch the Asset with Get asset.
curl "$API/v1/products/$PRODUCT_ID/media" \
-H "Authorization: Bearer $API_KEY"api_keyheader
AuthorizationBearer <token>API key (mk_...)
productId*stringMatch
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Format
uuidThe media of the product and of each of its variants.
application/json- response
The media of a product and of each of its variants.
productId*stringProduct the media belongs to.
Match
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Format
uuidproduct*array<>Ordered product media.
variants*array<>Every variant of the product, in the order GET /v1/products/{productId}/variants lists them.
curl -X GET "https://example.com/v1/products/497f6eca-6276-4993-bfeb-53cbbbba6f08/media"{ "productId": "a0f0ce59-5d17-49bf-8b45-d1dc057daab4", "product": [ { "assetId": "4a7f2701-c5f7-477f-9658-5ce6be74ef80", "role": "image", "position": 0 } ], "variants": [ { "variantId": "47c9f819-fcf6-4478-b21a-678ecc594a11", "media": [ { "assetId": "4a7f2701-c5f7-477f-9658-5ce6be74ef80", "role": "image", "position": 0 } ] } ]}