By calling the URL endpoint with the POST method, this endpoint returns a JSON object with new created Work Order ID and Work Order Number.
Example:
Post the JSON object in body request for the work order whose JSON looks like sample below (call URL https://api.erpag.com/workorder/bom/add with POST method and JSON body).
When sending a request the API endpoint will check Item existence and return an error with the message that the Item was not found. The Item type in Product and Services must be Bill Of Materials (BOM).
Body JSON sample:
{
"description": "WorkOrder (BOM) from API",
"tag":"#332212324",
"output_items": [
{
"id": "NJJB4I3FJNJD94GW",
"sku": "0007",
"qty": 1
},
{
"id": "JREDNV4JSD93344B",
"sku": "0008",
"qty": 3
}
]
}Explanation:
- description – Description of Work Order (optional)
- tag – Work Order Tag (optional)
- output_items – array of work order output line items (finished goods based on BOM)
- Output Items:
- id – The Item ID (optional)
- sku – The Item SKU number (mandatory)
- qty – line item quantity (mandatory)
Result:
{
"id": "843ZZ0ID1P2IKCVD",
"number": "WO-000015"
}Explanation:
id – ID of created Work Order
number – Work Order Number
Note: Access to this API endpoint is allowed only for selected API User account using the API key and API password in the request header with the key name “Authorization” and key value “Basic base64encoded(api_key:api_password)“, or URL parameters ApiKey and ApiSecret for example https://api.erpag.com/item/add?ApiKey=key_056a9spfg1qubg34e409ee233d&ApiSecret=sec_IKJ4Sc2G8jHfr3sHbxQwEfev-Az-1YaF