Solved

Sales Order Rest API -> "'Status' cannot be empty."

  • 13 October 2021
  • 11 replies
  • 351 views

Hi, when we create our Sales Order using the API, we encountered this issue
 

Response 422  Unprocessable Entity

We rarely encountered this issue, and we don’t know why it happens. In our request body, we are sure that we have the Status field.
 

 

For additional record, I have used the same request body a moment ago and the Sales Order is created but after trying now, the error shows up.

Any help would be helpful. Thanks a lot

 

 

icon

Best answer by cyrus91 20 October 2021, 07:57

View original

11 replies

Userlevel 7
Badge +17

Hi @cyrus91  By default Acumatica will set the Status as “Open”, do we really pass the Status in JSON request?

Have you removed this status object from JSON and verified?

Hi @Naveen B , yes, I also tried remove the status Object from the JSON and the error still occurs.

The thing that also concerns me is that my JSON body is the same when it was working and now it is not.

Userlevel 7
Badge +17

Can you please share the JSON request here. @cyrus91 

Hi @Naveen B Here is the sample json request.

 

Userlevel 7
Badge +17

Hi @cyrus91  I just tried in my local machine with this JSON and it is working as expected.

There is no issue with the JSON request.

 

 

 

{
"OrderType": {
"value": "SO"
},
"OrderNbr": {
"value": "<NEW>"
},

"CustomerID": {
"value": "AACUSTOMER"
},
"ExternalRef": {
"value": 312
},

"Details": [
{
"OrderQty": {
"value": 2
},
"UOM": {
"value": "EA"
},
"InventoryID": {
"value": "AACOMPUT01"
}
}
],
"BillToAddress": {
"AddressLine1": {
"value": "Test Only"
},
"AddressLine2": {
"value": "Test Only"
},
"City": {
"value": "Test Only"
},
"Country": {
"value": "US"
},
"State": {
"value": "Connecticut"
},
"PostalCode": {
"value": "06902"
}
},
"BillToContact": {
"Attention": {
"value": "Test User"
},
"BusinessName": {
"value": ""
},
"Email": {
"value": "test@test.com"
},
"Phone1": {
"value": ""
}
},
"BillToAddressOverride": {
"value": true
},
"BillToContactOverride": {
"value": true
},
"ShipToAddress": {
"AddressLine1": {
"value": "Test Only"
},
"AddressLine2": {
"value": "Test Only"
},
"City": {
"value": "Test Only"
},
"Country": {
"value": "US"
},
"State": {
"value": "Connecticut"
},
"PostalCode": {
"value": "06902"
}
},
"ShipToContact": {
"Attention": {
"value": "Test User"
},
"BusinessName": {
"value": ""
},
"Email": {
"value": "test@test.com"
},
"Phone1": {
"value": ""
}
},
"ShipToAddressOverride": {
"value": true
},
"ShipToContactOverride": {
"value": true
}
}

 

Hi @Naveen B thanks for this. It shows that there is nothing wrong with the JSON request. Do you have any other Ideas that may cause this one? 

Userlevel 7
Badge +17

@cyrus91  Have you created manually in the instance and observed any issues?

Userlevel 7
Badge +17

@cyrus91  Also, the above issue may cause due to one your customization that are deployed in the instance. Please verify by unpublishing the customizations. 

Hi @Naveen B, sorry for the late reply. I have checked and we don’t any customization projects right now. Though I tried this morning if it will work and surprisingly it goes through. The Sales Order was created. I am thinking the possibility that the API usage causes this one? 

Userlevel 7
Badge +17

According me, that should not be case, it might be issues with caches but NOT sure.

Userlevel 5
Badge +3

@cyrus91 , if the issue is still relevant, suggest to check automation workflows/automation steps (depending on the version) and also try to create such sales order manually, If this does not help, please create a support case

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved