api order import
note
Preliminary: subject to change
Structure
Instead of spreading order data in three tables, like the table based interfaces, the json structure contains all information about an order in one location.
Here is the basic structure of an OrderImport
document:
- Order (order number, customer, etc.)
- Product (Material, Tooling/PCode, Machine assignment)
- Bundle
- Item
- Bundle
- PunchPatterns
- Product (Material, Tooling/PCode, Machine assignment)
If your Order Number strategy is to use a Sales Order, it is likely that there will be multiple products that share the same customer detail.
{
"OrderCode": "WO22314",
"ImportMode": "CompleteOrderReplacement", // "InsertOnly", "AllowUpsert", "CompleteOrderReplacement"
"Customer": {
"Code": "",
"Name": "",
"Address1": "",
"Address2": "",
"City": "",
"State": "CA",
"PostalCode": "90210",
"Country": "USA",
"CustomerInstructions": "",
"Phone": ""
},
"UserData": {
"User1": "",
"User2": "",
"User3": "",
"User4": "",
"User5": ""
},
"SalesOrder": "SO-12345",
"PurchaseOrder": "PO555",
"Products": [
{
"ToolingDetail": {
"ToolingCode": "CLASSIC RIB",
"Description": "CLASSIC RIB ",
"MachineNumber": 0,
"FinishedWidth": 36,
"ToolingGroup": "Classic Rib"
},
"MaterialDetail": {
"MaterialCode": "26GA-FG",
"Description": "26GA FOREST GREEN",
"Gauge": 26,
"Thickness": 0,
"WidthIn": 36,
"Color": "FOREST GREEN",
"Type": null,
"CoverIn": 0,
"LbsPerFt": 2.616
},
"Schedule": {
"ScheduleStrategy": "None", // "None", "Schedule", "SendImmediately"
"MachineNumber": 1,
"RequiredDateTime": "2024-09-03T00:00:00.0000000",
"ShipDate": "2024-09-04T00:00:00.0000000",
"OnHold": false,
"TruckNumber": "",
"StagingBay": "",
"LoadingDock": ""
},
"Bundles": [
{
"BundleNumber": 1, // >= 1
"BundleCode": null,
"UserData": {
"User1": null,
"User2": null,
"User3": null,
"User4": null,
"User5": null
},
"Items": [
{
"ItemId": "",
"Quantity": 1,
"PartLengthIn": 120,
"Message": "",
"PunchPatternName": "",
"PartOption": "R",
"UserData": {
"User1": "",
"User2": "",
"User3": "",
"User4": "",
"User5": ""
},
"Sequence": 1,
"PieceMark": "",
"BundleGroup": "",
"StockKeepingUnit": "",
"PartLabelDef": null,
"BundleLabelDef": null
}
]
}
],
"Message": "",
"WorkOrder": "",
"MaxBundleWeightLbs": 2500,
"MaxBundlePieceCount": 50,
"PartLabelDef": null,
"BundleLabelDef": null
}
],
"PunchPatterns": [
{
"PatternName": "PATTERN1",
"Punches": [
{
"PunchName": "1",
// can be tool number, shape name, macro name, shape id
"PunchType": "Tool",
// "Tool", "Shape", "Macro", "ShapeId"
"XOffsetIn": 4.2,
"XReference": "LeadingEdge",
// "LeadingEdge", "TrailingEdge", "LeadingCenter", "TrailingCenter", "EvenSpacing", "SpacingLimit", "KerfAdjust", "Independent", "ProportionalMin", "ProportionalMax", "ProportionalLimit"
"YOffsetIn": 0,
"YReference": "None"
// "None", "CenterPlus", "CenterMinus", "PlusEdge", "MinusEdge", "MacroPlus", "MacroMinus"
}
]
}
]
}