Magento – Magento 2 order flow sequence

cash-on-deliveryinvoicemagento2order-statussales-order

Hope all is well.

It would be great if you could help me to figure out the order flow in Magento 2.

I understood these steps Order Placed -> Order in Pending -> Payment Confirmed/Verified. But got confused with the invoice generation. I would like to use COD (Cash on Delivery) as the payment method and I need to generate an invoice which shows the "amount due" and send it to the customer.

Here are my questions:

  1. At which step I can print the packing list to pick the order and process it?

  2. Do I need to invoice the order before shipping it?

  3. How can I modify an order (cancel one item from an order)?

  4. Can I cancel an order after I ship it?

  5. How do I handle a COD order return?

  6. Can you suggest the best tutorial for Magento 2 order flow sequence, credit memo, generating packing slip etc?

Best Answer

first of all, it's worth mentioning that COD (Cash on Delivery) is an off-line payment method in Magento, which means that - upon order placement - no payment in registered in Magento, and the order stays in the Pending status until further (usually manual, unless an extension is taking care of this) action is taken in the Admin, such as creating and Invoice or Shipment, Cancelling the order, etc.

Check this guide: https://www.mexbs.com/magento-blog/magento-order-statestatus-flow explaining the "standard" order status/state flow. By "standard" I mean that this is the way Magento works OOB, but Admin users or extension can customise this flow, however it gives you an idea...

Also, please note the fundamental conceptual difference between order status and order state. In a few words, the order state is an internal status that Magento uses to determine the actions that are to be made available against a specific order. Referring to the diagram in the post above, orders place with COD payment method should be in the "New" state, which means actions allowed are "Cancel", "Ship", "Invoice" or "Partial Invoice". The order status is a "custom" order status that can or can be not assigned to an order state (for instance, the "Pending" status is assigned to the "New" state), and its main purposes are creating sub-states that do no affect Magento internal flow, but help Admin users and some extensions to keep track of the process. Admin users nor extensions are expected to change the order state explicitly, rather they should use one of the provided methods by Magento (e.g. "capture" a payment or "cancel" the order) to change/advance the order state. Order statuses, however, can be set explicitly, either via Admin screens, of by extensions/custom code.

That said, Magento expects the "invoice" to be created when the payment is actually settled, as the meaning of "invoicing" in Magento, at least in on-line payment methods, is the authorisation/settlement of payment for an order. According to the state diagram, invoicing is one of the two steps (along with shipment) that are required to complete the order.

If you are not interested in tracking the payment status in Magento, and you do that tracking with a separate system, and you don't care that your customers may see an order as completed, when it's still awaiting payment, in their customer areas, I'd say you can use Magento invoicing to generate an invoice, customising the invoice template to state "amount due" instead of "paid".

However, I would think that the most appropriate action to take, instead, is to customise the order PDF to show "invoice" and "amount due", rather than "order" and "order total", and send to the customer the order printout (either PDF or email/HTML which already is done automatically by Magento). You could use the same as packing lists, unless your Magento edition provides this feature OOB or you have an extension offering that feature, and send the modified order printout with the merchandise, and work your way up, as to business process, from that point onwards. Of course this may mean you may need to customise Magento invoices as well, to state the order number as invoice number, instead of the separate "standard" invoice number, and emit an invoice as a confirmation of collected payment... I could go on, but I think you should get the gist.

So - as to your questions:

1. At which step I can print the packing list to pick the order and process it?

As soon as the order is placed, you can print out the order and use it as a packing list, unless you Magento edition or an extension provides the packing slips functionality for you.

2. Do I need to invoice the order before shipping it?

This is entirely up to you, just keep in mind the state diagram and consider that by invoicing an order in Magento you advance its state to "processing" which means that - to Magento - you collected the money and therefore some actions, such as cancelling the order, will no longer be available. I'd suggest, in you case, not to invoice the order until you got the money, and to use the modified order printout for both packing and amount due pro-forma invoice to send along with the merchandise, then emit an invoice and send it via email when registering payment collected in Magento.

3. How can I modify an order (cancel one item from an order)?

This is normally not allowed in Magento (although there are some extensions allowing you to do so): Magento orders are meant to be historical information, and therefore left untouched once placed (modifications are complex and may involve adjustments in delivery costs, promotions, coupons being no longer applicable etc, so Magento does not provide this option OOB, rather would expect you to cancel the order all together and re-create a new one with modified items). You can use one of these extensions on the market that allow you to modify an order once placed, but keep in mind that this may break the standard flow and mechanisms, and create inconsistencies in historical data.

4. Can I cancel an order after I ship it?

Not with out-of the box functionality, for the reasons explained in answer on question 3. Still, there may be extensions allowing you to do so, but these are to be used with caution, not to create inconsistencies in data. See the order state diagram for allowed actions after shipment is registered in Magento.

5. How do I handle a COD order return?

Again, to my knowledge, Magento does not provide returns management OOB (even though Enterprise Edition may have some features depending on the version, these are not a complete return management system). You could use Credit Notes to register refunds (returning the items in stock) for that purpose, not sure whether this suits your business needs... And of course there are 3rd-party extensions providing the returns management features, perhaps you could consider one of those.

6. Can you suggest the best tutorial for Magento 2 order flow sequence, credit memo, generating packing slip etc?

Well, apart from this (quite long) explanation and the blog article I included as a link, I'd say the Magento User Guide would be appropriate, however do not expect much details from that one, as Magento did not spend too much effort in documenting these processes (official documentation is scarce for other features as well).

If you needed more details, I'd suggest you use Stack Overflow / Magento Stack Exchange and ask more specific questions: there's plenty of developers that would be glad to answer your questions, it's just a matter of asking the right, specific questions.

I hope you have at least some of the information you need, now.

Related Topic