Skip to main content
Solved

REST API: adding payment to sales order succeeds, but the payload is missing payment data?

  • January 6, 2025
  • 4 replies
  • 109 views

Forum|alt.badge.img

Hello,

 

Occasionally, when adding a new payment to an existing sales order with a PUT to the /Payment endpoint, the request succeeds (HTTP 200) but the response body is nearly empty. Rather than containing a Payment structure with ReferneceNbr and other fields, the server gives us a response body like this:

 

{"id":"912d9149-55a4-4b1c-8575-73ebbfc2027c","rowNumber":1,"note":null,"custom":[]}

 

This is problematic for our use case, because we need to store the payment’s ReferenceNbr, which is missing. Is the expected behavior? It appears to happen rarely, but I haven’t been able to determine the cause. Any recommended way to work around it? Any help is appreciated, thanks!

Best answer by kbestemyanov

If this is the result of concurrency, then the issue is on the client’s side. You probably use same session from multiple theads/tasks, but you should not. you should call login or request token for each parallel thread (And do not forget to call Logout in this case in finally statement)

4 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • January 7, 2025

@dominicfedco I think this is a behavior caused by concurrent API requests processing. 

It’s not an expected behavior and needs to be fixed, but it may take some time on our side.


Forum|alt.badge.img
  • Author
  • Freshman II
  • January 7, 2025

Thanks for the info, Dmitrii. That’s very helpful. For now, it shouldn’t be too hard to work-around the issue on our end.


  • Acumatica Employee
  • Answer
  • February 18, 2025

If this is the result of concurrency, then the issue is on the client’s side. You probably use same session from multiple theads/tasks, but you should not. you should call login or request token for each parallel thread (And do not forget to call Logout in this case in finally statement)


Forum|alt.badge.img
  • Author
  • Freshman II
  • February 18, 2025

If this is the result of concurrency, then the issue is on the client’s side. You probably use same session from multiple theads/tasks, but you should not. you should call login or request token for each parallel thread (And do not forget to call Logout in this case in finally statement)


This is extremely helpful, thank you!