Forum Discussion

WattsNet's avatar
WattsNet
Member
1 month ago

Business API Item Bill no AccountID

We are using the API to get Bills (amongst other things) from a client's MYOB file. The client has created an Item (type) bill. On their myob screen (see attached), there is no Item selected, but there is a Category selected, which looks like an Account ID (GL Code). We can successfully GET the Bills in question from the API. However, the Item (UID, etc) is empty, and the Account (UID, etc) is empty. It isn't clear how we get the Account ID for the line item. If an Item was selected by the client (on the myob side), we could source an Account ID via the Item. I'm assuming the Category on the myob page is different from the Category endpoint under the General Ledger.

 

Any help on how to source the Account ID (GL Code) on our side would be appreciated. 

 

TIA, Ian

4 Replies

  • Genreve_S's avatar
    Genreve_S
    MYOB Moderator
    1 month ago

    Hi WattsNet

     

    Thanks for bearing with me on this. I’ve had another look.

    In your case, the AccountId should be coming through: it’ll first try to use the account from the item, and if there’s no item on the line, it should fall back to the Category you’ve picked on that line. Because your bill clearly has a Category showing, but the API isn’t giving you an AccountId, it’s not behaving the way it should.

    The best next step is to get this in front of the API support team so they can dig into that specific bill and payload. You can log it here (as the developer or via your dev team):
    https://apisupport.myob.com/hc/en-us/requests/new

     

    Regards,

    Genreve 

  • Genreve_S's avatar
    Genreve_S
    MYOB Moderator
    1 month ago

    Hi WattsNet

     

    When the account code doesn’t auto‑fill from the API, it can definitely make things a bit confusing.

    In MYOB Business, there are only two bill layouts: Items, and services and Services. From your screenshot, it looks like you’re using the Items and services layout, which pulls the account from the item setup rather than from the bill line itself. The better option is to use the Services layout so you can choose the account directly on the line and have that flow through as the AccountID.

     

    Regards,
    Genreve

  • Thanks Genreve, reading between the lines here: Via the API, the Bill Line on a Service Bill includes the Account ID. However, (via the API) the Bill Line on an Item Bill doesn't include the Account ID. The Account ID is available via the Item only if the the Bill Line includes a reference to one. I take it the "Category", that can be seen on the Items and Services Bill layout, isn't available via the API.

     

    Regards,

    Ian

  • Thanks again Genreve, I've now submitted a dev request. I'm happy to mark this as the solution, given that it has reached a conclusion (of sorts) but anyone reading this will obviously need to track it to the developer forum.