Page 1 of 1

Create a New Customer Payment yielding (422) Unprocessable Entity

Posted: Tue Feb 08, 2022 6:18 am
by JohnSemmens
Hi Guys,
I'm struggling to get started with creating a Customer Payment via the API.

https://developer.simprogroup.com/apido ... f4f1ba5c87

I'm using this endpoint, with POST:

Code: Select all

.../companies/2/customerPayments/
this payload:

Code: Select all

{ 
"Payment": { 
    "PaymentMethod":9,
    "DepositAccount": "090",
    "Date": "2022-02-06"
    }, 
"Invoices": [
         { "Invoice": 4781, "Amount": "1.02" } 
        ] 
}
The response is:

Code: Select all

The remote server returned an error: (422) Unprocessable Entity.
What is the likely error with this call ?
I presume I have a wrong or inconsistent data element.

Re: Create a New Customer Payment yielding (422) Unprocessable Entity

Posted: Tue Feb 08, 2022 10:10 pm
by robbertcha
Hi,

422 errors means that the provided body request is incorrect, and it always comes with the explanations.

In your case, please make sure the ID of PaymentMethod is correct, and please change the value of Amount to 1.02 (remove the double quote)

Re: Create a New Customer Payment yielding (422) Unprocessable Entity

Posted: Wed Feb 09, 2022 12:12 am
by JohnSemmens
Thanks Robbert,

That was exactly the issue.
The double-quotes on the numeric value were the problem.