Endpoint:GET https://mt.itserver.biz/admin/indexyii.php?r=API/GetProductsDataMt
Authentication Headers:
| Header | Type | Description |
|---|---|---|
| X-USERNAME | string | Authorized ERP username |
| X-PASSWORD | string | Authorized 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:
| Field | Type | Description |
|---|---|---|
| products_id | int | ERP product ID |
| Category | string | Product category name |
| Product | string | Product description |
| ProductCde | string | Product code/model (SKU) |
| DozinCtn | float/int | Dozen-per-carton (PkgQty) |
| Rate | decimal | Latest price from m_price (most recent efdfrom, created as tiebreak) |
| EfdFrom | date | Effective date of the latest price (YYYY-MM-DD) |
| PrevEfdFrom | date | null |
Notes:
- Authentication is required via headers.
- The SQL currently filters by
p.categoryid = 1. - Latest price is selected using
OUTER APPLYordered byefdfrom DESC, created DESC. PrevEfdFromis computed as the lastefdfromstrictly before the latest for each product.- Consider adding pagination and/or a category filter if the dataset grows large.
- Response content type:
application/json.