Acumatica Rest API用于获取包含订单项详细信息的销售订单

时间:2017-03-17 05:17:09

标签: rest acumatica

我正在做一个演示,可以轻松创建和检索订单,但无法使expand参数正常工作

例如

我创建了订单SO003615:

URI http://localhost/Acumatica6/entity/Default/6.00.001/SalesOrder

{
  "OrderType": { value: "SO" },
  "CustomerID" : { value : "ACTIVESTAF" } ,
  "LocationID" : { value : "MAIN" },
  "Description" : { value : "Sample Order"},
   "Details" : 
   [
      {
        "InventoryID" : {value: "AACOMPUT01"},
        "Quantity" : {value: 2},
        "UOM" : {value: "EA"},
        "UnitPrice" : {value: 1000.99}
      },
      {
        "InventoryID" : {value: "AALEGO500"},
        "Quantity" : {value: 1}
      }
   ]
}

然后我试着用

订购

URI http://localhost/Acumatica6/entity/Default/6.00.001/SalesOrder/SO/SO003615?expand=Details

但订单项不在结果中。我错过了什么?

{
  "id": "37c15980-f71d-4496-882d-6e05e4a50061",
  "rowNumber": 1,
  "note": "",
  "BillingAddressOverride": {
    "value": false
  },
  "BillingContactOverride": {
    "value": false
  },
  "CreditHold": {
    "value": false
  },
  "Currency": {
    "value": "USD"
  },
  "CustomerID": {
    "value": "ACTIVESTAF"
  },
  "CustomerOrder": {},
  "Date": {
    "value": "2017-03-16T00:00:00-04:00"
  },
  "Description": {
    "value": "Sample Order 6"
  },
  "DestinationWarehouseID": {},
  "ExternalReference": {},
  "Hold": {
    "value": false
  },
  "IsTaxValid": {
    "value": false
  },
  "LastModified": {
    "value": "2017-03-17T01:05:56.74-04:00"
  },
  "LocationID": {
    "value": "MAIN"
  },
  "NewCard": {
    "value": false
  },
  "OrderedQty": {
    "value": 3
  },
  "OrderNbr": {
    "value": "SO003615"
  },
  "OrderTotal": {
    "value": 2101.98
  },
  "OrderType": {
    "value": "SO"
  },
  "PaymentCardIdentifier": {},
  "PaymentMethod": {
    "value": "CHECK"
  },
  "PaymentRef": {},
  "PreferredWarehouseID": {},
  "Project": {
    "value": "X"
  },
  "RequestedOn": {
    "value": "2017-03-16T00:00:00-04:00"
  },
  "ShippingAddressOverride": {
    "value": false
  },
  "ShippingContactOverride": {
    "value": false
  },
  "ShipVia": {},
  "Status": {
    "value": "Open"
  },
  "TaxTotal": {
    "value": 0
  },
  "custom": {},
  "files": []
}

1 个答案:

答案 0 :(得分:4)

$expand,而不是expand。尝试使用以下内容  http://localhost/Acumatica6/entity/Default/6.00.001/SalesOrder/SO/003615?$expand=Details