MYOBCommunity
Partner Zone
|
|
Partner Zone

Sales Order Endpoint Submission Issue

Partner milobpb
1 Post
Partner
milobpb
Partner

1Posts

0Kudos

0Solutions

Sales Order Endpoint Submission Issue

Were currently experiencing issues on the salesorder endpoint. We have sent a data first on the salesorder/validate to generate the schema for the salesorder. Then using that same data, we send it as POST to the salesorder endpoint, but we keep getting an error stating "SalesOrderLine must define line type.".

array:1 [▼ 
"Message" => "SalesOrderLine must define line type." 
]

We already have provided the LineType on the line item. The JSON is also coming from salesorder/validate endpoint.

Here is the POST data that we are sending

array:43 [▼ 
"DebtorId" => 2275 
"Lines" => array:2 [▼ 
0 => array:38 [▼ 
"StockCode" => "6600045" 
"IsOriginatedFromTemplate" => false 
"OrderQuantity" => 1 
"Discount" => 0.0 
"UnitPrice" => 72.15 
"IsPriceOverridden" => true 
"LocationId" => 1 
"TaxRateId" => 1 
"ListPrice" => 72.15 
"PricePolicyId" => 0 
"LineType" => 0 
"UninvoicedQuantity" => 0 
"ReleaseQuantity" => 0 
"ReleaseNowQuantity" => 1 
"LastReleasedQuantity" => 0 
"PickedQuantity" => 0 
"PickNowQuantity" => 0 
"LastPickedQuantity" => 0 
"StockType" => "PhysicalItem" 
"Id" => -266598 
"BranchId" => 0 
"TaxRateValue" => 15.0 
"IsTaxOverridden" => false 
"TaxOverrideValue" => 0 
"Narrative" => [] 
"BackOrderQuantity" => 0 
"Description" => "ALTIMATE CONE A WAFFLE FLAT TOP SUGAR FSC-A 336CS" 
"BatchCode" => [] 
"DueDate" => "2018-10-18" 
"LineTotal" => 72.15 
"InvoicedQuantity" => 0 
"InvoiceNowQuantity" => 0 
"LastInvoicedQuantity" => 0 
"SuppliedQuantity" => 0 
"SupplyNowQuantity" => 1 
"LastSuppliedQuantity" => 0 
"RestrictedLine" => false 
"RankOrder" => 1 
] 
1 => array:38 [▼ 
"StockCode" => "6600052" 
"IsOriginatedFromTemplate" => false 
"OrderQuantity" => 1 
"Discount" => 0.0 
"UnitPrice" => 72.15 
"IsPriceOverridden" => true 
"LocationId" => 1 
"TaxRateId" => 1 
"ListPrice" => 87.39 
"PricePolicyId" => 0 
"LineType" => 0 
"UninvoicedQuantity" => 0 
"ReleaseQuantity" => 0 
"ReleaseNowQuantity" => 1 
"LastReleasedQuantity" => 0 
"PickedQuantity" => 0 
"PickNowQuantity" => 0 
"LastPickedQuantity" => 0 
"StockType" => "PhysicalItem" 
"Id" => -266599 
"BranchId" => 0 
"TaxRateValue" => 15.0 
"IsTaxOverridden" => false 
"TaxOverrideValue" => 0 
"Narrative" => [] 
"BackOrderQuantity" => 0 
"Description" => "ALTIMATE CONE B WAFFLE (FLAT TOP) SUGAR FSC-B 288CS" 
"BatchCode" => [] 
"DueDate" => "2018-10-18" 
"LineTotal" => 72.15 
"InvoicedQuantity" => 0 
"InvoiceNowQuantity" => 0 
"LastInvoicedQuantity" => 0 
"SuppliedQuantity" => 0 
"SupplyNowQuantity" => 1 
"LastSuppliedQuantity" => 0 
"RestrictedLine" => false 
"RankOrder" => 2 
] 
] 
"TaxRounding" => 0 
"DeliveryCount" => 0 
"InvoiceCount" => 0 
"PickedCount" => 0 
"ReleaseCount" => 0 
"HasUnInvoiced" => false 
"HasUnPicked" => false 
"HasUnReleased" => false 
"HasUnSupplied" => false 
"AllowCustomerOrderNumber" => false 
"CustomerOrderNumber" => [] 
"AccountName" => "WEB CASH SALES" 
"IsTaxInclusive" => false 
"HasBackOrders" => false 
"BranchId" => 0 
"DefaultLocationId" => 1 
"Narrative" => [] 
"CurrencyId" => 0 
"ContactId" => -1 
"SalesPersonId" => 49 
"ExchangeRate" => 1 
"TaxTotal" => 23.9 
"SubTotal" => 159.3 
"Reference" => [] 
"Instructions" => [] 
"CreateDate" => "2018-10-18T11:37:04.0685106+13:00" 
"OrderDate" => "2018-10-18" 
"DueDate" => "2018-10-18" 
"FinalisationDate" => [] 
"ActivationDate" => "2018-10-18T11:37:04.0685106+13:00" 
"DeliveryAddress" => array:6 [▼ 
"Line1" => "xxxxxxxx" 
"Line2" => [] 
"Line3" => "xxxxxxx" 
"Line4" => [] 
"Line5" => [] 
"Line6" => [] 
] 
"Status" => 3 
"StatusDescription" => "Unprocessed Order" 
"Finalised" => 0 
"OrderTotal" => 183.2 
"LocalValue" => 0 
"HasRestrictedLine" => false 
"LastUpdated" => [] 
"ExtraFields" => array:6 [▶] 
"Id" => "-266597" 
"Href" => "http://180.189.212.82:8888/salesorder/-266597" 
]

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post