Skip to main content

Upload Product Option Image (v1)

Method & Path

POST /api/v1/workspace/:workspaceId/storefront/product-options/:optionId/image

Actual backend path: /v1/workspace/:workspaceId/storefront/product-options/:optionId/image

Description

Upload an image for a store-level product option. Accepts PNG, JPEG, or WebP (max 5 MB). Image is processed and stored as WebP.

Authentication

Required: JWT token in Authorization header.

Required Permissions: store.products.manage

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>
Content-TypestringYesmultipart/form-data

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
optionIdstringYesProduct option identifier

Request Body

Multipart form with a single file field:

FieldTypeRequiredDescription
filefileYesImage file (PNG, JPEG, or WebP; max 5 MB)

Response 201 Created

{
"optionId": "507f1f77bcf86cd799439011",
"imageUrl": "https://storage.googleapis.com/bucket/path/image.webp"
}

Common Errors

  • 400 Bad Request: Missing file or invalid optionId
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions or storage quota exceeded
  • 404 Not Found: Workspace, store, or product option not found
  • 422 Unprocessable Entity: Image too large or unsupported type
  • 500 Internal Server Error: Server error