Media & Uploads API

Endpoints for uploading product images, logos, and general media.

Base: /api/v1/admin  |  X-Tenant-ID required  |  Requires auth & admin role 🔒
Important: All these endpoints expect multipart/form-data. Uploaded images are hosted locally and can be accessed via https://alopay-api.pgwiz.cloud/uploads/....
POST /api/v1/admin/media/upload 🔒 Auth Required

Upload a general image to a specific folder.

Request Body

FormData:
  image: (File)
  folder: "banners" (Optional. Defaults to "general")

Response

{ "success": true, "data": { "url": "/uploads/banners/170000000-banner.jpg" } }
POST /api/v1/admin/products/:id/images 🔒 Auth Required

Upload an image for a specific product. Automatically attaches it to the product.

Request Body

FormData:
  image: (File)
  is_primary: "true" | "false" (Optional)

Response

{ "success": true, "data": { "image": { "id": "uuid", "url": "/uploads/products/1700000-shoe.jpg", "is_primary": true } } }
POST /api/v1/admin/settings/logo 🔒 Auth Required

Upload the store logo.

Request Body

FormData:
  logo: (File)

Response

{ "success": true, "data": { "logo_url": "/uploads/branding/logo-17000.png" } }
POST /api/v1/admin/settings/favicon 🔒 Auth Required

Upload the store favicon.

Request Body

FormData:
  favicon: (File)

Response

{ "success": true, "data": { "favicon_url": "/uploads/branding/favicon-17000.ico" } }
DELETE /api/v1/admin/products/:id/images/:imageIndex 🔒 Auth Required

Delete a specific image from a product by its array index (0-based).

Response

{ "success": true, "data": { "images": [ { "url": "...", "is_primary": true } ] } }
DELETE /api/v1/admin/settings/logo 🔒 Auth Required

Delete the store logo (sets URL to null).

Response

{ "success": true, "data": { "brand_logo_url": null } }
DELETE /api/v1/admin/settings/favicon 🔒 Auth Required

Delete the store favicon (sets URL to null).

Response

{ "success": true, "data": { "brand_favicon_url": null } }