Place of Supply in WooCommerce + Razorpay: The Four Cases the Stack Gets Wrong

WooCommerce has a billing_state and a shipping_state. Razorpay has an order payload with neither in the shape GST actually wants. Four scenarios where the stack silently gets place-of-supply wrong, where in the hook chain to intercept it, and what we store on the order so the CA can audit the decision later.

12 October 2026 · 9 min read

The place-of-supply field in WooCommerce does not exist. There is a billing_state and a shipping_state, and the Razorpay order payload has neither in the shape the GST rules actually want — which is where every reconciliation we have done this year has started coming apart. Nine times out of ten the invoice plugin reads billing_state, compares it to the seller state, and picks CGST+SGST or IGST on that single comparison. Fine until it isn't. And when it isn't, you only find out six weeks later, when someone sits down with the GSTR-1 and the sales register and the numbers refuse to meet.

On 7 August we had a B2B order from a buyer registered in Gurugram, shipping to their Pune warehouse. The invoice came out with CGST+SGST (Haryana) because the billing address was Gurugram and the seller GSTIN is also Haryana. Looked clean. It wasn't — the place of supply for a registered recipient is the location of the recipient, which in this case the buyer wanted booked against their Maharashtra GSTIN (they had two, and the ship-to told us which one). IGST was due. We caught it in Q2 reconciliation, six weeks after the fact, and had to issue a credit note and reissue. Not catastrophic. Annoying. The sort of thing that compounds if you run two hundred B2B invoices a month.

Where the stack decides place-of-supply today (and why it's wrong)

Most WooCommerce GST invoice plugins — true of the free ones and most of the paid ones we have audited — hook into woocommerce_checkout_create_order. That hook fires early, before the order is persisted, which is actually the right place to decide tax treatment because by the time woocommerce_checkout_order_processed fires, the order row is written and the line-item tax breakdown is already in wp_woocommerce_order_itemmeta. If you try to resolve POS in the _processed hook, you are editing an invoice that in some setups has already been emailed. We learned this the slow way on a client where the PDF invoice plugin fired on woocommerce_new_order, which runs between the two — meaning the "corrected" POS never made it onto the document the buyer actually received.

So the sequencing matters. POS resolution has to run inside woocommerce_checkout_create_order, with priority set earlier than whatever the invoice plugin is using, and the resolved value has to be written to order meta before any downstream hook reads it. Priority 5 if the invoice plugin is at 10. We default to 1 just to be safe.

The reason the plugins get it wrong is not that they are badly written. They trust billing_state as the source of truth for place-of-supply, and billing_state is just the state on the billing address form — it has no idea whether the buyer is registered in that state, whether the goods are being shipped elsewhere, whether the buyer is outside India, or whether the seller has an alternate GSTIN that would change the whole calculation. We stopped trusting it as a POS source after that August Gurugram-to-Pune invoice. Now it is one input among several, nothing more.

Four scenarios where the default resolution breaks:

  1. B2C with bill-to and ship-to in different states. Customer bills to Karnataka, ships to a cousin in Kerala for Onam. POS for a B2C supply of goods is the ship-to location when the supply involves movement — not the billing address. Default plugin behaviour reads billing. Wrong tax split, every time, unless someone has written a resolver.
  2. B2B with buyer GSTIN registered in a third state. The one that burned us in August. Buyer bills to Haryana, ships to Maharashtra, GSTIN is Maharashtra. POS is Maharashtra. The invoice plugin reads Haryana because that is what the billing form said.
  3. Export of services where buyer country sits in Razorpay customer metadata. The WooCommerce billing address might say India (because the card is Indian-issued, or because the buyer filled it in that way), but Razorpay's notes or customer object captured a non-IN country code at payment time. If the buyer entity is actually abroad, this is zero-rated. If you miss it, you charge IGST on an export, which the buyer will not pay and your CA will not love you for.
  4. Intra-state order where the seller has multiple GSTINs across states. Rarer, but we have two clients in this bucket — one has a Karnataka GSTIN and a Tamil Nadu GSTIN. An order shipped from the TN warehouse to a TN buyer should be billed under the TN GSTIN with CGST+SGST (TN). If the plugin is hardcoded to the primary GSTIN (Karnataka), you get an IGST invoice on what is actually an intra-state supply. Reverse of the usual bug.

None of these four is particularly exotic — all of them show up across the stores we work with in the ₹50 lakh to ₹5 crore GMV range. They are not caught upfront because the invoice looks internally consistent — the maths adds up, the GSTIN format validates, the PDF renders. The error is upstream, in which tax rule got picked.

What we write into the order meta before any invoice fires

The fix is not a plugin. We tried that route — spent about two weeks evaluating the three or four GST invoice plugins that claim to handle multi-state B2B properly, and the honest answer is that none of them handled all four scenarios in a way we trusted. So we write a resolver. Maybe 180 lines of PHP, lives in a mu-plugin so it survives theme updates, hooks woocommerce_checkout_create_order at priority 1.

What it does, in order: pull billing_country, billing_state, shipping_state, the buyer GSTIN if provided, and the Razorpay notes payload. Decide which seller GSTIN applies (we keep the mapping in wp_options as a JSON blob — ugly but auditable). Apply the four rules in a fixed order: export check first, then multi-GSTIN seller check, then B2B-with-GSTIN check, then B2C ship-to check, then fall through to billing_state. Write three things to wp_postmeta:

  • _dz_pos_state — the resolved state code (or country code for exports)
  • _dz_pos_rule — which of the four rules fired (we use short strings: "export", "multi_gstin", "b2b_gstin", "b2c_shipto", "default_billing")
  • _dz_pos_resolved_at — ISO 8601 timestamp

The invoice plugin — we are mostly on a modified fork of one of the free ones now — reads _dz_pos_state instead of billing_state when it computes the tax split. If the meta is missing (shouldn't be, but) it falls back to the old behaviour and logs a warning. We have not seen the fallback trigger in production, but Faisal added it after an argument about what the resolver should do if the Razorpay webhook arrived before the create_order hook completed. Which, honestly, we have never fully reproduced — the race is theoretically possible, we have just not seen it.

On the Razorpay side, we use the notes field on the order creation call to persist the resolved POS state code alongside the buyer GSTIN. So the Razorpay dashboard entry for every order has notes.pos_state and notes.buyer_gstin. This is the bit the CA actually uses when something looks off in the sales register — they can pull the Razorpay order, see the POS we resolved, see the rule that resolved it, and trace it back to the WooCommerce order meta without having to ask us. That audit trail is the whole point. Without it, every reconciliation question becomes a developer ticket, and we have better things to do in October than explain why order #4471 was booked as IGST.

Aside: the worst version of this we ever saw was a store that resolved POS in a cron job that ran at 2 AM, after the invoices had been emailed. The CA had been quietly adjusting the GSTR-1 by hand for eleven months before anyone told us. Eleven months.

The export-of-services case we still argue about internally

The one that still gets debated internally — Mira and Riya disagree and neither of them is obviously wrong — is the export-of-services case where the buyer pays via an Indian-issued corporate card but the entity is registered abroad. Think a Singapore-registered subsidiary of an Indian group, using a corporate card issued by an Indian bank, buying a SaaS subscription from a Bengaluru vendor. The Razorpay billing country on the card will come back as IN. The buyer's actual place of establishment is SG. If you treat it as a domestic supply you charge IGST. If you treat it as an export of services you zero-rate it and claim the refund route.

We currently key off the Razorpay customer billing country as the signal. If it says SG, we zero-rate. The argument against this — Mira's position, mostly — is that the billing country on a corporate card reflects where the card was issued, not where the recipient entity is established, and the two can differ for exactly this reason. The CGST position on export of services requires that the recipient be located outside India, which is a factual question about the entity, not about the card. We have been reading the entity location off the Razorpay notes.buyer_country field, which we populate from a checkout question. But a checkout question is self-declared. A buyer could tick the wrong box.

The cleaner test would involve verifying the buyer's foreign registration — some kind of document check at checkout or asynchronously after the order — but that is friction we have not yet asked clients to add, because the volumes don't justify it for most of them. For now we take the Razorpay billing country, cross-check it against the self-declared buyer country, and if they match and both are non-IN we treat it as zero-rated and store _dz_pos_rule = "export" on the order. We are not fully convinced that is defensible if an officer actually challenges it. If anyone has a cleaner test — something that holds up without putting a KYC flow in front of a ₹1,200 SaaS checkout — send it over.

Ready to build something that works?

Get a free website mockup for your business. No commitment, no fluff — just what it could look like.

WhatsApp replies in seconds.

WhatsApp Call Free mockup
WhatsApp us · replies in seconds