Generating Credit Notes When Making Refunds in WooCommerce

Modified on Fri, 6 Dec at 1:16 PM

Generating Credit Notes When Making Refunds in WooCommerce 

Credit notes for unpaid invoices and cancelled orders 

We have enhanced the Xeroom functionality in this area.   Previously Xeroom handled a cancelled order in WooCommerce by voiding the unpaid invoice in Xero. This is not satisfactory for a number of reasons detailed below. 


Xeroom CN Processing - Use Cases 

Instead of voiding and creating new invoices for any adjustments Xeroom will now create a credit note for any adjustment/refund differences to an unpaid invoice and also if the payment is sent (per the new setting) also update the existing unpaid invoice. 


1. No invoices are automatically voided due to risk of missing an invalid void.

2. Check is made for any existing credit note to avoid double credit note generation in case of multiple WC order steps eg a Cancellation followed by a Refund.

3. Multiple refunds are handled with updates to the invoice. 

6. Invoices are matched with credit notes and payments matched with refunds.

7. The appropriate inventory adjustments to add back items are made.

8. TBD Add option to make automatic refund payment to same account as original invoice payment.



The WooCommerce order dash shows the Xero status in the rightermost column.  We have added an additional status as detailed below.

 

   When a normal order is paid and then refunded in part or full.

When an order has not had its payment posted but refunds have been made and CN’s generated.

Further info and examples - Failed, cancelled and pending payment order status’s?

WooCommerce defines these status’s as the following:

Cancelled order - The order was either raised in error or cancelled by an admin or the customer maybe due to an administrative mistake.  By default, WooCommerce allows customers to cancel their orders themselves only if they are pending, but does not allow it if the order is in any other status: processing, completed, on hold, etc.   This can lead to a lot of wasted time for customers who then have to contact the store to get it cancelled.   To avoid this there are code snippets that enable orders to be cancelled in other states https://wphelp.blog/how-to-allow-customers-to-cancel-their-orders-in-woocommerce/

Failed order - The customer’s payment failed or was declined, and no payment has been successfully made resulting in an immediate “Pending payment” status which flips to “Failed order” status once the hold stock window has expired.  

Pending payment order – This can arise for a number of reasons eg the user is unable to pay the order correctly, and then instead of trying to pay again, he creates a new duplicate order. WooCommerce does have an option to automatically cancel an order if the order has the status of “Pending payment” for longer than the set value of “Hold stock” in WooCommerce > Settings > Products > Inventory. The default is 10080 minutes, which is 7 days. One this time window limit is reached then the “Unpaid Order Cancelled – Time Limit Reached” error will show on the WooCommerce Orders dashboard.

For more info:

  1. https://woo.com/document/managing-orders/ 
  2. https://woo.com/posts/understand-and-fix-failed-order-status-in-woocommerce/


Treatment in Xero for unpaid orders 

Once the order is cancelled in WooCommerce you will need to mark it as void in Xero manually.  

NB:  Note that if the process spans an accounting period close eg month or quarter end then good accounting practice will not permit this in which case the unpaid invoice in Xero will require a credit note to be raised. 

If the order is unpaid and was not raised in error, you should not cancel it. You should create a credit note instead.  If the order has had any payments recorded against it, you should not cancel it. You should process a refund instead.

 

Reduce the amount due on an unpaid order

You may wish to do this because you have cancelled some (or all) of the registrations, or because of an administrative mistake. To reduce the total due for an order, you need to add a credit note to reflect the adjustment.  This is not an actual refund (which applies only to payments), but a credit note that adjusts the sales revenue for the existing invoice.

Worked Example 1 – Payment posted when a refund made

In the following example the order for 5 phones needed to be amended to 4 phones.  The invoice in Xero had not had the payment sent but in the WooCommerce order a refund for the 1 phone had been made.  Xeroom posted the payment for this adjustment part only and also created a credit note for the same amount so the new balance showing in Xero is correct.  Note that normally an instant payment like Stripe or card would be automatically posted to Xero so this treatment is for situations where the payment hasn’t been made as previously discussed (In this example it was).

The new default setting in Xeroom to create this treatment is:

 

 

The order in WooCommerce and Xero invoice and credit notes are as follows:

 

 

 

 

 

 

 

And the Xero status in this case shows as follows with the total amounts before and after the Credit Note is generated.  The inventory is also incremented to reflect the adjustment.

 

If multiple refunds/adjustments are made to the order then the invoice is updated accordingly showing multiple payments and credit notes.

 

 

Worked Example 2 – Payment  is not posted when a refund made

In this case the payment for the adjustment is not posted and so doesn’t show on the invoice.  The Credit Note is generated as before.

 

The order in WooCommerce and Xero invoice and credit notes are as follows:

 


The Xero status shows the same as before:


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article