Production Status
Instruction
This guide describes how to perform the following actions related to updating and retrieving production status of T&As:
- Get the list of T&As
 - Get the T&A information
 - Update the production status for multiple milestones in a T&A
 - Get the production status of a T&A on item or PO level
 
Precondition
Generate an API Key for your organization and use it to authenticate your API requests.
Steps
- 
If you don’t have the list of T&A IDs yet, use the Get List Time and Action API endpoint to retrieve the T&A IDs. You can also use the PO number query parameter to get the T&A ID.

 - 
To retrieve the milestone’s information, use the Get Time and Action API endpoint.

 - 
To update the production statuses of milestones, use the Update Time and Actions Production status API endpoint. In the request body of this API, use the JSON format.
Notes:
- You can update production status for production milestones of In Progress T&As only.
 - You can update production status for multiple milestones of the same T&As, NOT multiple T&As.
 - Based on the milestone's name, you can identify which milestone is production one, and copy the correct milestoneID from step 2 to use in step 3.
 - You have two options to update production status: either by PO Level or Item Level, which can be defined by the 
productionStatusLevelfield. The WIP quantity should be the accumulated one, ex: 1st-time update 20 units, 2nd-time update 40 units, meaning you have produced 20 units more between 2 update times. - You cannot only update the production status but also start and/or end the production milestones at the same time.
 - The 
actualStartDateandactualEndDateare optional fields in the body so if you want to update production status only, leave them asnull; or else, you can input the actual date to those fields to start or end milestones. - Each milestone can be started or ended once.
 - When a milestone is ended, its production status is considered complete with 100% and its WIP quantity is equal to the order quantity. If you input the 
actualEndDate, make sure the WIP quantity is the same as the order quantity. Otherwise, the system will consider that as two updates: firstly, it completes the milestone and updates the production status to 100%; secondly, it re-updates the production status by the quantity you input. 
Example: Update Production Status by PO Level:

Example: Update Production Status by Item Level:

 - 
To get the production status of the T&A, use the Get Time and Actions Production status API endpoint. You may input your desired query to get the T&A’s production status by item or PO level:
 
- Query param: 
productionStatusLevel:itemLevelorpoLevel 
Note: If you don’t input a query param, the system will return production status by item level by default.

Where to see the result on Inspectorio platform
- 
The updates made on the T&A using the Update Time and Actions Production status API endpoint will reflect on the T&A details page.
Example: Update Production Status by PO Level:

Example: Update Production Status by Item Level:

 - 
The message result is also visible in the Integration Center > Audit Log > Resource: “Time and Actions”.
