Refunds & Credit Notes

Refund Sync Overview

When a WooCommerce order is refunded, WooSync automatically creates a Credit Note (return Sales Invoice) in ERPNext, maintaining accurate accounting records.

Triggering Refunds

Refunds are triggered when a WooCommerce order status changes to refunded (full refund) or when a partial refund is issued via the WooCommerce Orders screen.

Full Refunds

For a full refund:

  1. WooSync locates the original ERPNext Sales Invoice via the Caz Woo Order Mapping
  2. Creates a return Sales Invoice (is_return = 1) linked to the original via return_against
  3. The return invoice includes all original line items with negative quantities
  4. Optionally submits the credit note based on your store’s Auto Submit Sales Invoice setting

Partial Refunds

For a partial refund:

  1. WooSync creates a return Sales Invoice with a single “Refund Adjustment” line item for the partial refund amount
  2. The item code used is configurable in Caz Woo Settings
  3. The credit note is linked to the original invoice

Requirements

For refund sync to work, a Sales Invoice must already exist for the order. If accounting sync was not enabled when the order was first processed, WooSync will log a warning and skip the credit note creation. You can manually create the credit note in ERPNext in this case.

Idempotency

WooSync checks for existing return invoices (is_return = 1) linked to the original invoice before creating a new one, preventing duplicate credit notes from repeated webhook deliveries.

Was this article helpful?