Procurement API
Product: NEXTMEGABYTE (Greenitco ITAM) · Module: API Documentation · Audience: Developer, Administrator
This page lists the NEXTMEGABYTE REST API endpoints for procurement. All URLs are relative to your portal, for example https://your-domain.com/api/.... Authenticate first with the Login API and send the standard headers described in the API Overview. Example values are shortened and anonymized.
List procurement priorities
GET /api/procurement-priorities
Returns procurement priorities (Urgent, High, Medium, Low).
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Procurement priorities fetched successfully.",
"data": [
{
"id": 1,
"name": "Urgent",
"description": null,
"created_at": null,
"updated_at": null
},
"..."
]
}
List procurement statuses
GET /api/procurement-statuses
Returns procurement request statuses.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Procurement status fetched successfully.",
"data": [
{
"id": 1,
"name": "Created",
"created_at": null,
"updated_at": null
},
"..."
]
}
List budget categories for a department
GET /api/procurement-budget-categories/departmentID
Returns budget categories available to a department.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Budget categories fetched successfully.",
"data": [
{
"id": 3,
"text": "<string>"
},
"..."
]
}
List item units
GET /api/procurement-item-units
Returns units of measure for procurement items.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Units fetched successfully",
"data": [
{
"id": 1,
"name": "Piece"
},
"..."
]
}
List procurement requests
POST /api/procurement-list
Returns a paged list of procurement requests.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| search | String | Yes | test |
| list_size: | int | Yes | 10 |
| index | int | Yes | 0 |
| order[dir] | String | Yes | 2 |
| order[id] | double | Yes | 9 |
| filters[status] | double | Yes | test |
| filters[department] | String | Yes | test |
| filters[priority] | String | Yes | test |
| filters[cost_center] | double | Yes | test |
| filters[pab] | double | Yes | test |
| filters[approval] | String | Yes | test |
| filters[based_on] | String | Yes | test |
| filters[from_date] | String | Yes | test |
| filters[to_date] | String | Yes | test |
Example request
{ "search": "test", "list_size": "10" "index": "0", "order[dir]": "2", "order[id]": "9" "filters[status]": "" "filters[department]": "", "filters[priority]": "", "filters[cost_center]": "" "filters[pab]": "", "filters[approval]": "", "filters[based_on]": "" "filters[from_date]": "" "filters[to_date]": "", }
Top-level response fields: status, msg, total, filtered, current_index, is_prev_index, is_next_index, page, data
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Procurement fetched successfully.",
"total": 193,
"filtered": 193,
"current_index": 0,
"is_prev_index": 0,
"is_next_index": 1,
"page": 0,
"data": [
{
"id": 286,
"title": "dell Laptops Required",
"procure_tag": "<string>",
"dep_name": "<string>",
"cc_name": "<string>",
"priority": "High",
"status": "Created",
"pab": "<string>",
"vendor_id": null,
"creator_name": "<string>",
"incharge_name": "<string>",
"approval_required": "<string>",
"created_at_format": "20 Sep 2024 08:24 PM",
"updated_at_format": "20 Sep 2024 08:27 PM",
"deadline_format": "30 Sep 2024"
},
"..."
]
}
List procurement advisory boards
GET /api/procurement-pabs
Returns the PABs that can approve requests.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Procurement PAB fetched successfully.",
"data": [
{
"id": 1,
"name": "PAB A",
"description": "<string>",
"hierarchy_approval": 1,
"created_at": "2020-06-23T04:50:09.000000Z",
"updated_at": "2020-06-23T04:50:09.000000Z",
"required_minimum_approvals": 1,
"created_by": null,
"updated_by": null,
"deleted_by": null,
"deleted_at": null
},
"..."
]
}
Get procurement approvals
GET /api/procurement-request-approvals/procurementID
Returns the approval status of each PAB member for a request.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Approvals fetched successfully.",
"data": [
{
"id": 111,
"pr_id": 243,
"pab_id": 1,
"user_id": 94,
"hierarchy_approval": 1,
"hierarchy_level": 1,
"approve_status": 3,
"approved_qnum": null,
"created_at": "2024-07-22T12:04:10.000000Z",
"updated_at": "2024-07-22T12:04:10.000000Z",
"comments": null,
"approver_name": "<string>"
},
"..."
]
}
Create a procurement request
POST /api/task/procurement-add
Creates a new procurement request with its items.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | String | Yes | abc |
| description | String | Yes | abc |
| department_id | int | Yes | departmentId |
| cost_center | int | Yes | cosr |
| priority_id | int | Yes | priorityId |
| approval_required | int | Yes | if 1 its yes it 0 then no |
| pab_id | int | Yes | pabId |
| deadline | String | Yes | date of deadline |
Example request
{ "title": "task id", "description": "testme" "department_id": "1", "cost_center": "1", "priority_id": "1" "approval_required": "1", "pab_id": "1" "deadline": "29 june" }
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "New Procurement Request (PR0000287) has been created."
}
Get quotation details
POST /api/procurement-quotation-details
Returns supplier quotations for a procurement request.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| request_id | int | Yes | procurementId |
Example request
{
"request_id": "<string>"
}
Example response (shortened)
{ "msg": "Quotation details fetched successfully", "status": "success", "data": { "procurement_request_items": [ { "id": 306, "pr_id": 286, "bc_id": 9, "qty": "5.00", "unit_id": 1, "item_name": "Dell Deskstop", "description": "SSD 1TBRAM 16GB", "created_at": "2024-09-20T14:54:31.000000Z", "updated_at": "2024-09-20T14:54:31.000000Z", "unit_name": "Piece" } ], "quotation_details": null } }
List procurement departments
GET /api/procurement-departments
Returns departments that can raise procurement requests.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"msg": "Procure departments fetched successfully.",
"status": "success",
"data": [
{
"id": 1,
"name": "Developing"
},
"..."
]
}