<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akasha Ahmed</title>
    <description>The latest articles on DEV Community by Akasha Ahmed (@akasha_ahmed).</description>
    <link>https://dev.to/akasha_ahmed</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4269100%2F3bd55463-6dbe-468b-9183-ddb6ad688511.png</url>
      <title>DEV Community: Akasha Ahmed</title>
      <link>https://dev.to/akasha_ahmed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akasha_ahmed"/>
    <language>en</language>
    <item>
      <title>The Weird Math Behind Online Marketplace Fees: Modeling 15 Resale Apps in TypeScript</title>
      <dc:creator>Akasha Ahmed</dc:creator>
      <pubDate>Fri, 27 Nov 2026 13:57:19 +0000</pubDate>
      <link>https://dev.to/akasha_ahmed/the-weird-math-behind-online-marketplace-fees-modeling-15-resale-apps-in-typescript-2lg8</link>
      <guid>https://dev.to/akasha_ahmed/the-weird-math-behind-online-marketplace-fees-modeling-15-resale-apps-in-typescript-2lg8</guid>
      <description>&lt;p&gt;When I started building &lt;a href="https://www.resalemargin.com" rel="noopener noreferrer"&gt;ResaleMargin&lt;/a&gt;, I assumed calculating marketplace seller fees would be basic arithmetic: take a sale price, multiply by a percentage, subtract a fixed fee.&lt;/p&gt;

&lt;p&gt;In practice, almost every US resale platform calculates its fee base, thresholds, and rounding differently. If you treat them all as &lt;code&gt;price * rate&lt;/code&gt;, your numbers end up wrong by several dollars.&lt;/p&gt;

&lt;p&gt;Here are the most surprising edge cases I ran into while modeling fee schedules across marketplaces in TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Fee Bases Aren't Just the Item Price
&lt;/h2&gt;

&lt;p&gt;Different platforms include completely different things in the fee base:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;eBay:&lt;/strong&gt; Charges its Final Value Fee (13.6% in most categories, up to $7,500 per item) on &lt;strong&gt;item price + buyer-paid shipping + sales tax&lt;/strong&gt;, plus a tiered per-order fee ($0.30 for orders &amp;lt;= $10, $0.40 above $10).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mercari:&lt;/strong&gt; Charges 10% on &lt;strong&gt;item price + buyer-paid shipping&lt;/strong&gt;, but &lt;strong&gt;excludes sales tax&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whatnot:&lt;/strong&gt; Splits the base - its 8% commission applies to the item price, while its &lt;code&gt;2.9% + $0.30&lt;/code&gt; payment processing fee applies to the full buyer total including shipping.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a $50 item has $12 shipping and $4 tax, "10%" doesn't mean $5.00 on Mercari - it means &lt;strong&gt;$6.20&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Hard Threshold "Cliffs" Create Pricing Dead Zones
&lt;/h2&gt;

&lt;p&gt;Several platforms have sharp breakpoints instead of smooth curves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Poshmark (&lt;a href="https://www.resalemargin.com/poshmark-fee-calculator" rel="noopener noreferrer"&gt;Poshmark Fee Calculator&lt;/a&gt;):&lt;/strong&gt; Takes a flat &lt;strong&gt;$2.95&lt;/strong&gt; on sales under $15, then jumps to &lt;strong&gt;20%&lt;/strong&gt; at $15.00 and above. That means selling an item for $15.00 leaves you &lt;strong&gt;$12.00&lt;/strong&gt;, whereas selling it for $14.99 leaves &lt;strong&gt;$12.04&lt;/strong&gt; - you actually net less by charging a penny more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grailed:&lt;/strong&gt; Charges &lt;strong&gt;6%&lt;/strong&gt; (minimum $1.99) below $120 and &lt;strong&gt;9%&lt;/strong&gt; at $120 and above, plus &lt;code&gt;3.49% + $0.49&lt;/code&gt; payment processing. Selling at $119 leaves more net payout than selling at $122.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;eBay Sneakers:&lt;/strong&gt; Drops to &lt;strong&gt;8%&lt;/strong&gt; with &lt;strong&gt;$0&lt;/strong&gt; per-order fee at $150+, compared to standard category tiers below $150.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Reverse Pricing ("What Should I List At?")
&lt;/h2&gt;

&lt;p&gt;Sellers rarely just want to know fees - they want to know: &lt;em&gt;"I paid $12 for this jacket and want $25 profit. What price should I list at?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For a pure percentage platform, you can invert the formula directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;requiredPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;targetProfit&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;itemCost&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sellerShipping&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fixedFee&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;variableRate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For tiered platforms like Poshmark (&amp;lt;$15 flat vs &amp;gt;=$15 percentage) or eBay ($0.30 vs $0.40 order fee, plus marginal category tiers over $2,500 / $7,500), solving algebraically has boundary jumps - so checking candidate breakpoints ensures the reverse calculation matches the forward fee engine down to the cent.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Shipping Dimensional Weight Is a Silent Margin Killer
&lt;/h2&gt;

&lt;p&gt;Even if your fee math is exact, USPS dimensional weight rules (&lt;a href="https://www.resalemargin.com/dimensional-weight-calculator" rel="noopener noreferrer"&gt;USPS Dimensional Weight Calculator&lt;/a&gt;) can wipe out profit on light, bulky items. Any box over &lt;strong&gt;1 cubic foot (1,728 cubic inches)&lt;/strong&gt; is billed at &lt;code&gt;ceil(L) * ceil(W) * ceil(H) / 139&lt;/code&gt; rounded up if that exceeds actual weight - so a &lt;code&gt;12" x 12" x 13"&lt;/code&gt; box containing a 3 lb item gets billed as &lt;strong&gt;14 lbs&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;I put all of these schedules into a static Next.js app that runs client-side with zero backend storage, alongside source links to each marketplace's published fee docs so sellers can verify every rate themselves.&lt;/p&gt;

&lt;p&gt;If you've ever built pricing engines or dealt with messy payment-fee rules, I'd love to hear which platform edge cases tripped you up.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>typescript</category>
      <category>ecommerce</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
