POST
Add product images
Company space For: Manager · Permission: product_images.retrieve Conditions
  • The permission needed is product_images.retrieve.
  • Each image must be a jpeg, png, jpg, gif or svg file of at most 2048 kilobytes.
  • The legacy action answers a server error even after storing the files, because it loads the undefined relation Product::options while building the response.
What else happens
  • Stores each file as one picture of the product.
  • The images are stored and stay attached even though the call answers an error.
Part of Create products and variants.

Authorizations

Authorization
string
header
required

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

Path Parameters

product
string
required

Identifier of the product that receives the images (27-character KSUID).

Body

multipart/form-data
images
object[]
required

List of pictures to attach to the product. Required.

Response

ProductResource

id

Identifier of the product (27-character KSUID).

handle

Short text identifier of the product, unique within the organization. Built from the title when it was not sent at creation.

status_counts
object

Number of variants of the product in each item status (active, draft, archived).

type

Kind of product: physical, digital or service.

tags

Tags as one text separated by semicolons, or null when none.

published_at

Publication date and time in ISO 8601, or null while the product is not published. It is left empty at creation.

title

Display name of the product.

description

Free text description; an empty string when none was given.

is_tracked
boolean

Whether stock is tracked for the variants of this product. Changing it also changes the tracking of all its variants.

uom_category_id

Identifier of the unit-of-measure category that defines the units the product's variants are sold and stocked in (27-character KSUID). It cannot be changed after creation.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).

options
any[]

Options of the product (for example size, colour; stored in lower case), each with its id, name and the list of values used by its variants. Present only when the product's option values are loaded.

variants
array

Variants of the product. Present only when requested with include=variants.

images
array

Pictures of the product. Present only when requested with include=images.

category
object | null

Catalog category of the product, or null when it has none. Present only when requested with include=category.

organization_id

Identifier of the organization the record belongs to.