Next Commerce
Products

Products Image Create

Create a new image in an existing product.

POST
/products/{id}/images/

Authorization

oauth2 catalogue:write
AuthorizationBearer <token>

Generate an Access Token through Settings > API Access for single store access or use the Authorization Code flow with your partner App Client ID. Use required permission scopes for API endpoint access. Example Authorization: Bearer 123

In: header

Scope: catalogue:write

Path Parameters

id*integer

A unique integer value identifying this Product.

Header Parameters

X-29next-API-Version*string
Default"2023-02-10"
Value in"2023-02-10"

Request Body

attachment?|

The base64 string file to upload (image attachment).

caption?string
Lengthlength <= 200
display_order?integer

An image with a display order of zero will be the primary image for a product

Range0 <= value <= 2147483647
file_name?string
src?|

URL of the image to fetch and associate with the product

Formaturi

Response Body

application/json

curl -X POST "https://example.29next.store/api/admin/products/0/images/" \
  -H "X-29next-API-Version: 2023-02-10" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "attachment": "string",
  "caption": "string",
  "display_order": 2147483647,
  "file_name": "string",
  "id": 0,
  "src": "http://example.com"
}