Skip to main content
POST
/
v1
/
product_medias
Create
curl --request POST \
  --url https://{defaultHost}/v1/product_medias \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "product_media": {
    "product_id": "8a8b1ca7-9b66-4311-b132-98d5ccbea28f",
    "media_id": "b65a13eb-6b20-4983-b1b1-8a30a487d991"
  }
}
'
{
  "id": "2e98debc-6334-4607-9ed9-9985dd5ace22",
  "object": "product_media",
  "alt": null,
  "position": 0,
  "title": null,
  "url": null,
  "media": "b65a13eb-6b20-4983-b1b1-8a30a487d991",
  "product": "8a8b1ca7-9b66-4311-b132-98d5ccbea28f",
  "created_at": 1770234876,
  "updated_at": 1770234876
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
product_media
object

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

alt
string | null

The HTML alt attribute for the product media.

position
integer | null

The ordering position of this product media when displayed to customers.

title
string | null

The HTML title attribute for the product media.

url
string | null

Instead of attaching a Media record, a public URL can be set. If set, this URL will be used to serve the product media asset.

media

Expandable – The associated media ID.

product

Expandable – The associated product ID.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.