Products

Get product media

Returns the media of the Product and of each Variant.

GET
/v1/products/{productId}/media

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"

Authorization

api_key
headerAuthorizationBearer <token>

API key (mk_...)

Path Parameters

productId*string
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)$
Formatuuid

Response Body

The media of the product and of each of its variants.

application/json
  1. response

The media of a product and of each of its variants.

productId*string

Product 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)$
Formatuuid
product*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        }      ]    }  ]}