Skip to main content
Solved

REST API: Sequence of field defaulting causing errors

  • Mar 12, 2025 11:08 PM UTC
  • 3 replies
  • 84 views
  • Translate All

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

3 replies

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Mar 13, 2025 11:09 AM UTC

Hi ​@matthewgerdan ,

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

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

Translate

Dmitrii Naumov
Community Manager
Forum|alt.badge.img+7
  • Community Manager
  • Answer
  • Mar 13, 2025 1:54 PM UTC

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

Translate

Forum|alt.badge.img

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

Translate