Function
The Item Master Add API is used to insert new items into the database.
URL
{Root URL}/api/ItemMaster/Add/{API KEY |
Parameters
Parameter | Description | Required | Comment | |
1 | part_class | Part class | Y | Used to designate the new part's class. Must be a valid part class. |
2 | part_type | Part type | Y | Used to designate the new part's type. Must be a valid part type. |
3 | part_sourc | Part source | Y | Used to designate the new part's source. Must be a valid part source. |
4 | U_of_Meas | Unit of measurement | Y | The part's unit of measurement. Must be a valid unit of measurement in the system. |
5 | Pur_UOfM | Purchasing unit of measurement | Y | The part's purchasing unit of measurement. Must be a valid unit of measurement. |
6 | CustNo | Customer identifier number | Y | The customer number is used to select the customer for the part. |
7 | CustPartNo | Customer part Number | Y | Used to set the Customer's part number. |
8 | CustRev | Customer revision | Y | Used to set the revision level on the customer part. |
9 | part_No | Part number | Y | Used to set the part number. |
10 | status | Part status | Y | Used to set the part's status, and can be "active" or "inactive." |
11 | serialYes | Serial number "Yes" or "No" | Y | Can be "true" or "false" |
12 | descript | Description | Y | Can be "true" or "false" |
Example Strings
Example of Item Master Add String:
URL
?Part_Class=CAP-SMT&Part_Type=0402&Part_Sourc=make&U_Of_Meas=Each&Pur_UOfM=Each&Custno=0000000001&custpartno=n7105&custrev=Q&part_no=121-1000003&status=Active&SerialYes=False&descript=test |
JSON
{ “Part_Class”:”CAP-SMT”, “Part_Type”:”0402”, “Part_Sourc”:”make”, “U_Of_Meas”:”Each”, “Pur_UOfM”:”Each”, “Custno”:”0000000001”, “custpartno”:”n7105”, “custrev”:”Q”, “part_no”:”121-1000003”, “status”:”Active”, “SerialYes”:”False”, “descript”:”test” } |
A successful add should result in the following:
{ "$id": "1", "Code": “200”, "Message": "Inventor added successfully.", "SessionId": “null”, "IsValidUser": “true”, "ResponseObject": "0CQOOPKEFK" } |
Add New Item with InvtmfHD Information
Adding InvtmfHd information at the same time as the basic part information. For InvtmfHd parameters see: InvtmfHd Add API.
Example ItemMaster Add string with InvtmfHd Information:
JSON
{ “Part_Class”:”PARTCLASS”, “Part_Type”:”PARTTYPE”, “Part_Sourc”:”SOURCE”, “U_Of_Meas”:”UOM”, “Pur_UOfM”:”PURCHASEUOM”, “Custno”:”CUSTOMERNUMBER”, “custPartNo”:”CUSTPARTNUMBER”, “part_no”:”PARTNUMBER”, “status”:”Active”, “SerialYes”:”false”, “Descript”:”new add”, InvtmfHdList: [{ “partmfgr”:”MANUFACTURER”, “mfgr_pt_no”:”MANUFACTURER PARTNUMBER”, “MATLTYPE”:”MATERIALTYPE”, “MATLTYPEVALUE”: “MATERIALTYPE VALUE”, “ORDERPREFT”:”1”, “SFTYSTK”:”10”, “LDISALLOWBUY”:”false”, “LDISALLOWKIT”:”false”, }] } |
A successful add should result in:
{ "$id":"1", "Code": "200", "Message": "Inventor added successfully.", "SessionId": "null", "IsValidUser": "true", "ResponseObject": "UO2PKV74UE", } |
Common Errors
API Key Error
If there is an error with the entered API key, the system will return an error describing it:
{ "$id":"1", "Code": “403”, "Message": "Invalid API Key.", "SessionId": “null”, "IsValidUser": “false”, "ResponseObject": “null” } |
URL Error
If there is an error within the URL, the system will return an HTTP error:
{ "$id":"1", "Message": "No HTTP resource was found that matches the request URI 'http://localhost/api/ItemMaster/Ad/123456789'.", "MessageDetail": "No action was found on the controller 'ItemMaster' that matches the name 'Ad'." } |
Part Already in System
If the part number being added is already being used, the system will return an error message describing it:
{ "$id":"1", "Code": "403", "Message": "Inventor add failed. Part number '121-1000003' and Revision already exists for customer '0000000001'.", "SessionId": "null", "IsValidUser": "true", "ResponseObject": "null" } |
Missing Parameter
If a required parameter is missing, the system will return an error message asking for the parameter:
{ "$id": "1", "Code": "403", "Message":"Inventor add failed.Please provide description for Inventor.", "SessionId": "null", "IsValidUser": "true", "ResponseObject": "null" } |
Incorrect Parameter
If an incorrect parameter value is used, the system will return an error describing the incorrect parameter:
{ "$id": "1", "Code": "403", "Message": "Inventor edit failed.Unique_key required.", "SessionId": "null", "IsValidUser": "true", "ResponseObject": "null" } |