Skip to main content

Hello,

On Acumatica Cloud 2024 R1

I’m using the end point Default/23.200.001/Payment (also tried with Default/22.200.001/Payment)

 

After creating a SaleOrder, I’m trying to add a Payment for it using the web service, but I’m stuck in error returning from the API with this message:

{
"message": "The request is invalid.",
"modelState": {
"":
"An exception occurred during input parsing"
]
}
}

I’m not sure what is invalid, I’m using the same JSON format I used to create the sales order, here is my payment POST request:

 

{
"Type": {
"value": "Payment"
},
"CustomerID": {
"value": "1047204"
},
"ApplicationDate": {
"value": "2024-10-18T11:00:51"
},
"PaymentAmount": {
"value": "439.22"
},
"PaymentMethod": {
"value": "ONLINE"
},
"PaymentRef": {
"value": "86561"
},
"CashAccount": {
"value": "11140_____"
},
"AppliedToDocuments": o
{
"Type": {
"value": "SO"
},
"ReferenceNbr": {
"value": "86561"
},
"AmountPaid": {
"value": "439.22"
}
}
]
}

 

Upon looking in the Trace log on the Acumatica I’m seeing this error:

Not sure what is the issue in the request, I can’t find what is wrong

Ok I modified my request pay load to be like that and it works

 $data = [
"Type" => ["value" => "Payment"],
"CustomerID" => ["value" => $user_data["acumatica_id"]],
"LocationID" => ["value" => "MAIN"],
"RefernceNbr" => ["value" => $order_data['order_num']],
"PaymentRef" => ["value" => $order_data['order_num']],
"PaymentMethod" => ["value" => $paymentMethod ],
"CashAccount" => ["value" => $cashAccount],
"PaymentAmount" => ["value" => $OrderTotal],
"OrdersToApply" => [
[
"Type" => ["value" => "SO"],
"OrderNbr" => ["value" => $OrderNbr],
"AppliedToOrder" => ["value" => $OrderTotal]
]
]
];

You see that I replaced AppliedToDocuments to OrdersToApply

Although that OrdersToApply doesn’t exists when I look under Web Service End Points list of fields which is too confusing!

 

 


@safetynetweb I was suspecting the data format from the original post. Thanks for confirming the solution.


@ChandraM yes it was the issue in the formatting and using OrdersToApply instead of AppliedToDocuments


but if I understand correctly shouldn’t this property ‘OrdersToApply’ appear in the screenshot for the webservice end point?


@safetynetweb you should expand the Payment node to see Detail/Linked entities

 


@Dmitrii Naumov thank you for pointing me to it


Reply