Skip to main content
Solved

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


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
Did this topic help you find an answer to your question?

11 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3409 replies
  • October 13, 2021

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?


  • Author
  • Freshman II
  • 4 replies
  • October 13, 2021

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.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3409 replies
  • October 13, 2021

Can you please share the JSON request here. @cyrus91 


  • Author
  • Freshman II
  • 4 replies
  • October 13, 2021

Hi @Naveen B Here is the sample json request.

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3409 replies
  • October 13, 2021

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

 


  • Author
  • Freshman II
  • 4 replies
  • October 13, 2021

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? 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3409 replies
  • October 13, 2021

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3409 replies
  • October 14, 2021

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


  • Author
  • Freshman II
  • 4 replies
  • Answer
  • October 20, 2021

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? 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3409 replies
  • October 20, 2021

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


mvolshteyn
Acumatica Moderator
Forum|alt.badge.img+3
  • Technical Account Manager in the ISV Team
  • 111 replies
  • October 29, 2021

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings