MIZUYA API

GET Endpoints

Get All Vendors

Retrieves all vendors

GET /api/vendors

Response (200):

[
  {
    "_id": "objectId",
    "name": "string",
    "website": "string",
    "logoLink": "string",
    "products": [
      "objectId"
    ]
  }
]

Error (500): Failed to get vendors

Get Vendor by ID

Retrieves a specific vendor by ID

GET /api/vendor/:id

Parameters:

• id (string, required): Vendor ID

Response (200):

{
  "_id": "objectId",
  "name": "string",
  "website": "string",
  "logoLink": "string",
  "products": [
    "objectId"
  ]
}

Error (400): Vendor ID is required

Error (500): Failed to get vendor

Get All Products

Retrieves all products

GET /api/products

Response (200):

[
  {
    "_id": "objectId",
    "name": "string",
    "mostRecentPrice": 0,
    "mostRecentDate": "date",
    "mostRecentAvailability": true,
    "link": "string",
    "imageLink": "string",
    "vendor": "objectId",
    "history": [
      {
        "date": "date",
        "availability": true,
        "price": 0
      }
    ]
  }
]

Error (500): Failed to get products

Get Product by ID

Retrieves a specific product by ID

GET /api/product/:id

Parameters:

• id (string, required): Product ID

Response (200):

{
  "_id": "objectId",
  "name": "string",
  "mostRecentPrice": 0,
  "mostRecentDate": "date",
  "mostRecentAvailability": true,
  "link": "string",
  "imageLink": "string",
  "vendor": "objectId",
  "history": [
    {
      "date": "date",
      "availability": true,
      "price": 0
    }
  ]
}

Error (400): Product ID is required

Error (500): Failed to get product