Skip to main content
Solved

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

  • Oct 13, 2021 1:48 PM UTC
  • 11 replies
  • 476 views
  • Translate All

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

 

 

Best answer by cyrus91

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? 

View original

11 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Oct 13, 2021 2:26 PM UTC

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?

Translate

  • Author
  • Freshman II
  • Oct 13, 2021 2:33 PM UTC

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.

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Oct 13, 2021 2:35 PM UTC

Can you please share the JSON request here. @cyrus91 

Translate

  • Author
  • Freshman II
  • Oct 13, 2021 2:44 PM UTC

Hi @Naveen B Here is the sample json request.

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Oct 13, 2021 3:32 PM UTC

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
}
}

 

Translate

  • Author
  • Freshman II
  • Oct 13, 2021 3:34 PM UTC

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? 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Oct 13, 2021 3:54 PM UTC

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

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Oct 14, 2021 12:52 PM UTC

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

Translate

  • Author
  • Freshman II
  • Answer
  • Oct 20, 2021 5:57 AM UTC

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? 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Oct 20, 2021 6:06 AM UTC

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

Translate

mvolshteyn
Acumatica Moderator
Forum|alt.badge.img+3
  • Technical Account Manager in the ISV Team
  • Oct 29, 2021 7:29 AM UTC

@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

Translate