Skip to main content
Solved

422 Unprocessable Entity Error during request

  • April 17, 2025
  • 2 replies
  • 53 views

The following error occurs when I try to create an expense receipt using the REST API. Could anyone help with this?

Error: error: "Inserting  'Expense Receipt' record raised at least one error. Please review the errors.; TranDesc: 'Description' cannot be empty.".

Body:

{

    "Date" : {"value" : "04/17/2025"},

    "ExpenseItemID" : {"value" : "MEAL"},

    "Details": [

        {

            "Description" : {"value" : "Team outing"},

            "Quantity" : {"value" : "2"},

            "UOM" : {"value" : "PIECE"},

            "Amount" : {"value" : "175"},

            "Currency" : {"value" : "USD"}

        }

    ]

 

   

}

Best answer by Dmitrii Naumov

The body structure you have is incorrect.

Here is the correct one

{
"Date": {
"value": "2025-01-13T00:00:00-05:00"
},
"ExpenseItemID": {
"value": "CARRENT"
},
"ReceiptDetails": {

"Description": {
"value": "Rental car while at HQ for on-site training"
},
"Qty": {
"value": 1.000000
},

"UOM": {
"value": "DAY"
},
"Amount": {
"value": 439.300000
},

"CurrencyID": {
"value": "USD"
}
}
}

 

2 replies

Forum|alt.badge.img+7
  • Captain II
  • April 17, 2025

What endpoint and version are you using? And what version of ACM?

One thing that can help is to do a GET request on the endpoint to see how it returns the data from a given transaction.


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • April 17, 2025

The body structure you have is incorrect.

Here is the correct one

{
"Date": {
"value": "2025-01-13T00:00:00-05:00"
},
"ExpenseItemID": {
"value": "CARRENT"
},
"ReceiptDetails": {

"Description": {
"value": "Rental car while at HQ for on-site training"
},
"Qty": {
"value": 1.000000
},

"UOM": {
"value": "DAY"
},
"Amount": {
"value": 439.300000
},

"CurrencyID": {
"value": "USD"
}
}
}