v1

latestOpenAPI 3.0.3raw.githubusercontent.com2024-10-2916802.4 MB
🛒 Ecommerce

Get product by id

The API retrieves a product based on the provided productId passed as a path variable.

This API serves as a means to fetch specific product information from the backend based on a unique identifier.

By passing the productId in the URL, the API searches and retrieves the corresponding product details, including attributes such as name, price, description, stock, images and any other relevant information associated with the product.

get/ecommerce/products/{productId}

Response

Get product by id

messagestring
statusCodenumber
successboolean

Example response

{
  "data": {
    "_id": "649e792a64e7dba29b7266f0",
    "category": "649e792a64e7dba29b7265fe",
    "createdAt": "2023-06-30T06:41:46.445Z",
    "description": "Carbonite web goalkeeper gloves are ergonomically designed to give easy fit",
    "mainImage": {
      "_id": "649e792a64e7dba29b7266f1",
      "url": "https://loremflickr.com/640/480/product?lock=4496371623133184"
    },
    "name": "Recycled Granite Gloves",
    "owner": "649e792964e7dba29b7263a4",
    "price": 413,
    "stock": 47,
    "subImages": [
      {
        "_id": "649e792a64e7dba29b7266f2",
        "localPath": "",
        "url": "https://loremflickr.com/640/480/product?lock=5094563479814144"
      },
      {
        "_id": "649e792a64e7dba29b7266f3",
        "localPath": "",
        "url": "https://loremflickr.com/640/480/product?lock=1134715742453760"
      },
      {
        "_id": "649e792a64e7dba29b7266f4",
        "localPath": "",
        "url": "https://loremflickr.com/640/480/product?lock=1975560538423296"
      },
      {
        "_id": "649e792a64e7dba29b7266f5",
        "localPath": "",
        "url": "https://loremflickr.com/640/480/product?lock=4972727878287360"
      }
    ],
    "updatedAt": "2023-06-30T06:41:46.445Z"
  },
  "message": "Product fetched successfully",
  "statusCode": 200,
  "success": true
}