Forum Discussion
Hi hraftery ,
In theory you'd just raise it like you would any other new invoice, as you said, with some of hte key fields removed.
https://apisupport.myob.com/hc/en-us/articles/360000496176-Creating-a-new-invoice-AccountRight-API
According to the linked docs:
https://developer.myob.com/api/myob-business-api/v2/sale/invoice/invoice_item/
The implication of the second is you should be removing:
- UID
- Lines.RowID
- Lines.RowVersion
- LastModified
- RowVersion
-
LastPaymentDate
I'd also consider if you need to remove any of these related to Terms - Terms
It might be safest just to drop the entire Terms section, so they refresh off the customer. If you aren't going to drop the entire terms section at least consider:
- Terms.DueDate
- Terms.DiscountExpiryDate
- Terms.BalanceDureDate
- Terms.DiscountDate
- Order
If you are Duplicating an invoice, then you probably need to make sure you're not linking the wrong sales order. (Or raise this via the Sales Order process instead)
Note: I haven't directly worked with the AccountRight/Business API in a very long time, so I can't be treated as an authoritative source here. If you need full help with that API reach out to the team via the help centre:
- hraftery8 hours agoContributing User
Thanks Will, yeah this is what I've ended up doing out of desperation. It ended up being 50 fields removed, with a bunch of loops and null checks to deal with subfields. It works for me, but it took some trial and error and I consider it a hack. I certainly wouldn't claim it's reliable for anyone else.
I've since repeated this technique to duplicate a Spend Money Transaction. "Only" 25 fields needed removing, some with subtle differences to an Invoice. Very hacky, but very happy to have something working.
Thanks for the support link - I tried to make sure I was in the right spot but still managed to miss that forum!
Looking for something else?
Search the Community Forum for answers or find your topic and get the conversation started!
Learn, solve, grow
Level up your skills and find answers across all MYOB products