我正在尝试通过API创建一个货件(端点版本17.200.001)。我首先用最少的字段构建JSON,以便正确插入。但是,当我使用新的Shipment编号以及其他字段和子集合更新JSON时,它将执行插入操作而不是更新操作。
我的API网址是http://localhost/acuroyal172100034/entity/default/17.200.001/Shipment。我的插入JSON是:
{
"CustomerID": {
"value": "CVS HEALTH"
},
"LocationID": {
"value": "MAIN"
},
"ShipmentDate": {
"value": "2019-07-17T00:00:00-04:00"
},
"WarehouseID": {
"value": "002"
}
}
我的更新JSON是:
{
"BaseCurrencyID": {
"value": "USD"
},
"ControlQty": {
"value": 1
},
"CreatedDateTime": {
"value": "2019-07-17T15:22:45.953-04:00"
},
"CurrencyID": {
"value": "USD"
},
"CurrencyRate": {
"value": 1
},
"CurrencyViewState": {
"value": false
},
"CustomerID": {
"value": "CVS HEALTH"
},
"Details": [
{
"Description": {
"value": "1833137 Body MM016997"
},
"FreeItem": {
"value": false
},
"InventoryID": {
"value": "0036920"
},
"LineNbr": {
"value": 1
},
"LocationID": {
"value": "01P"
},
"LotSerialNbr": {},
"OpenQty": {
"value": 0
},
"OrderedQty": {
"value": 1
},
"OrderLineNbr": {
"value": 1
},
"OrderNbr": {
"value": "036241"
},
"OrderType": {
"value": "SO"
},
"OriginalQty": {
"value": 1
},
"ShippedQty": {
"value": 1
},
"UOM": {
"value": "EACH"
},
"WarehouseID": {
"value": "002"
}
}
],
"EffectiveDate": {
"value": "2019-07-17T00:00:00-04:00"
},
"FreightAmount": {
"value": 0
},
"FreightCost": {
"value": 0
},
"FreightCurrency": {
"value": "USD"
},
"GroundCollect": {
"value": false
},
"Hold": {
"value": false
},
"Insurance": {
"value": true
},
"LastModifiedDateTime": {
"value": "2019-07-17T15:23:31"
},
"LocationID": {
"value": "MAIN"
},
"Operation": {
"value": "Issue"
},
"Orders": [
{
"OrderNbr": {
"value": "036241"
},
"OrderType": {
"value": "SO"
},
"ShipmentNbr": {
"value": "036971"
},
"ShipmentType": {
"value": "Shipment"
},
"ShippedQty": {
"value": 1
},
"ShippedVolume": {
"value": 0
},
"ShippedWeight": {
"value": 0
}
}
],
"PackageCount": {
"value": 0
},
"PackageWeight": {
"value": 0
},
"ReciprocalRate": {
"value": 1
},
"ResidentialDelivery": {
"value": false
},
"SaturdayDelivery": {
"value": false
},
"ShipmentDate": {
"value": "2019-07-17T00:00:00-04:00"
},
"ShipmentNbr": {
"value": "036971"
},
"ShippedQty": {
"value": 1
},
"ShippedVolume": {
"value": 0
},
"ShippedWeight": {
"value": 0
},
"ShippingSettings": {
"ShipToAddress": {
"Country": {
"value": "US"
}
},
"ShipToAddressOverride": {
"value": false
},
"ShipToContact": {
"BusinessName": {
"value": "CVS HEALTH"
}
},
"ShipToContactOverride": {
"value": false
}
},
"ShippingTerms": {
"value": "3RD PARTY"
},
"Type": {
"value": "Shipment"
},
"WarehouseID": {
"value": "002"
}
}
我首先尝试将所有这些都放入一个API调用中以一次全部插入,但这产生了一些奇怪的序列错误,所以我尝试这种方式是因为过去我也必须这样做另一个端点。如何获取更新而不是插入更新?