stripe-fee-estimator
v1.1.0
Published
Estimate Stripe processing fees, reverse-calculate gross charges, and use custom fee presets from the CLI or as a JavaScript library.
Maintainers
Readme
stripe-fee-estimator
Estimate Stripe-style processing fees from the command line or from JavaScript.
This package supports normal gross-to-net estimates, reverse calculations for target net payouts, built-in fee variations, custom one-time fees, and saved custom presets.
Disclaimer: This tool provides estimates only. Actual Stripe pricing can vary by country, payment method, custom pricing, taxes, disputes, Connect, payout method, and other Stripe products. Always verify against your Stripe Dashboard and Stripe's official pricing page.
Install
npm install -g stripe-fee-estimatorOr run without installing:
npx stripe-fee-estimator 100CLI usage
stripe-fee-estimator 100Example output:
Gross: $100.00
Fee: $3.20
You get: $96.80
Profile: Online domestic card
Rate: 2.9% + $0.30Reverse-calculate the amount to charge:
stripe-fee-estimator --net 100Target net: $100.00
Charge: $103.30
Fee: $3.30
You get: $100.00Built-in fee profiles
stripe-fee-estimator 100 --online
stripe-fee-estimator 100 --in-person
stripe-fee-estimator 100 --achBuilt-in variations
stripe-fee-estimator 100 --manual
stripe-fee-estimator 100 --international
stripe-fee-estimator 100 --currency-conversion
stripe-fee-estimator 100 --dispute-protection
stripe-fee-estimator 100 --instant-payoutYou can combine them:
stripe-fee-estimator 100 --online --international --currency-conversionCustom one-time fees
Add a one-time fixed amount:
stripe-fee-estimator 100 --one-time-fixed 2.00Add a one-time percentage:
stripe-fee-estimator 100 --one-time-percent 1.5%Add custom recurring-style fee components:
stripe-fee-estimator 100 --add-percent 1.5% --add-fixed 0.10Override the base fee entirely:
stripe-fee-estimator 100 --percent 2.9% --fixed 0.30Saved custom presets
Save a preset:
stripe-fee-estimator --save-preset schoolclub --percent 2.5% --fixed 0.25 --label "School club processor"Use it later:
stripe-fee-estimator 100 --preset schoolclubList presets:
stripe-fee-estimator --list-presetsSaved presets are stored locally at:
~/.stripe-fee-estimator/presets.jsonJSON output
stripe-fee-estimator 100 --jsonJavaScript usage
import { estimateStripeFee, grossFromNet } from "stripe-fee-estimator";
const estimate = estimateStripeFee(100, {
preset: "online",
addons: ["international", "currencyConversion"]
});
console.log(estimate.net);
const charge = grossFromNet(100, {
preset: "online"
});
console.log(charge.gross);API
estimateStripeFee(amount, options)
Calculates fee and net amount from a gross charge.
grossFromNet(targetNet, options)
Calculates the approximate gross charge needed to receive a target net amount.
Options
{
preset: "online",
addons: ["international"],
customPercent: 0.015,
customFixed: 0.10,
oneTimePercent: 0.01,
oneTimeFixed: 2.00,
overridePercent: 0.029,
overrideFixed: 0.30,
currency: "USD"
}Publish checklist
Before publishing:
npm test
npm pack --dry-run
npm login
npm publish --access publicFor updates:
npm version patch
npm publishRepository
GitHub repository:
https://github.com/ethantphillips/stripefeeestimatorLicense
MIT
