17 hours ago
Item Purchase Order Validation Errors
I am trying to POST a new item purchase order but am encountering validation errors I am unable to interpret. The payload below is being sent to /Purchase/Order/Item using the POST method.
{
"Lines": [
{
"BillQuantity": 2.0,
"ReceivedQuantity": 0,
"UnitPrice": 769.5,
"DiscountPercent": 0.0,
"Total": 1539.0,
"Item": {
"UID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"TaxCode": {
"UID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"Type": "Transaction",
"Description": "My description",
"RowVersion": "1"
}
],
"OrderDeliveryStatus": "Print",
"Number": "000005",
"Date": "2024-11-08T08:22:26.6152102+10:00",
"SupplierInvoiceNumber": "",
"Supplier": {
"UID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
},
"IsTaxInclusive": false,
"IsReportable": false,
"Subtotal": 0,
"TotalTax": 0,
"TotalAmount": 0,
"AppliedToDate": 0,
"BalanceDueAmount": 0,
"Status": "Open",
"OrderType": "Item"
}
and the response received is:
{
"Errors": [
{
"Name": "ValidationError",
"Message": "BusinessLine_AccountRequired",
"AdditionalDetails": "AccountId:(PurchaseOrderItemLine)",
"ErrorCode": 4242,
"Severity": "Error",
"LearnMore": null
},
{
"Name": "ValidationError",
"Message": "PurchaseOrderLine_ItemBoughtOrInventoriedRequired",
"AdditionalDetails": "ItemId:(PurchaseOrderItemLine)",
"ErrorCode": 4305,
"Severity": "Error",
"LearnMore": null
}
],
"Information": "Warning, error messages have not been finalised in this release and may change"
}
The item purchase order page doesn't mention an account field or an inventory required field, and the SDK objects don't have them either. I'm unsure what I'm supposed to here also since the API errors page doesn't identify these errors.
For context, I don't have background in being a MYOB user. I would greatly appreciate any help here.