Company Context
PROTOTYPE MODE
Logged in as
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 model

Custom 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

NameTypeRequiredDescription
sales_order_idstringrequiredSales Order identifier (e.g., SO-2025-0001)
production_line_codestringrequiredProduction Line code (e.g., PL-001)
companystringrequiredCompany 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'