Endpoint:
GET https://mt.itserver.biz/admin/indexyii.php?r=API/GetProductsDataMt

Authentication Headers:

HeaderTypeDescription
X-USERNAMEstringAuthorized ERP username
X-PASSWORDstringAuthorized ERP password

Query Parameters:
This endpoint does not require query parameters. It returns product master records for category ID = 1 along with the latest price and the previous effective date for each item.

Example Request:

GET https://mt.itserver.biz/admin/indexyii.php?r=API/GetProductsDataMt
Headers:
X-USERNAME: Nehal
X-PASSWORD: ********

Sample Success Response:

{
  "success": true,
  "data": [
    {
      "products_id": 101,
      "Category": "Dairy",
      "Product": "Nestle Milk 1L",
      "ProductCde": "NEST-MILK-1L",
      "DozinCtn": 1,
      "Rate": 180.00,
      "EfdFrom": "2025-09-01",
      "PrevEfdFrom": "2025-07-15"
    }
  ]
}

Error Example:

{
  "success": false,
  "message": "Invalid authentication credentials"
}

Response Fields:

FieldTypeDescription
products_idintERP product ID
CategorystringProduct category name
ProductstringProduct description
ProductCdestringProduct code/model (SKU)
DozinCtnfloat/intDozen-per-carton (PkgQty)
RatedecimalLatest price from m_price (most recent efdfrom, created as tiebreak)
EfdFromdateEffective date of the latest price (YYYY-MM-DD)
PrevEfdFromdatenull

Notes:

  • Authentication is required via headers.
  • The SQL currently filters by p.categoryid = 1.
  • Latest price is selected using OUTER APPLY ordered by efdfrom DESC, created DESC.
  • PrevEfdFrom is computed as the last efdfrom strictly before the latest for each product.
  • Consider adding pagination and/or a category filter if the dataset grows large.
  • Response content type: application/json.

Leave a Reply

Your email address will not be published. Required fields are marked *