In addition to the many reports in L2L that report on Spares Costs, there are also a number of API endpoints so that Spares costs can be retrieved programmatically.
Costs can be attributed to both Work Orders and Dispatches. It is important to understand the relationship between Work Order costs and Dispatch costs, since costs are frequently shared between the two.
Work Orders are essentially a planning tool in L2L. Inside a Work Order, you can schedule labor, request Spares, and add External Costs. Once a Dispatch is launched, all Spares Requests are linked to both the Work Order and the Dispatch.
The following APIs can be used to report Work Order and Dispatch Spares costs:
Dispatch Spares Costs
Objective: Retrieve all Dispatch spares costs
Process Outline:
- Retrieve all Spares records for a Dispatch
GET https://[customer].leading2lean.com/api/1.0/spares/?auth=[api key]&site=[site id]&dispatchnumber=[dispatch number]
- Sum the `cost` property of all the Spares records to calculate the total cost of all Spares.
Work Order Spares Costs
Objective: Retrieve all Work Order spares costs
Process Outline:
- Retrieve all Spares records for a Work Order
GET https://[customer].leading2lean.com/api/1.0/spares/?auth=[api key]&site=[site id]&workordernumber=[work order number]
- Sum the `cost` property of all the Spares records to calculate the total cost of all Spares.