Deliverable #2
API Documentation
Complete documentation of all whitelisted API endpoints for the Production Line Allocation module.
Base URL
https://erp.shangu.co.za/api/method/Authentication
Token-based (API Key + Secret)Authorization
Company-level permission modelCustom Frappe App: shangu_erp
App Name: shangu_erp
Module: Shangu Manufacturing
Custom DocTypes: Line Allocation, Production Line
Whitelisted Methods: 5 endpoints
Description
Allocate a sales order to a production line with server-side validation
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| sales_order_id | string | required | Sales Order identifier (e.g., SO-2025-0001) |
| production_line_code | string | required | Production Line code (e.g., PL-001) |
| company | string | required | Company name for permission segregation |
Example Request
POST /api/method/shangu_planning.line_allocation.allocate_line
{
"sales_order_id": "SO-2025-0001",
"production_line_code": "PL-001",
"company": "Shangu Manufacturing Ltd"
}Example Response
{
"message": {
"name": "LA-1708934523456",
"sales_order": "SO-2025-0001",
"production_line": "PL-001",
"allocated_quantity": 200,
"status": "Allocated",
"docstatus": 1
}
}Server-Side Validation Rules
•Sales Order must exist in the specified company
•Production Line must exist in the specified company
•Allocated quantity must not exceed remaining capacity
•User must have allocation permission for the company
•Sales Order status must be 'To Deliver and Bill' or 'Draft'