DocsSales tax with Stripe Tax
Pro
Sales tax with Stripe Tax
Calculate sales tax on checkout via Stripe Tax.
Enable
Set STRIPE_TAX_ENABLED=true and ensure STRIPE_SECRET_KEY is configured.
SDK usage
const result = await window.genmb.commerce.tax({
currency: 'usd',
lineItems: [{ amount: 29.99, quantity: 2 }],
customerDetails: {
address: {
line1: '123 Main St',
city: 'San Francisco',
state: 'CA',
postalCode: '94105',
country: 'US',
},
},
});
// { taxAmount: 5.62, breakdown: [...] }Calls are cached in Redis for 5 minutes by (currency, amount, ship-to-postal). Repeat lookups during the same checkout session are free.
The endpoint returns the full Stripe `calculationId` so you can later finalize the calculation when the payment intent is created.
Stripe Tax billing is separate from GenMB credits - charges are billed by Stripe directly to your Stripe account.
FAQs
How is tax calculated?▾
GenMB calls Stripe Tax /v1/tax/calculations with your line items, currency, and the customer ship-to address. Stripe returns the tax amount per jurisdiction; we surface it back to the SDK.
Do I need to register for sales tax?▾
Tax calculation is independent of registration. Stripe Tax will only auto-collect in jurisdictions where you have a registration on file. Read the Stripe Tax docs for setup.
What if Stripe Tax is not enabled?▾
The endpoint returns `taxAmount: 0` with `info: tax-not-configured`. Your checkout still works; tax is just not added.