Skip to main content
Solved

REST API: Sequence of field defaulting causing errors


Forum|alt.badge.img

Hi Everyone,

MYOB customer updating from 23R1 to 24R1.

Having an issue where the Payment endpoint in the API is returning an error that the cash account cannot be found. This error is also experienced in the UI and is due to the Branch that is defaulted from the customer record being a different branch than the cash account (fair enough). 

The request body has the correct value for the branch so that if all values of the API request were entered in the correct order, then the payment would be valid.

Is there a way to control the sequence that values in API requests are entered so that defaulting happens in the correct order?

Best answer by Dmitrii Naumov

@matthewgerdan in 25r1 there is a new API method Patch that forces the values to be set from the request.

 

In 24r1 unfortunately it is not available, so I guess the only way is to try to send the payload in two parts or specify the branch in the HTTP request header as Jini suggested.

View original
Did this topic help you find an answer to your question?

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 699 replies
  • March 13, 2025

Hi ​@matthewgerdan ,

Could you try assigning the branch at the header level and test it again?

 "header": [   
        "PX-CbApiBranch": "Main"
    ],


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 632 replies
  • Answer
  • March 13, 2025

@matthewgerdan in 25r1 there is a new API method Patch that forces the values to be set from the request.

 

In 24r1 unfortunately it is not available, so I guess the only way is to try to send the payload in two parts or specify the branch in the HTTP request header as Jini suggested.


Forum|alt.badge.img
  • Author
  • Varsity I
  • 23 replies
  • March 13, 2025

Thanks ​@Dmitrii Naumov 

I’ll keep an eye out for that on the next update, for now I’ve just changed the logic of the PXFormula to not pull from the customer which is working for now


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings