Resolving Incorrect Refund Quotes: A Deep Dive into BigCommerce Tax Plugin Interactions

Understanding BigCommerce Refund Quote Discrepancies with Third-Party Tax Plugins

A recent BigCommerce forum thread brought to light a critical issue faced by a merchant using the Quivers tax plugin: incorrect refund quote calculations. When the Quivers Tax plugin was enabled, refund quotes were generated for the full order amount, even when only a partial refund was intended. This scenario highlights the complexities of integrating third-party tax solutions with BigCommerce's core functionalities, particularly around sensitive financial operations like refunds.

The Problem Unveiled: Negative Tax Adjustments

The original poster, a developer for the Quivers plugin, observed that after introducing the plugin and enabling 'Quivers Tax,' refund quotes were consistently inflated. Initial diagnostic steps, guided by a BigCommerce Partner, involved verifying the refund payload, checking plugin settings, and testing the refund process with and without the Quivers Tax enabled. The challenge was to conduct an 'apples-to-apples' comparison, ensuring that the same order and payload were used for both scenarios.

Through iterative testing and sharing API payloads, the core issue was pinpointed. When Quivers Tax was ON, the total_refund_tax_amount field in the BigCommerce API response was returning a negative value (e.g., -6.285375). This negative tax value was then incorrectly subtracted from the order_level_refund_amount, leading to a significantly reduced and incorrect total_refund_amount. Conversely, when Quivers Tax was OFF, the total_refund_tax_amount was correctly near zero, resulting in an accurate total_refund_amount.

The Root Cause: Tax Provider API Misinterpretation

The crucial insight came from understanding how BigCommerce interacts with registered tax providers during the refund quote process. When a refund quote is requested via the /v3/orders/{orderId}/payment_actions/refund_quotes endpoint, BigCommerce calls the associated tax provider's estimate endpoint to calculate the tax adjustment for the refund. The problem was that the Quivers plugin's tax estimate endpoint was not differentiating between a forward transaction (order placement) and a refund scenario (a credit or reversal).

Instead of returning an appropriate tax value for a refund (which might be zero or a credit), the plugin was likely returning a standard tax calculation. BigCommerce then interpreted this as a negative tax adjustment, causing the final refund amount to be skewed.

Solution and Best Practices for Tax Integrations

For developers building or maintaining BigCommerce tax integrations, this thread offers vital lessons:

  • Differentiate Transaction Types: Ensure your tax provider's API endpoint can recognize and correctly process requests for both forward transactions (orders) and refund/credit scenarios.
  • Review Request Payloads: Thoroughly examine the request payload BigCommerce sends to your tax estimate endpoint during a refund quote. It should contain signals indicating a refund.
  • Consult BigCommerce API Documentation: Cross-reference with the BigCommerce Tax Provider API documentation to confirm the expected request and response contract for refund scenarios.
  • Temporary Workaround: If processing refunds programmatically, the order_level_refund_amount field can be referenced as a reliable figure until the tax plugin bug is resolved, as it correctly reflects the refund amount before the erroneous tax adjustment.

This case underscores the importance of robust and context-aware integration for third-party applications, especially those handling critical financial calculations within the BigCommerce ecosystem. Proper handling of refund scenarios in tax provider APIs is essential for accurate financial reporting and customer satisfaction.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools