Skip to main content
Solved

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

  • Jan 6, 2025 9:22 PM UTC
  • 4 replies
  • 163 views
  • Translate All

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). 

View original

4 replies

Dmitrii Naumov
Community Manager
Forum|alt.badge.img+7

​@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.

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Jan 7, 2025 2:30 PM UTC

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.

Translate

  • Acumatica Employee
  • Answer
  • Feb 18, 2025 4:59 PM UTC

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). 

Translate

Forum|alt.badge.img
  • Author
  • Freshman II
  • Feb 18, 2025 8:04 PM UTC

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!

Translate