TDKorn / my-magento

Python Magento 2 REST API Wrapper
https://my-magento.readthedocs.io
MIT License
11 stars 3 forks source link

Modify Existing Order #11

Open FrancescoTalotta opened 7 months ago

FrancescoTalotta commented 7 months ago

Hello,

I was wandering, is it possible to modify an order using this python library? I mean, increase or decrease the quantity, changing the item, change the price etc.

Than you

Francesco

TDKorn commented 7 months ago

Hey @FrancescoTalotta,

Currently the Order model has no update methods, but you can use the client to send a POST request to the orders endpoint (see here)

I can look into adding some order update methods, is there anything you think would be helpful to have? The examples you gave may be difficult since they would all change the grand total and require additional changes like payment refunds, additional charges, modification of invoices, creation of credit memos, etc.

FrancescoTalotta commented 7 months ago

Hello @TDKorn,

sorry I have just seen your reply now. It will be very useful to have such order update. Many times customers ask to change the item or to modify the quantity, or add a discount. I know it's difficult because of the change in grand total. If I see other things that could be useful I will let you know. Thank you very much

Francesco

TDKorn commented 7 months ago

Hey @FrancescoTalotta, are these modifications possible to do via the admin? From what I can tell, editing the quantity, items, prices of an order in the admin would cancel the existing one and create a new one.

It seems possible to do this without cancelling by extending the source code (example) but not via the REST API

FrancescoTalotta commented 7 months ago

Hello @TDKorn ,

thank you for your reply. Actually in the admin you can't do this. As you said you can modify the order from the admin by creating a new one. There are some plugins that enable the order modification without cancelling the order.