Skip to main content

Upload Product Media

POST/products/upload
Uploads a file (product image, extra image, or digital file) and returns a media id. Pass that id to Create Product / Update Product as image.file.response.id (or inside product_files[] / extra_images[]).

Authentication

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Content-Typemultipart/form-dataYes

Query Parameters

ParameterTypeRequiredDescription
typestringNoimage (main, default), extra_image, or file (digital file)

Body (multipart/form-data)

FieldTypeRequiredDescription
filefileYesFor image/extra_image: jpg, jpeg, png, gif (max 10 MB). For file: jpg, mp4, jpeg, png, gif, pdf, zip, docx, txt (max ~117 MB)

Example Request

curl -X POST "https://merchant-api.rmz.gg/shawarma/products/upload?type=image" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@/path/to/product.jpg"

Success Response

200 OK
{
  "message": null,
  "data": {
    "id": 9001,
    "type": "main_product_image",
    "name": "product.jpg",
    "file_name": "a1b2c3....jpg",
    "path": "products/images/",
    "mime_type": "image/jpeg",
    "size": 48213
  },
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}

Where to use the returned id

Map each upload type to the create/update field that references the returned data.id:
Upload typeUse in create/update as
imageimage.file.response.id (main product image)
extra_imageextra_images[].file.response.id (gallery)
fileproduct_files[].file.response.id (digital file — product/license types)
{
  "image": { "file": { "response": { "id": 9001 } } },
  "extra_images": [ { "file": { "response": { "id": 9101 } } } ],
  "product_files": [ { "file": { "response": { "id": 9002 } } } ]
}

Error Responses

CodeDescription
401Unauthorized — invalid or missing token
403Plan does not include the API feature
422Invalid file type or file too large