Hi,
I was trying to create a sales order using the response returned by the validate endpoint, but it was throwing a 500 error without any helpful messages.
I tried to validate my sales order first with the payload:
{
"debtorid": 14880,
"status": 0,
"lines": [
{
"bomcode": "EL01"
}
]
}It successfully returned the validated response with all the line items within the BOM item in the lines array.
{
"order": {
"debtorid": 14880,
"lines": [
{
"bomcode": "EL01",
"bomgroupid": 0,
"pricingmode": 1,
"hiddensellprice": 179.08,
"orderquantity": 1.0,
"discount": 0.0,
"unitprice": 0.0,
"ispriceoverridden": false,
"locationid": 1,
"taxrateid": 10,
"showline": true,
"listprice": 170.13,
"pricepolicyid": 0,
"linetype": 1,
"uninvoicedquantity": 0.0,
"releasequantity": 0.0,
"releasenowquantity": 1.0,
"lastreleasedquantity": 0.0,
"pickedquantity": 0.0,
"picknowquantity": 0.0,
"lastpickedquantity": 0.0,
"stocktype": "KitBOM",
"id": -440,
"branchid": 0,
"taxratevalue": 10.0,
"istaxoverridden": false,
"taxoverridevalue": 0.0,
"narrative": null,
"backorderquantity": 0.0,
"description": "Engage Magenta Level 1 Pk (22 titles)",
"batchcode": null,
"duedate": "2022-09-29",
"linetotal": 0.0,
"invoicedquantity": 0.0,
"invoicenowquantity": 0.0,
"lastinvoicedquantity": 0.0,
"suppliedquantity": 0.0,
"supplynowquantity": 0.0,
"lastsuppliedquantity": 0.0,
"restrictedline": false,
"rankorder": 1,
"extrafields": []
},
{
"bomgroupid": 0,
"stockcode": "81000",
"hiddensellprice": 0.0,
"orderquantity": 1.0,
"discount": 0.0,
"unitprice": 8.14,
"ispriceoverridden": false,
"locationid": 1,
"taxrateid": 10,
"showline": true,
"listprice": 8.14,
"pricepolicyid": 0,
"linetype": 2,
"uninvoicedquantity": 0.0,
"releasequantity": 0.0,
"releasenowquantity": 1.0,
"lastreleasedquantity": 0.0,
"pickedquantity": 0.0,
"picknowquantity": 0.0,
"lastpickedquantity": 0.0,
"stocktype": "PhysicalItem",
"id": -441,
"branchid": 0,
"taxratevalue": 10.0,
"istaxoverridden": false,
"taxoverridevalue": 0.0,
"narrative": null,
"backorderquantity": 0.0,
"description": "Up Here! ( L1)",
"batchcode": null,
"duedate": "2022-09-29",
"linetotal": 8.14,
"invoicedquantity": 0.0,
"invoicenowquantity": 0.0,
"lastinvoicedquantity": 0.0,
"suppliedquantity": 0.0,
"supplynowquantity": 1.0,
"lastsuppliedquantity": 0.0,
"restrictedline": false,
"rankorder": 2,
"extrafields": []
},
{
"bomgroupid": 0,
"stockcode": "81001",
"hiddensellprice": 0.0,
"orderquantity": 1.0,
"discount": 0.0,
"unitprice": 8.14,
"ispriceoverridden": false,
"locationid": 1,
"taxrateid": 10,
"showline": true,
"listprice": 8.14,
"pricepolicyid": 0,
"linetype": 2,
"uninvoicedquantity": 0.0,
"releasequantity": 0.0,
"releasenowquantity": 1.0,
"lastreleasedquantity": 0.0,
"pickedquantity": 0.0,
"picknowquantity": 0.0,
"lastpickedquantity": 0.0,
"stocktype": "PhysicalItem",
"id": -442,
"branchid": 0,
"taxratevalue": 10.0,
"istaxoverridden": false,
"taxoverridevalue": 0.0,
"narrative": null,
"backorderquantity": 0.0,
"description": "I Go Up! ( L1)",
"batchcode": null,
"duedate": "2022-09-29",
"linetotal": 8.14,
"invoicedquantity": 0.0,
"invoicenowquantity": 0.0,
"lastinvoicedquantity": 0.0,
"suppliedquantity": 0.0,
"supplynowquantity": 1.0,
"lastsuppliedquantity": 0.0,
"restrictedline": false,
"rankorder": 3,
"extrafields": []
},
.... // some more items on the BOM
],
"taxrounding": 0.09,
"deliverycount": 0,
"invoicecount": 0,
"pickedcount": 0,
"releasecount": 0,
"hasuninvoiced": true,
"hasunpicked": true,
"hasunreleased": true,
"hasunsupplied": true,
"allowcustomerordernumber": false,
"customerordernumber": "",
"accountname": "SWOPNIL DANGOL",
"istaxinclusive": false,
"hasbackorders": false,
"branchid": 0,
"defaultlocationid": 1,
"narrative": null,
"currencyid": 0,
"contactid": -1,
"salespersonid": 153,
"exchangerate": 1.0,
"taxtotal": 17.91,
"subtotal": 179.08,
"reference": null,
"instructions": null,
"createdate": "2022-09-29T19:28:09.1734929+10:00",
"orderdate": "2022-09-29",
"duedate": "2022-09-29",
"finalisationdate": null,
"activationdate": "2022-09-29T19:28:09.1734929+10:00",
"deliveryaddress": {
"line1": "",
"line2": "",
"line3": "",
"line4": "",
"line5": "",
"line6": ""
},
"status": 0,
"statusdescription": "Unprocessed Order",
"finalised": 0,
"ordertotal": 196.99,
"localvalue": 179.08,
"hasrestrictedline": false,
"lastupdated": null,
"extrafields": [
{
"key": "X_INT_REF",
"value": null
},
{
"key": "X_COURIER",
"value": null
},
{
"key": "X_NO_CARTONS",
"value": null
},
{
"key": "X_CONSIGNMENT_NO",
"value": null
}
],
"id": -439,
"href": "https://relaycloud.exo.api.myob.com/relay/salesorder/-439"
},
"messages": []
}
But, when I tried to use the same reponse with the create sales order API. It was throwing a 500 error message.
{
"message": "An error has occurred."
}