Backend · Skill

Add shipping and tax rates

add-shipping-and-tax-rates

Adds fixed delivery choices and Stripe Tax on an existing payment checkout, so the buyer picks postage and tax follows their address. Use this when the user wants shipping rates, delivery options, sales tax, VAT, GST, or tax on postage.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-shipping-and-tax-rates/raw' -o ~/'.claude/skills/add-shipping-and-tax-rates/SKILL.md'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-shipping-and-tax-rates/raw' -o '.cursor/skills/add-shipping-and-tax-rates/SKILL.md'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-shipping-and-tax-rates/raw' -o '.agents/skills/add-shipping-and-tax-rates/SKILL.md'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

This skill adds delivery options and tax to a checkout you already have. It does not create the first payment session or the webhook. Use add-stripe-checkout for those. Use apply-stripe-best-practices when you want a review, not a build.

When to use

  • Buyers must pick standard or express delivery, with a price and a window.
  • You want Stripe Tax to add sales tax, VAT or GST from the address.
  • Postage itself should be taxed, not only the goods.

When not to use

  • You only need a single charge with no delivery and no tax.
  • You are choosing which Stripe product to use. That is the review skill.

Steps

  1. Write down each option: display name, amount in the smallest currency unit, currency, countries, and a minimum and maximum delivery window.
  2. Create a Shipping Rate in Stripe for each option, or pass shipping_rate_data on the session. Set tax_behavior to exclusive or inclusive on every rate. Match the same choice on your Prices.
  3. On the Checkout Session, set mode to payment. Pass shipping_options with those rate ids. Set shipping_address_collection.allowed_countries to the countries you actually ship to.
  4. In the Stripe Dashboard, turn on Stripe Tax, set your origin address, and add a registration for each place you must collect. With no registration, tax stays at zero.
  5. Set automatic_tax: { enabled: true } on the session. For digital goods with no delivery, collect the billing address instead of a shipping address so Tax still has a location.
  6. In the paid webhook, read the shipping amount, the rate id and the tax from the completed session. Store those on the order. Do not calculate a second tax figure in your own code.
  7. If a country has no rate, do not offer a session that ships there. Filter the options before you create the session.
const session = await stripe.checkout.sessions.create({
  mode: "payment",
  line_items: [{ price: priceId, quantity: 1 }],
  shipping_address_collection: { allowed_countries: ["AU", "NZ"] },
  shipping_options: [{ shipping_rate: "shr_..." }],
  automatic_tax: { enabled: true },
});

Gotchas

  • shipping_options are for payment mode. A subscription session will reject them.
  • Automatic tax fails the session when a shipping option has no tax_behavior.
  • Mixing inclusive and exclusive on one order makes the total hard to explain. Pick one.
  • A live registration is a business decision. Do not turn collection on for a country where you are not registered.
  • Carrier-calculated rates need Stripe's dynamic shipping flow. This skill is the fixed-rate path. Check the current Stripe docs before you build live carrier quotes.

Safety

  • Create the session on the server. The secret key stays in an environment variable, never in the browser or the repo.
  • The address collected for tax is personal data. Store only what the order needs, and do not log the full address.

Portability

Works with any backend Stripe supports. If you use another tax engine instead of Stripe Tax, still collect one address and still store the shipping choice on the order. Do not run two tax calculators on the same session.

Example prompt

"Add standard and express postage to my Stripe checkout, and charge GST from the delivery address with Stripe Tax."

Done when

  • The buyer sees only the delivery options for their country, with the right price.
  • The paid session records a shipping amount and a tax amount that match the Dashboard.
  • A test address in an unregistered country does not silently invent a tax figure.

---

House original by TheSkillVault (CC-BY-4.0).

Licence

Licence: CC BY 4.0. Attribution when you reuse it: From TheSkillVault, https://theskillvault.ai, CC BY 4.0