Why is most of the data in an Order immutable?July 20, 2019 at 10:38am
In the API docs, under "Update an Order" - https://docs.moltin.com/api/orders-and-customers/orders/update-an-order - it states that only shipping and shipping_address can be modified in an Order.
Why is this the case?
Should there not be capability to modify line items? What if one item couldn't be fulfilled? Or a customer calls up right after placing the Order wanting one item to be removed? Or you just need to change the quantity or price on one of the line items?
If it can't be edited, how do you handle the above scenarios?
August 20, 2019 at 10:27am
HI @bazv we recommend using Flows to extend orders where you can update fields. We made the decision to keep order details immutable (except shipping before shipped and fulfilment status).
Flows is a great way forward if you need to maintain any additional data along with Orders you wish to update the fact.
So I could add a Tracking Number field to an Orders Flow and that would still be editable after payment?
If so, that's good. Doesn't really help with modifying order line items, quantities, etc, though.
Understand you've made the decision to make it immutable and I'm sure you have your reasons for doing this, but it would be great to know how others are handling the situation given this.
What if 1 out of the 4 items ordered can't be fulfilled? How would that situation be handled? What if someone forgot to put in their promo code and then emails right after placing the order requesting a discount? etc
Yeah, if you create a new Flow with the slug
orders and add a Field for
tracking_number you can then make a
PUT to the order with that field.
As for updating order items/quantities... I agree, this would be ideal and something we've in the backlog.
Cheers Jamie. I posted too soon and I think you replied before I finished editing, so any advice on how others are handling it would be much appreciated.
On the topic of custom fields, it doesn't seem like the PHP SDK supports this. The PHP SDK hasn't been modified for 2 years - is this still being maintained?
August 22, 2019 at 8:32am