Add Product Image
POST/api/products/:product/images
Add a new image to a product. The image field accepts EITHER an uploaded file (multipart/form-data) OR a URL / base64 string (application/json).
Authentication: Requires Bearer token.
Mode 1 — File upload (multipart/form-data):
- image (required, file): image file uploaded from the device. Allowed types: jpg, jpeg, png, gif, webp. Max size: 10 MB (10240 KB).
Mode 2 — URL or base64 string (application/json):
- image (required, string): image URL or base64 encoded data URI.
Common optional fields (both modes):
- name (optional, max 255): image display name
- sort_order (optional, integer): display order
- is_primary (optional, boolean): set as the primary product image
- download (optional, boolean): URL mode only — if true, downloads and stores the image from the URL
Request
Responses
- 200
Successful response