How append new line to the order by api ?

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
georia
3 Posts
User

3Posts

0Kudos

0Solutions

How append new line to the order by api ?

Hi there,

 

I use the myob api to do the data push in myob a few weeks. But now a update order lines requirement  needs to implement update/add / delete order lines.  About the add new line to a exits order, I search the documents and here. But no clear answer  for this. How to append new lines to a exits order ? Thanks.

 

 

4 REPLIES 4
Hannah_B
MYOB Moderator
142 Posts
MYOB Moderator
Australia
MYOB Moderator

142Posts

33Kudos

25Solutions

Re: How append new line to the order by api ?

Hi @georia,

 

Thanks for reaching out, Yes we can update part of the order or delete parts of the order if needed. You can view our documentation on the endpoint HERE. 

 

Depending on what you want to add or delete is what we would need to include in the body of the request. One thing to note with a PUT request is you must include every field that you want to keep otherwise this will be deleted. 

 

I have included a snippet below of the Item body. You can complete a GET request first to obtain the Full body to modify this as needed.

{

 

"Type": "Transaction",
"Description": "Cooler Large",
"ShipQuantity": 1.000000,
"UnitPrice": 520.000000,
"UnitPriceForeign": null,
"DiscountPercent": 0.000000,
"Total": 520.000000,
"TotalForeign": null,
"Item": {
"UID": "90dfd167-a13f-4706-8207-1f6094XXXXXX",
"Number": "100",
"Name": "Cooler Large",
"URI": "https://ar1.api.myob.com/accountright/XXXXXXXX2-d2a7-4539-86df-5d47XXXXXXX/Inventory/Item/90dfd167-a..."
},
"Job": null,
"TaxCode": {
"UID": "XXXXXXX-bce8-4da0-986c-a3bbddXXXXXXXX",
"Code": "GST",
"URI": "https://ar1.api.myob.com/accountright/36c69572-d2a7-4539-86df-5d47256XXXXXX/GeneralLedger/TaxCode/2a..."
},
"Location": {
"UID": "0b9c04d4-ae7f-4c10-aa5f-XXXXXXXXXX,
"Identifier": "ALocation2",
"Name": "Second Location",
"URI": "https://ar1.api.myob.com/accountright/XXXXX72-d2a7-45XXXXXX-5d47256dXXXX/Inventory/Location/0b9c04d4..."
},
"RowVersion": "-3007345721385XXXX"

},


Thanks,
@Hannah_B


MYOB API Specialist


MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's



Did my answer help?


Mark it as a Solution

georia
3 Posts
User

3Posts

0Kudos

0Solutions

Re: How append new line to the order by api ?

Hi @Hannah_B 

 

Thanks for your reply to show the details.  totally I know you said that.  But now I just confuse to the append new item. I will invoke PUT method to update exist order. According to the PUT rule, The "RowID" and "RowVersion" fields they're must be provoided for each item of the order line. And Their values will be redreshed Once a PUT action was done. So as a new line content is inluded into the request body. But how to get or indicate the "RowVersion" or "RowID" for the new line item before invoide PUT  ? I saw your sample in the reply for a new item body.  The last row “RowVersion” field value is "-3007345721385XXXX", How to get this value for a append new item? Thanks

Hannah_B
MYOB Moderator
142 Posts
MYOB Moderator
Australia
MYOB Moderator

142Posts

33Kudos

25Solutions

Re: How append new line to the order by api ?

Hi @georia,

 

Thanks for your reply, To obtain the “RowVersion” I completed a GET request to `/Inventory/Location` and used the “RowVersion” against the location. I then removed the Row I.D against the new line so the system can generate a row I.D for this. 

 

If you are still having trouble with updating the order you can create a support request with us HERE. This will allow us to go into more detail using your data. 

 

Thanks, 


Thanks,
@Hannah_B


MYOB API Specialist


MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's



Did my answer help?


Mark it as a Solution

georia
3 Posts
User

3Posts

0Kudos

0Solutions

Re: How append new line to the order by api ?

Hi @Hannah_B ,

 

Thanks for your help. I have done this.  

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post