Skip to main content
Solved

422 Unprocessable Entity Error during request

  • Apr 17, 2025 11:01 AM UTC
  • 2 replies
  • 107 views
  • Translate All

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

 

View original

2 replies

Forum|alt.badge.img+8
  • Captain II
  • Apr 17, 2025 2:27 PM UTC

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.

Translate

Dmitrii Naumov
Community Manager
Forum|alt.badge.img+7
  • Community Manager
  • Answer
  • Apr 17, 2025 2:39 PM UTC

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

 

Translate