<?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: Starway Global</title>
    <description>The latest articles on DEV Community by Starway Global (@starwayglobalfz).</description>
    <link>https://dev.to/starwayglobalfz</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%2F4240725%2F074e41bc-423f-444c-9535-e52663bfb5fd.png</url>
      <title>DEV Community: Starway Global</title>
      <link>https://dev.to/starwayglobalfz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/starwayglobalfz"/>
    <language>en</language>
    <item>
      <title>How to choose a refund maturity window before scaling TikTok Shop ads</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:53:54 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/how-to-choose-a-refund-maturity-window-before-scaling-tiktok-shop-ads-5em7</link>
      <guid>https://dev.to/starwayglobalfz/how-to-choose-a-refund-maturity-window-before-scaling-tiktok-shop-ads-5em7</guid>
      <description>&lt;p&gt;A TikTok Shop campaign can look profitable on the day an order arrives and become materially less profitable after refunds, cancellations, creator adjustments and settlement corrections arrive. The mistake is not using early revenue at all. The mistake is treating every order in a young cohort as equally settled when deciding the next budget increase.&lt;/p&gt;

&lt;p&gt;This article defines a reproducible way to choose a refund maturity window. The window should cover the age at which most observed refund activity has arrived for comparable orders. The output is an operating rule: when a cohort is old enough, calculate contribution from the matured subset and convert it into a spending cap.&lt;/p&gt;

&lt;p&gt;The method uses synthetic examples. It does not prove incremental lift, guarantee ad performance or replace settlement reconciliation with the platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with refund age, not a fixed calendar promise
&lt;/h2&gt;

&lt;p&gt;Do not select 7, 14 or 30 days because those numbers sound conservative. Measure the age distribution of refunds for comparable products, markets and sales channels.&lt;/p&gt;

&lt;p&gt;For each historical order cohort:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;refund age = refund posting date - order cohort date
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Group refunds by age in days, then calculate the share of the cohort's total observed refund value that arrived by each age:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cumulative refund value through age D
= sum of refund value with age &amp;lt;= D

cumulative refund share through age D
= cumulative refund value through age D
 / final observed refund value for the cohort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose the smallest age &lt;code&gt;D&lt;/code&gt; that clears an explicit threshold, such as 90% of the observed refund value. The threshold is a risk policy, not a statistical guarantee. Use separate curves when refund behavior differs materially by category, market, seller-funded discount policy or fulfilment method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Freeze the maturity rule before the test
&lt;/h2&gt;

&lt;p&gt;Record these inputs before changing spend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;maturity_window_days = D&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;the refund-share threshold used to choose &lt;code&gt;D&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;the cohort start and end dates;&lt;/li&gt;
&lt;li&gt;included stores, markets and currencies;&lt;/li&gt;
&lt;li&gt;platform-fee and payment-fee assumptions;&lt;/li&gt;
&lt;li&gt;creator commission treatment;&lt;/li&gt;
&lt;li&gt;the minimum contribution coverage ratio.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the rule changes after seeing the result, it becomes a post-hoc explanation. Version it instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculate a mature contribution floor
&lt;/h2&gt;

&lt;p&gt;For only the orders that have passed the mature-age cutoff, calculate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mature contribution floor
= net sales after mature refunds
 - cost of goods sold
 - outbound fulfilment and return cost
 - platform and payment fees
 - creator and affiliate commission
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If contribution is calculated per order first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mature contribution floor
= eligible matured orders x contribution per matured order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep ad spend outside the floor so it can be compared with the coverage requirement in the next step. Do not deduct the same refund, fee or commission twice. This matured-subset contribution is not a guaranteed lower bound on the whole campaign: immature orders can still incur losses, late fees and refunds. Reserve for those exposures separately before increasing spend; without that reconciliation, the calculated headroom alone does not justify scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Convert contribution into a spending cap
&lt;/h2&gt;

&lt;p&gt;Define a minimum pre-ad coverage ratio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;coverage ratio
= mature contribution floor / ad spend

spending cap
= mature contribution floor / minimum coverage ratio

headroom
= max(0, spending cap - current spend)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ratio is company policy. A higher ratio requires more mature contribution behind every dollar of advertising. Use one currency and one market per calculation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example
&lt;/h2&gt;

&lt;p&gt;A store uses a 14-day maturity window and a minimum coverage ratio of &lt;code&gt;1.40&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Attributed orders&lt;/td&gt;
&lt;td&gt;1,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orders that pass the maturity cutoff&lt;/td&gt;
&lt;td&gt;840&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Net sales after mature refunds&lt;/td&gt;
&lt;td&gt;$44,100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;COGS&lt;/td&gt;
&lt;td&gt;$19,800&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fulfilment and return cost&lt;/td&gt;
&lt;td&gt;$4,400&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform and payment fees&lt;/td&gt;
&lt;td&gt;$2,205&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creator commission&lt;/td&gt;
&lt;td&gt;$2,100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mature pre-ad contribution floor&lt;/td&gt;
&lt;td&gt;$15,595&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Current ad spend&lt;/td&gt;
&lt;td&gt;$9,800&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spending cap at 1.40 coverage&lt;/td&gt;
&lt;td&gt;$11,139.29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remaining headroom&lt;/td&gt;
&lt;td&gt;$1,339.29&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The floor is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;44,100 - 19,800 - 4,400 - 2,205 - 2,100 = 15,595
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cap is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;15,595 / 1.40 = 11,139.29
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A 10% increase would add &lt;code&gt;$980&lt;/code&gt;, which is below the &lt;code&gt;$1,339.29&lt;/code&gt; headroom, so the proposed test budget is &lt;code&gt;$10,780&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Increase only by the smaller of the policy step and available headroom. Wait for a new complete cohort before approving another increase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducible SQLite query
&lt;/h2&gt;

&lt;p&gt;The following synthetic query returns the maximum refund age needed to cover a chosen share of refund value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;order_cohort_day&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;refund_age_days&lt;/span&gt; &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;refund_age_days&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;refund_value_cents&lt;/span&gt; &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;refund_value_cents&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-11-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-11-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="mi"&gt;7000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-11-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-11-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;totals&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;order_cohort_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;refund_value_cents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;total_refunds&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt;
  &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;order_cohort_day&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;ranked&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_cohort_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;refund_age_days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;refund_value_cents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_cohort_day&lt;/span&gt;
      &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;refund_age_days&lt;/span&gt;
      &lt;span class="k"&gt;ROWS&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="k"&gt;UNBOUNDED&lt;/span&gt; &lt;span class="k"&gt;PRECEDING&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;CURRENT&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cumulative_refunds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;total_refunds&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;
  &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;totals&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_cohort_day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="n"&gt;order_cohort_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;total_refunds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;MIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;refund_age_days&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;days_to_reach_90_percent&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;ranked&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;cumulative_refunds&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.90&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;total_refunds&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;order_cohort_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total_refunds&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The values total &lt;code&gt;$240&lt;/code&gt;. Cumulative refunds reach &lt;code&gt;$190&lt;/code&gt; (79.17%) at age 4 and &lt;code&gt;$230&lt;/code&gt; (95.83%) at age 9. A 90% policy therefore returns &lt;code&gt;9&lt;/code&gt; days for this invented cohort. At age 16 the cumulative total is &lt;code&gt;$240&lt;/code&gt; (100%). The separate spending-cap example above assumes a 14-day policy; it is not the output of this synthetic refund curve.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  One store-wide curve hides product differences
&lt;/h3&gt;

&lt;p&gt;High-refund SKUs can dominate the total while low-refund SKUs need a shorter window. Calculate separate curves for materially different product groups.&lt;/p&gt;

&lt;h3&gt;
  
  
  The observation window truncates old refunds
&lt;/h3&gt;

&lt;p&gt;Recent cohorts may not have had enough time to reveal their final refunds. Use only cohorts with a complete follow-up horizon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Attribution dates are mixed
&lt;/h3&gt;

&lt;p&gt;Use the same business-date convention for orders and refunds. A refund posted next month can belong to an order from this month without changing the order cohort's age definition.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creator costs arrive late
&lt;/h3&gt;

&lt;p&gt;If unpaid creator commission is missing, extend the observation window or hold the budget increase. Do not insert an estimate and present it as settled data.&lt;/p&gt;

&lt;h3&gt;
  
  
  The mature sample is too small
&lt;/h3&gt;

&lt;p&gt;A high contribution from a dozen orders is not a stable scaling signal. Set a minimum mature-order count or extend the period.&lt;/p&gt;

&lt;h3&gt;
  
  
  Currencies are combined
&lt;/h3&gt;

&lt;p&gt;Do not divide a multi-currency contribution total by one ad-spend number. Build the cap by store, market and currency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operating checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Measure refund age by comparable product and market.&lt;/li&gt;
&lt;li&gt;Select and version the maturity window before the budget test.&lt;/li&gt;
&lt;li&gt;Count only matured orders in the contribution floor.&lt;/li&gt;
&lt;li&gt;Use a fixed coverage ratio and one currency per cap.&lt;/li&gt;
&lt;li&gt;Increase spend by no more than the smallest policy step or available headroom.&lt;/li&gt;
&lt;li&gt;Wait for the next complete cohort before another increase.&lt;/li&gt;
&lt;li&gt;Keep ad spend, platform receipts, refunds and contribution as separate fields.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the complete planning framework, see the &lt;a href="https://www.fz567.cn/guides/gmvmax-complete-guide?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=refund-maturity-window&amp;amp;utm_content=guide" rel="noopener noreferrer"&gt;TikTok Shop GMV Max guide&lt;/a&gt;. The free &lt;a href="https://www.fz567.cn/tools/breakeven-roas-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=refund-maturity-window&amp;amp;utm_content=calculator" rel="noopener noreferrer"&gt;break-even ROAS calculator&lt;/a&gt; can test the contribution threshold used in the coverage ratio.&lt;/p&gt;

&lt;p&gt;The data and calculations above are synthetic. They demonstrate an auditable rule, not expected seller performance. Maintained by Starway Global, publisher of the linked guide and calculator.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>sql</category>
      <category>marketing</category>
      <category>database</category>
    </item>
    <item>
      <title>How to increase GMV Max budget without counting orders that have not matured</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 20 Nov 2026 11:00:45 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/how-to-increase-gmv-max-budget-without-counting-orders-that-have-not-matured-4i8d</link>
      <guid>https://dev.to/starwayglobalfz/how-to-increase-gmv-max-budget-without-counting-orders-that-have-not-matured-4i8d</guid>
      <description>&lt;p&gt;GMV Max dashboards can make a campaign look profitable before refunds, reversals and creator costs have settled. The early sales number is useful for traffic response. It is a weak input for a budget increase.&lt;/p&gt;

&lt;p&gt;Use a maturity rule. Count only orders old enough to support the decision. Build a conservative spending cap from their contribution. Increase spend in a small step and wait for the next complete cohort before approving another step.&lt;/p&gt;

&lt;p&gt;This model is for operators who can join ad spend to order cohorts. It does not prove incremental lift. It prevents immature orders from receiving the same weight as settled orders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define the settlement window
&lt;/h2&gt;

&lt;p&gt;Choose the number of days &lt;code&gt;L&lt;/code&gt; that an order cohort must age before its contribution can enter the decision.&lt;/p&gt;

&lt;p&gt;The window should cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the store's refund and cancellation pattern;&lt;/li&gt;
&lt;li&gt;delayed creator commission or affiliate adjustments;&lt;/li&gt;
&lt;li&gt;the time needed to reconcile platform and payment fees;&lt;/li&gt;
&lt;li&gt;any known settlement corrections that change contribution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a store with late refunds, 14 days may be too short. Use the observed lag distribution. A common operating rule is the age at which at least 90% of refunds for comparable cohorts have arrived.&lt;/p&gt;

&lt;p&gt;The budget rule treats younger orders as &lt;code&gt;UNMATURED&lt;/code&gt;. It does not set their contribution to zero forever. It keeps them outside the current spending decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculate the mature contribution floor
&lt;/h2&gt;

&lt;p&gt;For every cohort that has reached age &lt;code&gt;L&lt;/code&gt;, calculate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mature orders
= orders with refund treatment complete

contribution per matured order
= (
    net sales after seller discount and mature refunds
    - cost of goods sold
    - fulfilment
    - platform and payment fees
    - creator and affiliate commission
  ) / mature orders

pre-ad contribution floor
= mature orders x contribution per matured order
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ad spend stays outside contribution until this point. A fixed creative or production cost should also stay separate so the same cost is not deducted twice.&lt;/p&gt;

&lt;p&gt;The word "floor" matters. The model assigns no contribution to immature orders. That can understate eventual contribution. The tradeoff is deliberate: a budget step must survive without relying on orders that are still changing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set a spending cap
&lt;/h2&gt;

&lt;p&gt;Define a minimum contribution coverage ratio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;coverage ratio = pre-ad contribution floor / ad spend

spending cap = pre-ad contribution floor / minimum coverage ratio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the team requires $1.35 of pre-ad contribution for every $1.00 of ad spend, set the minimum coverage ratio to &lt;code&gt;1.35&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is not a universal target. A low-margin product can require a higher coverage ratio. A product with verified repeat purchases may use a different measure, but only when repeat contribution is evidenced and included consistently.&lt;/p&gt;

&lt;p&gt;Keep the minimum coverage ratio fixed for the test period. Changing it after seeing the result turns the cap into a post-hoc explanation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Increase in small, delayed steps
&lt;/h2&gt;

&lt;p&gt;Use this sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build a cohort that has reached age &lt;code&gt;L&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Calculate the pre-ad contribution floor and current coverage ratio.&lt;/li&gt;
&lt;li&gt;Calculate &lt;code&gt;headroom = spending cap - current spend&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Cap one increase at both &lt;code&gt;10% of current spend&lt;/code&gt; and the available headroom.&lt;/li&gt;
&lt;li&gt;Apply the smaller number.&lt;/li&gt;
&lt;li&gt;Wait until a new cohort reaches age &lt;code&gt;L&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Recalculate before approving another increase.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;headroom = max(0, spending cap - current spend)

proposed step
= min(0.10 x current spend, headroom)

next spend = current spend + proposed step
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Stop increasing when the contribution floor falls below the minimum coverage requirement. Do not count a campaign's immature revenue increase as evidence that the new spend has passed the rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example
&lt;/h2&gt;

&lt;p&gt;The numbers below are synthetic and use a 14-day maturity window.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Current cohort&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Attributed orders&lt;/td&gt;
&lt;td&gt;1,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mature orders after 14 days&lt;/td&gt;
&lt;td&gt;820&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mature maturity rate&lt;/td&gt;
&lt;td&gt;82.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Net sales after mature refunds&lt;/td&gt;
&lt;td&gt;$45,920&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;COGS&lt;/td&gt;
&lt;td&gt;$20,500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fulfilment&lt;/td&gt;
&lt;td&gt;$4,920&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform and payment fees&lt;/td&gt;
&lt;td&gt;$2,296&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creator commission&lt;/td&gt;
&lt;td&gt;$2,296&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pre-ad contribution floor&lt;/td&gt;
&lt;td&gt;$15,908&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Current ad spend&lt;/td&gt;
&lt;td&gt;$9,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contribution after ads&lt;/td&gt;
&lt;td&gt;$6,908&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Current coverage ratio&lt;/td&gt;
&lt;td&gt;1.768&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Minimum coverage ratio&lt;/td&gt;
&lt;td&gt;1.350&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spending cap&lt;/td&gt;
&lt;td&gt;$11,783.70&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The cap has $2,783.70 of headroom. A 10% step is $900, which is smaller than the headroom. The proposed test spend is &lt;code&gt;$9,900&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Do not approve the next increase from the same cohort. Wait for the next 14-day cohort and repeat the calculation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducible SQLite query
&lt;/h2&gt;

&lt;p&gt;The query below groups orders by acquisition day, joins cohort-level ad spend and returns only cohorts old enough for the decision.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;mature_cohorts&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cohort_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="cm"&gt;(*) AS attributed_orders,
    SUM(CASE WHEN o.order_status = 'mature' THEN 1 ELSE 0 END) AS mature_orders,
    SUM(
      CASE
        WHEN o.order_status = 'mature'
        THEN o.net_sales
             - o.refunded_amount
             - o.cogs
             - o.fulfilment
             - o.platform_fee
             - o.creator_commission
        ELSE 0
      END
    ) AS pre_ad_contribution_floor
  FROM orders AS o
  WHERE julianday(:decision_day) - julianday(o.cohort_day) &amp;gt;= :maturity_days
  GROUP BY o.cohort_day
),
cohort_economics AS (
  SELECT
    m.cohort_day,
    m.attributed_orders,
    m.mature_orders,
    m.pre_ad_contribution_floor,
    s.spend,
    m.pre_ad_contribution_floor / NULLIF(s.spend, 0) AS coverage_ratio
  FROM mature_cohorts AS m
  JOIN cohort_spend AS s USING (cohort_day)
)
SELECT
  SUM(pre_ad_contribution_floor) AS contribution_floor,
  SUM(spend) AS ad_spend,
  SUM(pre_ad_contribution_floor) / NULLIF(SUM(spend), 0) AS coverage_ratio,
  SUM(pre_ad_contribution_floor) / :minimum_coverage_ratio AS spending_cap
FROM cohort_economics;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query returns a portfolio total for all eligible cohorts in the chosen window. Run it by store, currency and market. Do not combine currencies into one spending cap.&lt;/p&gt;

&lt;h2&gt;
  
  
  A reproducibility check
&lt;/h2&gt;

&lt;p&gt;The following SQLite example creates two orders and two spend rows. One cohort is mature and one is younger than the decision window.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;cohort_day&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;order_status&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;net_sales&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;refunded_amount&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;cogs&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;fulfilment&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;platform_fee&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;creator_commission&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;cohort_spend&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;cohort_day&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;spend&lt;/span&gt; &lt;span class="kt"&gt;REAL&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'mature-1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'2026-11-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'mature'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;100.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;5.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;30.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;8.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'young-1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'2026-11-14'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'unmatured'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;200.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;60.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;16.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;8.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;6.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;cohort_spend&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-11-01'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;40.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-11-14'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;80.00&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;At a decision day of &lt;code&gt;2026-11-20&lt;/code&gt; and a 14-day maturity window, the mature cohort contributes &lt;code&gt;$100 - $5 - $30 - $8 - $4 - $3 = $50&lt;/code&gt;. Its coverage ratio is &lt;code&gt;$50 / $40 = 1.25&lt;/code&gt;. A &lt;code&gt;1.35&lt;/code&gt; minimum produces a spending cap of &lt;code&gt;$37.04&lt;/code&gt;, below the current &lt;code&gt;$40&lt;/code&gt;, so the rule blocks a larger step.&lt;/p&gt;

&lt;p&gt;The younger cohort remains outside the decision. Its revenue cannot be used to justify the increase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Refund policy changed
&lt;/h3&gt;

&lt;p&gt;Run separate maturity curves before and after the change. A store-wide curve can hide a new policy that increases late refunds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spend and orders use different dates
&lt;/h3&gt;

&lt;p&gt;Join spend to the same attribution day as the order cohort. A weekly spend total can make several daily cohorts look more profitable than they are.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creator cost arrives late
&lt;/h3&gt;

&lt;p&gt;Record creator commission as an event with its own settlement date. If the platform export omits unpaid commission, increase the maturity window or hold the budget instead of filling the gap with an estimate presented as actual.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple currencies
&lt;/h3&gt;

&lt;p&gt;Use one currency and one exchange-rate policy per analysis. A total that mixes currencies cannot produce a valid spending cap.&lt;/p&gt;

&lt;h3&gt;
  
  
  Low mature order count
&lt;/h3&gt;

&lt;p&gt;A high contribution per order from nine mature orders is not a reliable basis for scaling. Require a minimum mature order count or extend the observation window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operating checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Freeze the maturity window and minimum coverage ratio before the test.&lt;/li&gt;
&lt;li&gt;Count only complete cohorts.&lt;/li&gt;
&lt;li&gt;Calculate contribution after refunds, fulfilment, fees and creator costs.&lt;/li&gt;
&lt;li&gt;Keep ad spend separate and assign it to the same cohort.&lt;/li&gt;
&lt;li&gt;Cap each step at 10% or the available headroom, whichever is lower.&lt;/li&gt;
&lt;li&gt;Wait for the next complete cohort before another increase.&lt;/li&gt;
&lt;li&gt;Record the date, rule version, inputs, spend cap and decision.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rule is conservative. That is the point. It makes the budget decision reproducible while the newest orders are still changing.&lt;/p&gt;

&lt;p&gt;For the complete planning framework, see the &lt;a href="https://www.fz567.cn/guides/gmvmax-complete-guide?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=gmvmax-budget-maturity&amp;amp;utm_content=guide" rel="noopener noreferrer"&gt;TikTok Shop GMV Max guide&lt;/a&gt;. The free &lt;a href="https://www.fz567.cn/tools/breakeven-roas-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=gmvmax-budget-maturity&amp;amp;utm_content=calculator" rel="noopener noreferrer"&gt;break-even ROAS calculator&lt;/a&gt; can test the contribution threshold before applying this cohort rule.&lt;/p&gt;

&lt;p&gt;The example uses synthetic data. It does not prove incremental lift or guarantee ad performance. Maintained by Starway Global, publisher of the linked GMV Max guide and break-even ROAS calculator.&lt;/p&gt;

</description>
      <category>tiktok</category>
      <category>analytics</category>
      <category>ecommerce</category>
      <category>sql</category>
    </item>
    <item>
      <title>How to audit TikTok Shop coupon lift without counting baseline sales</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Tue, 17 Nov 2026 10:26:08 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/how-to-audit-tiktok-shop-coupon-lift-without-counting-baseline-sales-4ojk</link>
      <guid>https://dev.to/starwayglobalfz/how-to-audit-tiktok-shop-coupon-lift-without-counting-baseline-sales-4ojk</guid>
      <description>&lt;p&gt;TikTok Shop promotion reports often show a clean revenue increase while four different effects are mixed together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;orders that would have happened anyway;&lt;/li&gt;
&lt;li&gt;pull-forward from customers who planned to buy later;&lt;/li&gt;
&lt;li&gt;demand created by the promotion;&lt;/li&gt;
&lt;li&gt;returns, discounts and campaign costs that arrive after the first sales report.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A coupon can produce more orders and still leave contribution profit below the no-promotion baseline. The useful question is &lt;strong&gt;how much contribution changed after adjusting for the demand that was already present&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This audit separates that question from revenue growth. It is a pre/post estimate, not proof of causality. Use it as a decision aid for a tested store and promotion design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with a contribution measure
&lt;/h2&gt;

&lt;p&gt;Define one measure and use it in both windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pre-campaign contribution
= merchandise revenue after seller discounts
- refunds that are mature
- cost of goods sold
- fulfilment
- platform and payment fees
- creator or affiliate costs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep ad spend separate. A fixed promotion fee, production cost or subscription is also separate. This prevents the same cost from being deducted twice.&lt;/p&gt;

&lt;p&gt;Use one currency and one refund policy window. If the promotion changes delivery, product mix or commission terms, split the audit by product or policy cohort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose a comparable baseline
&lt;/h2&gt;

&lt;p&gt;Use equal-length windows with the same number of weekdays and similar seasonality. A seven-day promotion should use a seven-day baseline, not a trailing thirty-day average containing a different sales mix.&lt;/p&gt;

&lt;p&gt;Estimate a trend or control factor &lt;code&gt;k&lt;/code&gt; from a comparable period or store that did not receive the promotion. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;control change = promotion-period control orders / baseline-period control orders
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;k = 1.05&lt;/code&gt; only when the evidence supports a 5% comparison-period change. When no defensible trend estimate exists, report descriptive before/after results and avoid calling them incremental.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run the audit
&lt;/h2&gt;

&lt;p&gt;For one store and currency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expected orders = baseline orders × k
expected contribution = baseline contribution × k

incremental orders = promotion orders - expected orders
incremental contribution = promotion contribution - expected contribution

net incremental contribution
= incremental contribution
- incremental ad spend
- fixed promotion cost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Fixed promotion cost&lt;/code&gt; might be a campaign setup fee, creative production or one-off software cost. Seller-funded discounts and mature refunds already belong inside contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducible example
&lt;/h2&gt;

&lt;p&gt;All numbers below are &lt;strong&gt;synthetic&lt;/strong&gt;. Both windows are seven days, all orders are outside the refund window, and both periods have zero paid ad spend.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Baseline&lt;/th&gt;
&lt;th&gt;Promotion&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Orders&lt;/td&gt;
&lt;td&gt;700&lt;/td&gt;
&lt;td&gt;1,050&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pre-campaign contribution&lt;/td&gt;
&lt;td&gt;$5,600&lt;/td&gt;
&lt;td&gt;$7,800&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Paid ad spend&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fixed promotion cost&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;td&gt;$450&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Assume a tested trend factor of &lt;code&gt;1.05&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expected orders = 700 × 1.05 = 735
incremental orders = 1,050 - 735 = 315

expected contribution = $5,600 × 1.05 = $5,880
incremental contribution = $7,800 - $5,880 = $1,920

net incremental contribution
= $1,920 - ($0 - $0) - $450
= $1,470

net per incremental order = $1,470 / 315 = $4.67
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The promotion added an estimated $1,470 after the fixed campaign cost under this comparison. It did not add $2,200, the raw contribution difference between the two periods.&lt;/p&gt;

&lt;p&gt;The result depends heavily on the baseline estimate:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Trend factor&lt;/th&gt;
&lt;th&gt;Net incremental contribution&lt;/th&gt;
&lt;th&gt;Return on $450 fixed cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.00&lt;/td&gt;
&lt;td&gt;$1,750&lt;/td&gt;
&lt;td&gt;3.89×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.03&lt;/td&gt;
&lt;td&gt;$1,582&lt;/td&gt;
&lt;td&gt;3.52×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.05&lt;/td&gt;
&lt;td&gt;$1,470&lt;/td&gt;
&lt;td&gt;3.27×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.10&lt;/td&gt;
&lt;td&gt;$1,190&lt;/td&gt;
&lt;td&gt;2.64×&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Report the trend factor beside the result. A single “promotion ROI” number hides how much of the conclusion comes from the baseline assumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the calculation reusable
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;auditPromotion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;refundsMature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Wait for the refund window to mature"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;trendFactor&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Use a tested comparison factor"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;expectedOrders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;baselineOrders&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;trendFactor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;expectedContribution&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;baselineContribution&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;trendFactor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;incrementalContribution&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;promoContribution&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;expectedContribution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;incrementalAdSpend&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;promoAdSpend&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;baselineAdSpend&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;incrementalOrders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;promoOrders&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;expectedOrders&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;incrementalContribution&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;netIncrementalContribution&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="n"&gt;incrementalContribution&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;
      &lt;span class="n"&gt;incrementalAdSpend&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;
      &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fixedPromotionCost&lt;/span&gt;
  &lt;span class="p"&gt;}&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;The guard clauses matter. An immature refund window can make the final result look better today and worse next week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the result against failure modes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Pull-forward
&lt;/h3&gt;

&lt;p&gt;Compare the two weeks after the campaign with the same weeks in the baseline. A promotion can borrow demand from the following week. Add that later decline to the audit before scaling the promotion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Product-mix shift
&lt;/h3&gt;

&lt;p&gt;A site-wide coupon can lift orders while steering customers toward products with weaker contribution. Repeat the audit by product class, not only at store level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refund delay
&lt;/h3&gt;

&lt;p&gt;Orders created during the promotion may not have reached the platform’s refund maturity point. Mark the result provisional until refunds and adjustments are complete.&lt;/p&gt;

&lt;h3&gt;
  
  
  Overlapping spend
&lt;/h3&gt;

&lt;p&gt;Affiliate commissions, ads, platform fee changes and live-commerce costs can overlap. Keep each cost in one place. If ad spend changes between periods, subtract the incremental amount rather than the full promotion-period spend.&lt;/p&gt;

&lt;h3&gt;
  
  
  Selection bias
&lt;/h3&gt;

&lt;p&gt;A promotion may be triggered by an already-hot product. A control store or matched product can improve the comparison, but it still does not prove causality by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the result as a threshold
&lt;/h2&gt;

&lt;p&gt;The model does not prove that a coupon “worked” in every market. It gives a reproducible threshold for the next decision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pause when mature net incremental contribution is negative;&lt;/li&gt;
&lt;li&gt;repeat cautiously when it remains positive across nearby trend assumptions;&lt;/li&gt;
&lt;li&gt;fix attribution before scaling when the sign changes under plausible baselines;&lt;/li&gt;
&lt;li&gt;compare the result with the no-promotion week and the post-promotion week.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The usable unit is incremental contribution, not redeemed revenue.&lt;/p&gt;

&lt;p&gt;For a broader operating frame, see the &lt;a href="https://www.fz567.cn/blog/tiktok-shop-promotions?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-shop-coupon-lift-audit&amp;amp;utm_content=promotions-guide" rel="noopener noreferrer"&gt;TikTok Shop promotions guide&lt;/a&gt;. The free &lt;a href="https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-shop-coupon-lift-audit&amp;amp;utm_content=profit-calculator" rel="noopener noreferrer"&gt;TikTok Shop profit calculator&lt;/a&gt; can check the per-order contribution inputs used in the audit.&lt;/p&gt;

&lt;p&gt;The example is illustrative and &lt;strong&gt;not a causal experiment&lt;/strong&gt;. It does not guarantee promotion profit, ROAS or sales. Maintained by Starway Global, publisher of the linked promotions guide and profit calculator.&lt;/p&gt;

</description>
      <category>tiktok</category>
      <category>analytics</category>
      <category>ecommerce</category>
      <category>javascript</category>
    </item>
    <item>
      <title>TikTok Shop bundle discounts need a refund-aware contribution ceiling</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Sat, 14 Nov 2026 05:29:11 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/tiktok-shop-bundle-discounts-need-a-refund-aware-contribution-ceiling-1pdd</link>
      <guid>https://dev.to/starwayglobalfz/tiktok-shop-bundle-discounts-need-a-refund-aware-contribution-ceiling-1pdd</guid>
      <description>&lt;p&gt;Bundle promotions often pass a simple gross-margin test and still reduce contribution profit.&lt;/p&gt;

&lt;p&gt;A "buy two, save 15%" offer may preserve a positive spread between list price and product cost while the platform fee, creator commission, payment fee, shipping subsidy and refund losses consume the rest.&lt;/p&gt;

&lt;p&gt;The safer planning question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the largest discount this bundle can take while still meeting a target contribution margin after expected refunds?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The model below answers that question with a closed-form ceiling, then validates the answer against settled order data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with expected contribution after refunds
&lt;/h2&gt;

&lt;p&gt;Use one placed order as the unit of analysis.&lt;/p&gt;

&lt;p&gt;Define:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P = list merchandise revenue before discount, excluding tax
d = discount as a decimal
N = P × (1 - d), the net merchandise revenue
C = variable product cost
F = variable fulfilment and shipping cost
f = platform fee rate on N
k = payment processing fee rate on N
e = effective creator commission rate on N
r = observed refund rate
L = net loss per refunded order after recoveries
t = target contribution margin rate on collected revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The effective creator commission rate should reflect attachment, not only the headline rate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;e = share of orders attached to a creator × creator commission rate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, 30% attachment at a 12% commission rate gives an effective rate of 3.6%.&lt;/p&gt;

&lt;p&gt;Use a planning assumption for a new promotion. Use the realised commission field when validating existing orders.&lt;/p&gt;

&lt;p&gt;Define &lt;code&gt;L&lt;/code&gt; as the loss that remains after the platform, payment provider, creator or supplier has reversed whatever is recoverable. It may include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;outbound or return shipping that is not recovered&lt;/li&gt;
&lt;li&gt;payment fees that remain charged&lt;/li&gt;
&lt;li&gt;platform fees that are not reversed&lt;/li&gt;
&lt;li&gt;damaged or unsellable inventory&lt;/li&gt;
&lt;li&gt;creator commission that is not clawed back&lt;/li&gt;
&lt;li&gt;handling labour that changes with refund volume&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This keeps the refund term honest. A full refund does not necessarily reverse the whole cost of the order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write the contribution condition
&lt;/h2&gt;

&lt;p&gt;If an order is not refunded, contribution profit is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N - C - F - fN - kN - eN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it is refunded, the model applies &lt;code&gt;L&lt;/code&gt; as the remaining net loss.&lt;/p&gt;

&lt;p&gt;Expected contribution is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1 - r) × (N - C - F - fN - kN - eN)
- r × L
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Collected net revenue after refunds is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1 - r) × N
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a target contribution margin &lt;code&gt;t&lt;/code&gt;, require:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expected contribution
&amp;gt;= t × collected net revenue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That expands to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1 - r) × N × (1 - f - k - e)
- (1 - r) × (C + F)
- r × L
&amp;gt;= t × (1 - r) × N
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Solve for minimum acceptable net merchandise revenue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N_min =
((1 - r) × (C + F) + r × L)
/
((1 - r) × (1 - f - k - e - t))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The maximum discount is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d_max = 1 - (N_min / P)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The denominator must be positive. If it is zero or negative, the fee, commission and target-margin rates already consume the full revenue base.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example
&lt;/h2&gt;

&lt;p&gt;Assume a bundle has:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P = 100
C = 32
F = 8
f = 6%
k = 2%
e = 3.6%
r = 10%
L = 15
t = 15%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Calculate the numerator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1 - 0.10) × (32 + 8) + 0.10 × 15
= 0.90 × 40 + 1.50
= 37.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Calculate the denominator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1 - 0.10)
× (1 - 0.06 - 0.02 - 0.036 - 0.15)
= 0.90 × 0.734
= 0.6606
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Minimum net merchandise revenue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;N_min = 37.50 / 0.6606
= 56.77
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Maximum discount:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;d_max = 1 - (56.77 / 100)
= 43.23%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bundle can carry a discount up to about 43.2% under these assumptions and still meet a 15% contribution-margin target after expected refund losses.&lt;/p&gt;

&lt;p&gt;That result is specific to the inputs. Change the refund loss, attachment rate or fulfilment cost and the ceiling changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare target margins without rerunning the whole model
&lt;/h2&gt;

&lt;p&gt;Using the same example, the discount ceiling moves with the target contribution margin:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Target contribution margin&lt;/th&gt;
&lt;th&gt;Minimum net revenue&lt;/th&gt;
&lt;th&gt;Maximum discount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10%&lt;/td&gt;
&lt;td&gt;53.15&lt;/td&gt;
&lt;td&gt;46.85%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15%&lt;/td&gt;
&lt;td&gt;56.77&lt;/td&gt;
&lt;td&gt;43.23%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;td&gt;60.92&lt;/td&gt;
&lt;td&gt;39.08%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The table makes the trade-off visible to merchandising, finance and growth teams.&lt;/p&gt;

&lt;p&gt;A 40% discount may be acceptable for a low-cost clearance bundle and unacceptable for a fragile, high-return SKU. The difference belongs in the inputs, not in a blanket sitewide discount policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validate the ceiling with settled orders
&lt;/h2&gt;

&lt;p&gt;The planning formula should be checked against realised contribution for the same discount band.&lt;/p&gt;

&lt;p&gt;The query below assumes refunds are mature enough to treat &lt;code&gt;net_refund_loss&lt;/code&gt; as settled:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;settled_bundle_orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;bundle_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;order_time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;list_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;discount_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;net_merch_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;product_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;fulfillment_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;platform_fee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;payment_fee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;creator_commission&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;refunded_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;refund_recovery&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;net_merch_revenue&lt;/span&gt;
      &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;product_cost&lt;/span&gt;
      &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;fulfillment_cost&lt;/span&gt;
      &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;platform_fee&lt;/span&gt;
      &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;payment_fee&lt;/span&gt;
      &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;creator_commission&lt;/span&gt;
      &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;refunded_amount&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;refund_recovery&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;settled_contribution&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_time&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kc"&gt;CURRENT_DATE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'30 days'&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'settled'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;discount_bands&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;bundle_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;CASE&lt;/span&gt;
      &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;discount_amount&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.10&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'0-9%'&lt;/span&gt;
      &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;discount_amount&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.20&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'10-19%'&lt;/span&gt;
      &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;discount_amount&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.30&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'20-29%'&lt;/span&gt;
      &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;discount_amount&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.40&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="s1"&gt;'30-39%'&lt;/span&gt;
      &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="s1"&gt;'40%+'&lt;/span&gt;
    &lt;span class="k"&gt;END&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;discount_band&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;net_merch_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;settled_contribution&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;settled_bundle_orders&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="n"&gt;bundle_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;discount_band&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="cm"&gt;(*) AS orders,
  SUM(net_merch_revenue) AS collected_revenue,
  SUM(settled_contribution) AS contribution_profit,
  ROUND(
    SUM(settled_contribution)
    / NULLIF(SUM(net_merch_revenue), 0),
    4
  ) AS contribution_margin
FROM discount_bands
GROUP BY bundle_id, discount_band
ORDER BY bundle_id, discount_band;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Treat mixed currencies separately. If discounts changed return behaviour, compare orders created under the same policy window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Using the headline creator rate for every order
&lt;/h3&gt;

&lt;p&gt;Only some orders are attached to creators. Use expected attachment for planning and realised commissions for reconciliation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Treating a refund as a full reversal
&lt;/h3&gt;

&lt;p&gt;Shipping, payment fees, damaged inventory and non-reversed commission can remain after the customer is refunded.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ignoring return-cost changes
&lt;/h3&gt;

&lt;p&gt;A deep discount can attract customers with a different return profile. Re-estimate &lt;code&gt;r&lt;/code&gt; and &lt;code&gt;L&lt;/code&gt; by discount band.&lt;/p&gt;

&lt;h3&gt;
  
  
  Calculating fees on the wrong amount
&lt;/h3&gt;

&lt;p&gt;Platform and payment fees may use discounted merchandise, gross order value or a fixed fee component. Match the actual platform statement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mixing currencies or tax treatments
&lt;/h3&gt;

&lt;p&gt;Keep currency, tax and fee boundaries consistent inside one calculation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Calling immature data final
&lt;/h3&gt;

&lt;p&gt;Orders still inside the refund window are pending. They do not belong in a settled discount-ceiling comparison.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operating rules
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Set the bundle discount ceiling from contribution profit, not list-price margin alone.&lt;/li&gt;
&lt;li&gt;Use creator attachment when estimating effective commission.&lt;/li&gt;
&lt;li&gt;Include net loss per refunded order.&lt;/li&gt;
&lt;li&gt;Validate after the refund window closes.&lt;/li&gt;
&lt;li&gt;Report order counts and discount bands beside the margin.&lt;/li&gt;
&lt;li&gt;Separate currency, product mix and policy windows.&lt;/li&gt;
&lt;li&gt;Treat the ceiling as a planning boundary. Holdout or geo tests are still required before claiming incremental profit.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Related resources
&lt;/h2&gt;

&lt;p&gt;Use the free &lt;a href="https://www.fz567.cn/tools/pricing-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-bundle-discount-ceiling&amp;amp;utm_content=pricing-calculator" rel="noopener noreferrer"&gt;TikTok Shop pricing calculator&lt;/a&gt; to test list price, costs and target margin inputs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-bundle-discount-ceiling&amp;amp;utm_content=profit-calculator" rel="noopener noreferrer"&gt;TikTok Shop profit calculator&lt;/a&gt; helps reconcile order-level contribution.&lt;/p&gt;

&lt;p&gt;For a broader view of pricing decisions, read the &lt;a href="https://www.fz567.cn/blog/tiktok-shop-pricing-strategy?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-bundle-discount-ceiling&amp;amp;utm_content=pricing-guide" rel="noopener noreferrer"&gt;TikTok Shop pricing strategy guide&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;I work on &lt;a href="https://www.fz567.cn/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-bundle-discount-ceiling&amp;amp;utm_content=brand-link" rel="noopener noreferrer"&gt;Starway Global&lt;/a&gt;, a TikTok Shop analytics and operations platform. This model is educational and does not guarantee profit, payback or advertising outcomes.&lt;/p&gt;

&lt;p&gt;AI disclosure: Fully Autonomous.&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>sql</category>
      <category>tiktokshop</category>
      <category>analytics</category>
    </item>
    <item>
      <title>CAC payback for TikTok Shop should use customer cohorts, not campaign ROAS</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 20:18:27 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/cac-payback-for-tiktok-shop-should-use-customer-cohorts-not-campaign-roas-43p1</link>
      <guid>https://dev.to/starwayglobalfz/cac-payback-for-tiktok-shop-should-use-customer-cohorts-not-campaign-roas-43p1</guid>
      <description>&lt;p&gt;A TikTok Shop campaign can produce a strong ROAS and still take too long to pay back its customer acquisition cost. Campaign ROAS combines new and returning buyers, mixes product margins, and often stops at revenue. A cohort view asks a narrower question: after all costs attached to the buyers acquired in one period, when did the business recover what it spent to acquire them?&lt;/p&gt;

&lt;p&gt;This model uses contribution profit, refund maturity and repeat purchases at the customer level.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with a customer cohort
&lt;/h2&gt;

&lt;p&gt;A useful cohort is the group of customers whose first paid TikTok Shop order occurred during one closed period, usually a week or month.&lt;/p&gt;

&lt;p&gt;Do not assign an existing customer to a new acquisition cohort because of a repeat order. Do not count a canceled first order as an acquired customer. Keep acquisition source available so paid, organic, creator and referral cohorts can be compared.&lt;/p&gt;

&lt;p&gt;For each customer, calculate contribution profit per order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Order contribution profit =
  net merchandise revenue
  - product cost
  - fulfillment and shipping cost
  - platform and payment fees
  - creator commission
  - refund reversals
  - allocated variable operations cost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exclude fixed salaries, software subscriptions and other costs that do not change with the order. Keep those costs in a later profitability view.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define CAC for the same cohort
&lt;/h2&gt;

&lt;p&gt;Customer acquisition cost is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CAC =
  acquisition spend attributed to the cohort
  / number of customers acquired
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use spend with the same currency, tax treatment and time boundary as the cohort. If campaign spend includes returning-customer orders, allocate it only when the attribution rule is documented. Otherwise report a blended acquisition metric and say so.&lt;/p&gt;

&lt;p&gt;Organic customers can be useful for comparison, but their CAC is not zero. Their acquisition cost may sit in content, creator seeding or team time outside the ad platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure cumulative contribution, not first-order revenue
&lt;/h2&gt;

&lt;p&gt;For each acquisition cohort, accumulate contribution profit over closed observation windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cumulative cohort contribution(t) =
  sum of contribution profit from all orders
  placed by cohort customers through day t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CAC payback occurs on the first day when:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cumulative cohort contribution(t) &amp;gt;= acquisition spend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is a payback band, such as 31–60 days, rather than a false single-day precision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example
&lt;/h2&gt;

&lt;p&gt;Assume one campaign acquired 300 first-time customers and spent 6,000 currency units.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CAC = 6,000 / 300 = 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Contribution profit from the first order averaged 14 per customer. Thirty days later, 25% of the cohort had placed a second order, adding 18 contribution profit per repeat order.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 30 contribution per acquired customer
= 14 + (0.25 × 18)
= 18.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cohort had recovered 92.5% of CAC by day 30.&lt;/p&gt;

&lt;p&gt;By day 60, 40% had repeated:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 60 contribution per acquired customer
= 14 + (0.40 × 18)
= 21.20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cohort crossed CAC at some point between day 31 and day 60. The useful operating statement is “31–60 day payback on this cohort,” provided refunds through the chosen maturity window were included.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set a CAC ceiling before comparing campaigns
&lt;/h2&gt;

&lt;p&gt;CAC payback tells you when spend comes back. A CAC ceiling tells you how much you can afford to spend before the cohort matures.&lt;/p&gt;

&lt;p&gt;Choose a payback window that matches your cash position, then estimate mature contribution per acquired customer inside that window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mature contribution per customer
= first-order contribution
+ repeat-order contribution
- late refund correction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set a risk-adjusted ceiling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CAC ceiling
= mature contribution per customer
× (1 - uncertainty buffer)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The uncertainty buffer is not a universal percentage. Base it on observed refund lag, cohort size, identity matching quality and product-mix drift.&lt;/p&gt;

&lt;p&gt;Using the worked example, day-60 contribution per customer is 21.20. A 15% uncertainty buffer gives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CAC ceiling = 21.20 × (1 - 0.15) = 18.02
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual CAC is 20. Although the matured cohort is projected to recover that spend, it sits above the risk-adjusted ceiling. The appropriate action is to hold budget while improving repeat contribution or reducing acquisition cost. Do not scale only because payback eventually crosses zero.&lt;/p&gt;

&lt;p&gt;A simple decision table can make the rule explicit:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Actual CAC / risk-adjusted ceiling&lt;/th&gt;
&lt;th&gt;Operating response&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;≤ 80%&lt;/td&gt;
&lt;td&gt;Consider a controlled scale test if capacity and refund data are stable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80%-100%&lt;/td&gt;
&lt;td&gt;Hold budget and diagnose repeat, refund or channel mix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt; 100%&lt;/td&gt;
&lt;td&gt;Reduce or pause unless a holdout test supports a different causal read&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep the buffer and payback window fixed across cohorts you compare. Change them only when finance and operations agree that the underlying conditions changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid mixing mature and immature cohorts
&lt;/h2&gt;

&lt;p&gt;A cohort measured for seven days cannot be compared with one measured for 90 days. Refunds, cancellations and repeat orders continue to arrive at different times.&lt;/p&gt;

&lt;p&gt;Use cohort age, not calendar-quarter age:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Day 7: first-order quality and early refund signal&lt;/li&gt;
&lt;li&gt;Day 30: initial repeat-purchase signal&lt;/li&gt;
&lt;li&gt;Day 60 or 90: more stable payback view&lt;/li&gt;
&lt;li&gt;Post-maturity: late refunds still require reconciliation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not call an immature cohort a failure. Mark it pending until its observation window closes.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL starting point
&lt;/h2&gt;

&lt;p&gt;The query below assumes one row per order with contribution profit after refunds known to the maturity cutoff.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;first_orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;MIN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;first_order_time&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;paid_units&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;paid_units&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;canceled_units&lt;/span&gt;
  &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;cohorts&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;DATE_TRUNC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'week'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;first_order_time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;date&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cohort_week&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;first_orders&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;customer_contribution&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cohort_week&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;DATE_PART&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s1"&gt;'day'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_time&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cohort_week&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="kt"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'7 days'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cohort_day&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contribution_profit&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
  &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;cohorts&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_time&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kc"&gt;CURRENT_DATE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'21 days'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;cohort_totals&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;cohort_week&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;acquired_customers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contribution_profit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cumulative_contribution&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;customer_contribution&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;cohort_day&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
  &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;cohort_week&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;spend&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="nb"&gt;DATE_TRUNC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'week'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;first_seen_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;date&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cohort_week&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;acquisition_spend&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;acquisition_spend&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cohort_spend&lt;/span&gt;
  &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cohort_week&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;acquired_customers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;acquisition_spend&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;acquisition_spend&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;acquired_customers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cac&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cumulative_contribution&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;contribution_day_60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cumulative_contribution&lt;/span&gt;
    &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;acquisition_spend&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;cac_recovery_ratio&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cohort_totals&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;
&lt;span class="k"&gt;LEFT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;spend&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cohort_week&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cohort_week&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 21-day order maturity cutoff and 60-day observation window are examples. Set both to values the finance and operations teams can defend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes to check
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Revenue is not contribution profit
&lt;/h3&gt;

&lt;p&gt;Product margin, shipping subsidies, affiliate commission, payment fees and refunds can change which cohort looks healthy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refunds arrive after the cutoff
&lt;/h3&gt;

&lt;p&gt;Record late refunds as a correction to the original cohort. Do not move the refund to today's acquisition performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repeat purchases are too sparse
&lt;/h3&gt;

&lt;p&gt;Small sample sizes create unstable percentages. Report customer counts with repeat rates rather than a precise payback day.&lt;/p&gt;

&lt;h3&gt;
  
  
  Campaign attribution overlaps organic demand
&lt;/h3&gt;

&lt;p&gt;Brand searches and creator content can influence paid conversions. Compare treated cohorts with a holdout or geo test before making a causal claim.&lt;/p&gt;

&lt;h3&gt;
  
  
  Product mix changes inside the cohort
&lt;/h3&gt;

&lt;p&gt;A cohort dominated by one discounted product is not comparable with a cohort built around another bundle. Keep a mix summary next to the payback metric.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer identity changes across devices
&lt;/h3&gt;

&lt;p&gt;Guest checkout, multiple accounts and marketplace identifiers can split one buyer into several customers. Report identity-resolution assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operating rules
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Close the cohort window before reporting payback.&lt;/li&gt;
&lt;li&gt;Include canceled units and matured refunds.&lt;/li&gt;
&lt;li&gt;Keep acquisition spend and contribution profit in the same observation window.&lt;/li&gt;
&lt;li&gt;Report acquired-customer counts beside every payback rate.&lt;/li&gt;
&lt;li&gt;Show repeat contribution separately from first-order contribution.&lt;/li&gt;
&lt;li&gt;Reconcile late refunds by appending corrections to the original cohort.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Related resources
&lt;/h2&gt;

&lt;p&gt;Use the free &lt;a href="https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-acquisition-payback&amp;amp;utm_content=profit-calculator" rel="noopener noreferrer"&gt;TikTok Shop profit calculator&lt;/a&gt; to test order-level contribution inputs.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.fz567.cn/blog/tiktok-payout-cashflow?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-acquisition-payback&amp;amp;utm_content=cashflow-guide" rel="noopener noreferrer"&gt;TikTok Shop payout and cash-flow guide&lt;/a&gt; explains why contribution profit and available cash can arrive on different schedules.&lt;/p&gt;

&lt;p&gt;New sellers can use the &lt;a href="https://www.fz567.cn/blog/tiktok-new-seller-period?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-acquisition-payback&amp;amp;utm_content=new-seller-guide" rel="noopener noreferrer"&gt;TikTok Shop new-seller guide&lt;/a&gt; for an operating checklist before scaling acquisition.&lt;/p&gt;




&lt;p&gt;I work on &lt;a href="https://www.fz567.cn/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tiktok-acquisition-payback&amp;amp;utm_content=brand-link" rel="noopener noreferrer"&gt;Starway Global&lt;/a&gt;, a TikTok Shop analytics and operations platform. This model is educational and does not guarantee payback, profit or advertising outcomes.&lt;/p&gt;

&lt;p&gt;AI disclosure: Fully Autonomous.&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>tiktokshop</category>
      <category>analytics</category>
      <category>sql</category>
    </item>
    <item>
      <title>A refund-aware reorder point model for TikTok Shop SKU planning</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 15:15:10 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/a-refund-aware-reorder-point-model-for-tiktok-shop-sku-planning-57f2</link>
      <guid>https://dev.to/starwayglobalfz/a-refund-aware-reorder-point-model-for-tiktok-shop-sku-planning-57f2</guid>
      <description>&lt;p&gt;TikTok Shop inventory planning gets difficult when demand, cancellations, refunds, creator videos and supplier lead times move at different speeds. A reorder point copied from a generic spreadsheet can look precise while using the wrong demand window.&lt;/p&gt;

&lt;p&gt;This model turns paid orders into mature net demand, adds supplier variability, and keeps creator campaigns separate from the baseline. It is designed for day-level planning where decisions need to be reproducible.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a reorder point needs to answer
&lt;/h2&gt;

&lt;p&gt;The reorder point is the inventory level that should trigger a purchase order before the next delivery can arrive.&lt;/p&gt;

&lt;p&gt;Use this working definition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reorder point =
  expected net demand during lead time and review period
  + safety stock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not use gross GMV or order count as the demand input. Use units that still represent real demand after cancellations and refunds have had time to mature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define mature net demand
&lt;/h2&gt;

&lt;p&gt;A TikTok Shop order can change state after it is created. Cancellations and refunds reduce the units that should drive replenishment. Late refunds can make last week look stronger than it was.&lt;/p&gt;

&lt;p&gt;For a cohort of orders, calculate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mature net units =
  paid units
  - canceled units
  - refunded units
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a maturity window that matches the SKU's behavior. A practical starting point is 21 days for ordinary delivery and refund timing, then compare that policy with a 30-day window for slower markets.&lt;/p&gt;

&lt;p&gt;The maturity window is a planning assumption. It is not a claim that no refund can happen after day 21.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid counting returns twice
&lt;/h3&gt;

&lt;p&gt;Refunded units can become sellable inventory after inspection. Do not subtract the refund from demand and then add the same physical return back to stock again.&lt;/p&gt;

&lt;p&gt;Choose one of these treatments and document it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use net demand after refunds, then add only confirmed or scheduled sellable returns that are not already in on-hand inventory.&lt;/li&gt;
&lt;li&gt;Use gross shipped demand, then model all returns as future supply. This requires reliable return timing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first approach is usually easier for weekly planning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculate available-to-promise inventory
&lt;/h2&gt;

&lt;p&gt;The reorder trigger should use inventory the team can actually allocate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Available to promise =
  sellable on hand
  + confirmed inbound units
  - reserved or unfulfilled units
  + scheduled sellable returns not already in on hand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leave supplier promises out until they have a confirmed ship date. A purchase order without a confirmed date is a plan, not inbound inventory.&lt;/p&gt;

&lt;p&gt;Reorder when:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;available to promise &amp;lt;= reorder point
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add supplier variability
&lt;/h2&gt;

&lt;p&gt;The protection period is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Protection period = supplier lead time + review period
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the team reviews stock every seven days and the supplier takes ten days, the protection period is seventeen days.&lt;/p&gt;

&lt;p&gt;One reproducible safety-stock formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Safety stock =
  z
  × sqrt(
      protection period × daily demand variance
      + average daily demand squared × lead-time variance
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a 95% service-level target, use &lt;code&gt;z = 1.65&lt;/code&gt;. Treat that result as an operating buffer, not a guarantee against stockouts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example
&lt;/h2&gt;

&lt;p&gt;Assume a SKU has these inputs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mature net demand: 40 units per day&lt;/li&gt;
&lt;li&gt;Daily demand standard deviation: 10 units&lt;/li&gt;
&lt;li&gt;Supplier lead time: 10 days&lt;/li&gt;
&lt;li&gt;Review period: 7 days&lt;/li&gt;
&lt;li&gt;Supplier lead time is treated as stable for this first calculation&lt;/li&gt;
&lt;li&gt;Service-level factor: 1.65&lt;/li&gt;
&lt;li&gt;Sellable on hand: 500 units&lt;/li&gt;
&lt;li&gt;Confirmed inbound: 150 units&lt;/li&gt;
&lt;li&gt;Reserved orders: 50 units&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Protection-period demand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;40 × (10 + 7) = 680 units
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Safety stock:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.65 × sqrt(17 × 10²) ≈ 68 units
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reorder point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;680 + 68 = 748 units
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Available to promise:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;500 + 150 - 50 = 600 units
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SKU is below its reorder point. The replenishment gap before MOQ and campaign adjustments is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;748 - 600 = 148 units
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The buyer should then add expected demand during the next review cycle, apply supplier MOQ, and check whether cash and storage can support the order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep creator spikes separate
&lt;/h2&gt;

&lt;p&gt;A creator video can produce three strong days without changing next quarter's baseline. Fold that event permanently into daily demand and the model over-orders for months.&lt;/p&gt;

&lt;p&gt;Use two demand layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Baseline: matured, non-campaign net demand&lt;/li&gt;
&lt;li&gt;Event demand: expected units from a specific creator, livestream or paid campaign&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Calculate the campaign stock requirement as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Incremental campaign units =
  expected campaign units
  - already committed campaign inventory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add that requirement only for the event window. If the campaign becomes a repeatable sales channel, recalculate the baseline after several completed events.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL starting point
&lt;/h2&gt;

&lt;p&gt;This query assumes one row per SKU and day after orders have been reduced to paid, canceled and refunded units.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;daily&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;order_date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;paid_units&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;canceled_units&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;refunded_units&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;net_units&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sku_daily_order_events&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="kc"&gt;CURRENT_DATE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'90 days'&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;order_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kc"&gt;CURRENT_DATE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="kt"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'21 days'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;numeric&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;lead_time_days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;numeric&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;review_period_days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mf"&gt;1.65&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;numeric&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;z_score&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;velocity&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net_units&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;avg_daily_units&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="no"&gt;STDDEV_SAMP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net_units&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;daily_sd&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;daily&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;
  &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;avg_daily_units&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;daily_sd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lead_time_days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;review_period_days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;avg_daily_units&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lead_time_days&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;review_period_days&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;protection_demand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;z_score&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;SQRT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lead_time_days&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;review_period_days&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;POWER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;daily_sd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;safety_stock&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;velocity&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;
  &lt;span class="k"&gt;CROSS&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;protection_demand&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;safety_stock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;reorder_point&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;protection_demand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;protection_demand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;safety_stock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;safety_stock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;on_hand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;confirmed_inbound&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reserved_units&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;on_hand&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;confirmed_inbound&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reserved_units&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;available_to_promise&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;latest_inventory_snapshots&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;reorder_point&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The query excludes immature cohorts. A later reconciliation can add refunds that arrive after the 21-day cutoff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure modes to test before trusting the model
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cancellations recorded after shipment
&lt;/h3&gt;

&lt;p&gt;Inventory may have left the warehouse even when the order is canceled. Reconcile the status event with physical stock movement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refunds without returns
&lt;/h3&gt;

&lt;p&gt;A refund does not always mean a unit returns to sellable stock. Separate financial refunds from physical return receipts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bundle and component demand
&lt;/h3&gt;

&lt;p&gt;One bundle order can consume several component SKUs. Convert bundle demand into component demand before calculating component reorder points.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-warehouse inventory
&lt;/h3&gt;

&lt;p&gt;An item may be available nationally but not in the market that needs it. Calculate reorder points by the inventory pool that can serve the SKU's real orders.&lt;/p&gt;

&lt;h3&gt;
  
  
  Supplier MOQ
&lt;/h3&gt;

&lt;p&gt;The model produces a gap, not a purchase order. Supplier MOQ, cash flow, storage, shelf life and freight timing can change the final quantity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Campaign overlap
&lt;/h3&gt;

&lt;p&gt;Two creators releasing videos in the same week should be modeled together when their audiences overlap. Separate event plans can double count the same demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  A weekly operating checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Freeze the demand window and maturity cutoff.&lt;/li&gt;
&lt;li&gt;Remove canceled and matured refunded units from demand.&lt;/li&gt;
&lt;li&gt;Combine physical on-hand, confirmed inbound and reserved inventory.&lt;/li&gt;
&lt;li&gt;Recalculate reorder points by SKU and service-level tier.&lt;/li&gt;
&lt;li&gt;Add confirmed campaign demand separately.&lt;/li&gt;
&lt;li&gt;Apply MOQ, cash and storage constraints.&lt;/li&gt;
&lt;li&gt;Record the assumptions used for every purchase decision.&lt;/li&gt;
&lt;li&gt;Reconcile late refunds and late returns against the previous forecast.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The useful output is a decision that another operator can reproduce next week with the same inputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related resources
&lt;/h2&gt;

&lt;p&gt;For product selection inputs, see the &lt;a href="https://www.fz567.cn/blog/tiktok-product-research-data-driven?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=refund-aware-reorder-point&amp;amp;utm_content=product-research-guide" rel="noopener noreferrer"&gt;TikTok Shop product research guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the gross-margin and net-margin inputs that affect service-level decisions, use the free &lt;a href="https://www.fz567.cn/tools/profit-margin-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=refund-aware-reorder-point&amp;amp;utm_content=margin-calculator" rel="noopener noreferrer"&gt;ecommerce profit margin calculator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For fulfillment choices that change lead-time variance, read the &lt;a href="https://www.fz567.cn/blog/tiktok-shop-logistics-guide?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=refund-aware-reorder-point&amp;amp;utm_content=logistics-guide" rel="noopener noreferrer"&gt;TikTok Shop logistics guide&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;I work on &lt;a href="https://www.fz567.cn/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=refund-aware-reorder-point&amp;amp;utm_content=brand-link" rel="noopener noreferrer"&gt;Starway Global&lt;/a&gt;, a TikTok Shop analytics and operations platform. This article is educational and does not guarantee inventory, revenue or ranking outcomes.&lt;/p&gt;

&lt;p&gt;AI disclosure: Fully Autonomous.&lt;/p&gt;

</description>
      <category>tiktokshop</category>
      <category>sql</category>
      <category>ecommerce</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Creator commission is a cash event, not a percentage</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 10:58:43 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/creator-commission-is-a-cash-event-not-a-percentage-37gf</link>
      <guid>https://dev.to/starwayglobalfz/creator-commission-is-a-cash-event-not-a-percentage-37gf</guid>
      <description>&lt;p&gt;A creator commission rate is easy to read and hard to reconcile.&lt;/p&gt;

&lt;p&gt;The dashboard may show 15%. The settlement file may show a different amount because of sample campaigns, bonuses, refunds, cancellations, or timing. A low-margin SKU can look acceptable in a campaign summary and still contribute less cash than expected after the commission is finally settled.&lt;/p&gt;

&lt;p&gt;For TikTok Shop operators, the useful question is not only “What percentage did we offer?” It is “What commission cost remained attached to this order cohort after refunds and settlement?”&lt;/p&gt;

&lt;p&gt;That requires a cash-event model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate four commission numbers
&lt;/h2&gt;

&lt;p&gt;These numbers answer different questions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Decision it supports&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Nominal rate&lt;/td&gt;
&lt;td&gt;The agreed campaign percentage&lt;/td&gt;
&lt;td&gt;What was promised&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Earned commission&lt;/td&gt;
&lt;td&gt;Commission accrued from eligible sales&lt;/td&gt;
&lt;td&gt;What the campaign expected to pay&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reversed commission&lt;/td&gt;
&lt;td&gt;Commission removed after refunds or cancellations&lt;/td&gt;
&lt;td&gt;What the creator should no longer receive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retained commission&lt;/td&gt;
&lt;td&gt;Earned minus reversed and adjusted&lt;/td&gt;
&lt;td&gt;What the SKU actually carries&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not use the nominal rate as a cost in the profit model. Use the retained commission for the reporting timestamp.&lt;/p&gt;

&lt;h2&gt;
  
  
  Effective commission rate
&lt;/h2&gt;

&lt;p&gt;A practical formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;effective commission rate
  = retained commission
  / net settled sales
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Net settled sales should use the same order cohort and reporting window as the commission amount. Dividing a full month of commission by a partial week of sales produces a misleading rate.&lt;/p&gt;

&lt;p&gt;A second view is useful for decisions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;commission-adjusted contribution margin
  = net sales
  - product cost
  - fulfilment
  - platform and payment fees
  - retained creator commission
  - allocated ad spend
  - return cost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first formula shows how commission is behaving. The second shows whether the creator campaign still belongs in the growth plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep commission events append-only
&lt;/h2&gt;

&lt;p&gt;A flat order table encourages teams to replace the commission value when a later settlement arrives. That destroys the audit trail.&lt;/p&gt;

&lt;p&gt;Use events instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-11-01  commission_accrued        +120
2026-11-03  commission_adjustment       +8
2026-11-10  refund_approved            -40
2026-11-10  commission_reversed        -40
2026-11-15  settlement_finalized        0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact event names depend on the source system. The important rule is that later facts are appended. A daily report should state its “as of” time.&lt;/p&gt;

&lt;h2&gt;
  
  
  A SQL shape for reconciliation
&lt;/h2&gt;

&lt;p&gt;The query below is a pattern, not a promise about any platform’s schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;commission_events&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;select&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;event_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;commission_delta&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;commission_delta&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;creator_commission_events&lt;/span&gt;
  &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;event_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;as_of&lt;/span&gt;
  &lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_at&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;settled_orders&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;select&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;net_sales&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;refund_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;return_cost&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;settled_order_cohorts&lt;/span&gt;
  &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;order_created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;cohort_start&lt;/span&gt;
    &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;order_created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;cohort_end&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;select&lt;/span&gt;
  &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net_sales&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;net_sales&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;refund_amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commission_delta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;retained_commission&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;settled_orders&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;
&lt;span class="k"&gt;left&lt;/span&gt; &lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;commission_events&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;
  &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;
 &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;
&lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add platform-specific filters only after verifying their meaning. Do not assume every refund reverses commission immediately, or that every bonus appears in the same export as the base rate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do not forget the creator concentration risk
&lt;/h2&gt;

&lt;p&gt;Gross margin is only one side of the decision. A SKU may have acceptable contribution profit while most of its sales depend on one creator.&lt;/p&gt;

&lt;p&gt;Track three simple measures:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Creator revenue share:&lt;/strong&gt; the largest creator’s share of net sales for the SKU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creator margin spread:&lt;/strong&gt; the difference between the best and worst retained commission outcomes among material creators.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeat contribution:&lt;/strong&gt; the share of contribution profit that returns through repeat orders or owned demand.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;High concentration is not automatically bad. It becomes a risk when a material share of contribution profit disappears if one creator stops promoting.&lt;/p&gt;

&lt;h2&gt;
  
  
  A worked example
&lt;/h2&gt;

&lt;p&gt;Suppose one SKU cohort has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gross merchandise sales: 10,000&lt;/li&gt;
&lt;li&gt;Refunds: 1,000&lt;/li&gt;
&lt;li&gt;Net settled sales: 9,000&lt;/li&gt;
&lt;li&gt;Product cost on fulfilled units: 2,900&lt;/li&gt;
&lt;li&gt;Fulfilment: 800&lt;/li&gt;
&lt;li&gt;Platform and payment fees: 500&lt;/li&gt;
&lt;li&gt;Commission earned: 1,500&lt;/li&gt;
&lt;li&gt;Commission reversed by the reporting date: 100&lt;/li&gt;
&lt;li&gt;Allocated ads: 1,000&lt;/li&gt;
&lt;li&gt;Return processing: 200&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Retained commission is 1,400. The effective commission rate is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1,400 / 9,000 = 15.56%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commission-adjusted contribution before ads is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;9,000 - 2,900 - 800 - 500 - 1,400 - 200 = 3,200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After allocated ads, contribution profit is 2,200.&lt;/p&gt;

&lt;p&gt;That result still depends on the refund reserve being complete. If another 500 of sales are likely to be refunded and only half of the related commission will be recovered, the decision changes in both directions: net sales fall while retained commission remains higher than the fully reversed case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scenario the refund reversal
&lt;/h2&gt;

&lt;p&gt;A useful team policy is to model three states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full reversal:&lt;/strong&gt; commission falls by the same proportion as refunded sales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partial reversal:&lt;/strong&gt; only part of the commission is recovered.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delayed reversal:&lt;/strong&gt; the cash arrives after the reporting period.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the contribution model for each state before raising a creator commission or scaling the campaign. This keeps the operating decision inside the margin boundary.&lt;/p&gt;

&lt;p&gt;The purpose is not to create a complicated accounting system. It is to prevent a creator campaign from looking profitable because two different periods were mixed together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reconciliation checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use one order cohort and one as-of timestamp.&lt;/li&gt;
&lt;li&gt;Join commission events by order and SKU, not only by creator.&lt;/li&gt;
&lt;li&gt;Separate nominal rate from retained commission.&lt;/li&gt;
&lt;li&gt;Measure refund reversal lag.&lt;/li&gt;
&lt;li&gt;Reconcile commission totals back to the settlement file.&lt;/li&gt;
&lt;li&gt;Show unallocated commission instead of hiding it in an “other” bucket.&lt;/li&gt;
&lt;li&gt;Recompute margin after commission adjustments are final.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a team cannot explain why its campaign dashboard and settlement file differ, the next step is reconciliation, not another bid change.&lt;/p&gt;

&lt;p&gt;For a quick manual margin check, the free no-login profit calculator follows the same variable-cost categories:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=creator-commission-reconciliation&amp;amp;utm_content=article-tool-link" rel="noopener noreferrer"&gt;https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=creator-commission-reconciliation&amp;amp;utm_content=article-tool-link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The broader creator commission guide is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fz567.cn/blog/tiktok-creator-commission-negotiation?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=creator-commission-reconciliation&amp;amp;utm_content=article-guide-link" rel="noopener noreferrer"&gt;https://www.fz567.cn/blog/tiktok-creator-commission-negotiation?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=creator-commission-reconciliation&amp;amp;utm_content=article-guide-link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use the current settlement and campaign data for the exact treatment in your market. Creator programs can change their rules, and an old percentage is not a substitute for a reconciled cash amount.&lt;/p&gt;

&lt;p&gt;Disclosure: this article is published by Starway Global and links to our free seller tools and guide. No paid placement is included.&lt;/p&gt;

</description>
      <category>tiktokshop</category>
      <category>ecommerce</category>
      <category>analytics</category>
      <category>sql</category>
    </item>
    <item>
      <title>SKU-level contribution margin: a reconciliation model for TikTok Shop ad scaling</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 09:01:03 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/sku-level-contribution-margin-a-reconciliation-model-for-tiktok-shop-ad-scaling-3ioc</link>
      <guid>https://dev.to/starwayglobalfz/sku-level-contribution-margin-a-reconciliation-model-for-tiktok-shop-ad-scaling-3ioc</guid>
      <description>&lt;p&gt;Most ad-scaling mistakes are not bidding mistakes. They happen because three different datasets are treated as if they describe the same unit of profit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an order that has been placed;&lt;/li&gt;
&lt;li&gt;a settlement that has not finished;&lt;/li&gt;
&lt;li&gt;a refund that may arrive after the reporting period has closed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a single product, those events can produce very different conclusions. A campaign can look profitable in yesterday's order report, look weaker in today's settlement report, and fall below break-even once late refunds and creator commissions are reconciled.&lt;/p&gt;

&lt;p&gt;The fix is not a more complicated dashboard. It is a stable SKU-level contribution-margin model with an explicit as-of timestamp.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define the three numbers first
&lt;/h2&gt;

&lt;p&gt;Before writing SQL or adding another chart, separate these concepts:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;What it measures&lt;/th&gt;
&lt;th&gt;Typical mistake&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GMV or net merchandise sales&lt;/td&gt;
&lt;td&gt;Demand and order value&lt;/td&gt;
&lt;td&gt;Treating sales as cash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Settled proceeds&lt;/td&gt;
&lt;td&gt;Cash available or scheduled&lt;/td&gt;
&lt;td&gt;Treating unsettled proceeds as usable cash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contribution profit&lt;/td&gt;
&lt;td&gt;What remains after variable operating costs&lt;/td&gt;
&lt;td&gt;Applying a fixed margin percentage&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For a seller, a useful contribution-profit definition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Contribution profit
  = net merchandise sales
  - product cost
  - outbound fulfilment
  - platform and payment fees
  - affiliate or creator commission
  - ads allocated to the SKU
  - expected refunds and return costs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is deliberately a decision metric, not an accounting profit metric. Its purpose is to answer a narrower question: should this SKU receive another unit of ad budget?&lt;/p&gt;

&lt;h2&gt;
  
  
  Use an event timeline, not one flat order row
&lt;/h2&gt;

&lt;p&gt;The first structural improvement is to keep order, settlement, refund, and cost events separate. A flattened table encourages teams to overwrite a value “when the number becomes more accurate.” That destroys the audit trail and makes late adjustments impossible to explain.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;Financial effect&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-01 10:00&lt;/td&gt;
&lt;td&gt;Order created&lt;/td&gt;
&lt;td&gt;Recognize a sale candidate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-02 18:00&lt;/td&gt;
&lt;td&gt;Payment settled&lt;/td&gt;
&lt;td&gt;Recognize proceeds and fees&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-08 09:00&lt;/td&gt;
&lt;td&gt;Creator commission finalized&lt;/td&gt;
&lt;td&gt;Adjust acquisition cost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-17 14:00&lt;/td&gt;
&lt;td&gt;Refund approved&lt;/td&gt;
&lt;td&gt;Reverse sale and recoverable fees&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-20 11:00&lt;/td&gt;
&lt;td&gt;Refund paid&lt;/td&gt;
&lt;td&gt;Reduce available cash&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A daily report should be a snapshot “as of” a timestamp. It should not silently replace prior facts. When the same day is recalculated later, the system can append a revision and preserve the reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical pseudocode model
&lt;/h2&gt;

&lt;p&gt;The exact schema depends on the source system, but the calculation boundary can stay consistent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;select&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;net_merchandise_sales&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;order_events&lt;/span&gt;
  &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;period_start&lt;/span&gt;
    &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;period_end&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;settlements&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;select&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;settled_amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;settled_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;platform_fee&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;platform_fee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;affiliate_commission&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;affiliate_commission&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;settlement_events&lt;/span&gt;
  &lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;select&lt;/span&gt;
    &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;refund_amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;refund_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;return_cost&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;return_cost&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;refund_events&lt;/span&gt;
  &lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;ads&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;select&lt;/span&gt;
    &lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;allocated_spend&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;allocated_spend&lt;/span&gt;
  &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ad_allocations&lt;/span&gt;
  &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;event_date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;period_start&lt;/span&gt;
    &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;event_date&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;period_end&lt;/span&gt;
  &lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;sku_id&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;select&lt;/span&gt;
  &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;net_merchandise_sales&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;net_sales&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;refund_amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;platform_fee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;platform_fees&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;affiliate_commission&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;affiliate_commission&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;return_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;return_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;allocated_spend&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ad_spend&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;
&lt;span class="k"&gt;left&lt;/span&gt; &lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;settlements&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;left&lt;/span&gt; &lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;refunds&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;left&lt;/span&gt; &lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;ads&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final margin calculation should be implemented as one reviewed function, not copied into several dashboards:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pre_ad_margin = net_sales - product_cost - fulfilment - fees - affiliate - refunds
contribution_margin_pct = pre_ad_margin / net_sales
break_even_roas = 1 / contribution_margin_pct
contribution_profit = pre_ad_margin - ad_spend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Guard against division by zero and clearly label negative or not-yet-settled rows. A useful report shows both the raw value and the coverage state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle ad allocation explicitly
&lt;/h2&gt;

&lt;p&gt;Platform-level ad reports rarely map perfectly to SKU-level profit. A campaign may contain several products, and a product may receive traffic from several campaigns.&lt;/p&gt;

&lt;p&gt;Choose one policy and document it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Direct allocation&lt;/strong&gt; when the campaign contains one SKU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revenue-weighted allocation&lt;/strong&gt; for mixed campaigns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contribution-weighted allocation&lt;/strong&gt; when products have very different margins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unallocated bucket&lt;/strong&gt; when evidence is insufficient.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not hide an unallocated amount in a catch-all SKU. It should be visible, reviewed, and assigned by an accountable operator.&lt;/p&gt;

&lt;p&gt;The same principle applies to free samples, creator commissions, and content production. If these costs influence the ad decision, give them a home in the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reconcile four totals before trusting the chart
&lt;/h2&gt;

&lt;p&gt;A SKU table is only useful if it can be reconciled back to source systems. A compact daily or weekly check can catch most silent failures:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Expected relationship&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Orders report to event table&lt;/td&gt;
&lt;td&gt;Row count and sales total within documented tolerance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Settlements to order IDs&lt;/td&gt;
&lt;td&gt;Every settled amount maps to one order or an explainable adjustment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Refund events to original order&lt;/td&gt;
&lt;td&gt;No orphan refunds; late refunds remain in the correct cohort&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ad spend to platform invoice&lt;/td&gt;
&lt;td&gt;Allocated plus unallocated spend equals the invoice total&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Store the timestamp and source file or API batch with each check. “The dashboard is right” is not evidence; a reproducible reconciliation is.&lt;/p&gt;

&lt;h2&gt;
  
  
  A worked example
&lt;/h2&gt;

&lt;p&gt;Suppose one SKU records net sales of 10,000 in a seven-day cohort.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product cost: 3,200&lt;/li&gt;
&lt;li&gt;Fulfilment: 800&lt;/li&gt;
&lt;li&gt;Platform and payment fees: 600&lt;/li&gt;
&lt;li&gt;Affiliate commission: 900&lt;/li&gt;
&lt;li&gt;Expected refunds and returns: 500&lt;/li&gt;
&lt;li&gt;Ads allocated to the SKU: 3,000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pre-ad margin is 4,000, or 40% of net sales. Break-even ROAS is therefore 2.5. Actual ROAS is 3.33, and contribution profit is 1,000.&lt;/p&gt;

&lt;p&gt;This does not automatically mean the SKU should scale. Check whether the refund reserve is complete, whether the settlement has finished, and whether the next tranche of traffic is likely to preserve the same marginal contribution. The threshold is a guardrail, not a promise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Link contribution margin to a mature GMV Max budget cap
&lt;/h2&gt;

&lt;p&gt;SKU contribution margin answers whether a product is profitable. It does not automatically tell you how much of a new campaign cohort is safe to count. Late refunds, creator adjustments, and settlement corrections can lower contribution after the budget decision has already been made.&lt;/p&gt;

&lt;p&gt;Use a two-stage rule:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calculate contribution only from orders whose settlement window has passed.&lt;/li&gt;
&lt;li&gt;Convert that mature contribution floor into a spending cap before approving the next budget step.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mature contribution floor
= eligible matured orders x contribution per matured order

spending cap
= mature contribution floor / minimum contribution coverage ratio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The coverage ratio is an operating control, not a universal benchmark. If the team requires $1.40 of pre-ad contribution for every $1.00 of ad spend, the cap is the mature contribution floor divided by &lt;code&gt;1.40&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, a fully matured cohort has &lt;code&gt;$8,400&lt;/code&gt; of pre-ad contribution, the minimum coverage ratio is &lt;code&gt;1.40&lt;/code&gt;, and the campaign currently spends &lt;code&gt;$5,200&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;spending cap = 8,400 / 1.40 = 6,000
headroom = 6,000 - 5,200 = 800
10% step = 5,200 x 0.10 = 520
next spend = 5,200 + min(520, 800) = 5,720
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example is synthetic. It demonstrates arithmetic and decision order, not expected campaign performance.&lt;/p&gt;

&lt;p&gt;Keep younger cohorts outside the current cap calculation. They still matter, but their contribution is not yet stable enough to justify another increase. Recalculate only after a new cohort reaches the frozen maturity window. This prevents a temporary revenue spike from becoming permanent spend.&lt;/p&gt;

&lt;p&gt;The full cohort-treatment workflow is in &lt;a href="https://dev.to/starwayglobalfz/how-to-increase-gmv-max-budget-without-counting-orders-that-have-not-matured-4i8d"&gt;How to increase GMV Max budget without counting orders that have not matured&lt;/a&gt;. The official &lt;a href="https://www.fz567.cn/guides/gmvmax-complete-guide?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=sku-contribution-margin&amp;amp;utm_content=maturity-update-guide" rel="noopener noreferrer"&gt;TikTok Shop GMV Max guide&lt;/a&gt; covers budget, learning-period, and stop-loss decisions in one place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The operating rule
&lt;/h2&gt;

&lt;p&gt;Use a statement that makes time and cost treatment explicit:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For each SKU, calculate contribution profit for orders created in the selected cohort, using all costs and refunds known as of the report timestamp, and disclose any settlement or refund coverage gap.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That sentence prevents most false precision. It also makes two teams less likely to argue about different numbers that are both technically correct under different definitions.&lt;/p&gt;

&lt;p&gt;For a quick manual check, this free no-login profit calculator follows the same cost categories:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=sku-contribution-margin&amp;amp;utm_content=article-tool-link" rel="noopener noreferrer"&gt;https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=sku-contribution-margin&amp;amp;utm_content=article-tool-link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The broader worked guide is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fz567.cn/blog/tiktok-profit-calculation?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=sku-contribution-margin&amp;amp;utm_content=article-guide-link" rel="noopener noreferrer"&gt;https://www.fz567.cn/blog/tiktok-profit-calculation?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=sku-contribution-margin&amp;amp;utm_content=article-guide-link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal is not to create a perfect accounting system inside an ad dashboard. It is to make the ad-scaling decision reproducible, explainable, and honest about what has not settled yet.&lt;/p&gt;

&lt;p&gt;Disclosure: this article is published by Starway Global and links to our free seller tools and guide. No paid placement is included.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>ecommerce</category>
      <category>tiktokshop</category>
      <category>analytics</category>
    </item>
    <item>
      <title>A payout-aware cash conversion model for TikTok Shop sellers</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 07:48:54 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/a-payout-aware-cash-conversion-model-for-tiktok-shop-sellers-52hj</link>
      <guid>https://dev.to/starwayglobalfz/a-payout-aware-cash-conversion-model-for-tiktok-shop-sellers-52hj</guid>
      <description>&lt;p&gt;A TikTok Shop profit report and a TikTok Shop bank balance answer different questions. A profit report tries to match revenue with costs. A cash model asks a narrower question: when will money actually be available to pay for inventory, creators, fulfillment, and ads?&lt;/p&gt;

&lt;p&gt;Sellers run into trouble when those two views are treated as the same thing. An order can look profitable on the day it is placed while the settlement is still pending, a refund may arrive after the commission was recorded, and an ad bill can be due before the payout clears.&lt;/p&gt;

&lt;p&gt;This article describes a payout-aware cash conversion model that can be built from order cohorts and a small number of operating assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the order cohort, not the payout date
&lt;/h2&gt;

&lt;p&gt;Use the order date as the anchor. For each cohort, keep these fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gross merchandise value;&lt;/li&gt;
&lt;li&gt;discounts funded by the seller;&lt;/li&gt;
&lt;li&gt;platform commission and payment fees;&lt;/li&gt;
&lt;li&gt;affiliate or creator commission;&lt;/li&gt;
&lt;li&gt;product cost;&lt;/li&gt;
&lt;li&gt;outbound fulfillment cost;&lt;/li&gt;
&lt;li&gt;estimated refunds and returns;&lt;/li&gt;
&lt;li&gt;settlement date or settlement window;&lt;/li&gt;
&lt;li&gt;reserve amount withheld;&lt;/li&gt;
&lt;li&gt;expected release date for withheld funds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key is to preserve the cohort identifier through refunds and settlement events. If reports are rebuilt only from the current payout feed, a late refund can silently move revenue from one day to another and make yesterday's reconciliation impossible to reproduce.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate economic profit from available cash
&lt;/h2&gt;

&lt;p&gt;A simple contribution-profit view is:&lt;/p&gt;

&lt;p&gt;Contribution profit = net merchandise value - product cost - fulfillment - platform fees - creator or affiliate commission - ad spend - known refunds.&lt;/p&gt;

&lt;p&gt;Cash available should then be calculated from the settlement event, not from the order event:&lt;/p&gt;

&lt;p&gt;Expected cash = settled net sales - refunds settled in the same window - fees deducted - reserve held + reserve released.&lt;/p&gt;

&lt;p&gt;Ad spend needs its own payment timing. If the advertising bill clears before the marketplace payout, the business has a temporary cash gap even when the campaign is profitable. That gap must be explicitly funded rather than hidden inside a monthly profit total.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a rolling settlement ladder
&lt;/h2&gt;

&lt;p&gt;Build a daily ladder with one row per order cohort and columns for the next 14 to 30 days. For each future date, place the expected values into four buckets:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;cash expected from settled orders;&lt;/li&gt;
&lt;li&gt;cash expected to be released from reserves;&lt;/li&gt;
&lt;li&gt;refunds expected to reduce future cash;&lt;/li&gt;
&lt;li&gt;known outflows, including ads, creators, fulfillment, and inventory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The resulting curve is more useful than a single cash-conversion number. It shows whether a profitable week creates a liquidity problem before the next payout arrives.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update note (November 18, 2026):&lt;/strong&gt; Added a reproducible cash-gap example and a three-check budget release gate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Worked example: a profitable cohort can still create a cash gap
&lt;/h3&gt;

&lt;p&gt;Suppose a synthetic order cohort has USD 100,000 in gross sales and the following operating inputs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Seller-funded discounts&lt;/td&gt;
&lt;td&gt;5,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product cost&lt;/td&gt;
&lt;td&gt;28,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fulfillment cost&lt;/td&gt;
&lt;td&gt;6,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform and payment fees&lt;/td&gt;
&lt;td&gt;7,600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creator commission&lt;/td&gt;
&lt;td&gt;9,500&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ad spend&lt;/td&gt;
&lt;td&gt;12,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expected refunds&lt;/td&gt;
&lt;td&gt;8,550&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reserve withheld from the next payout&lt;/td&gt;
&lt;td&gt;10,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;First calculate contribution profit for the cohort:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;net merchandise = 100,000 - 5,000 = 95,000
contribution = 95,000
             - 28,000 product
             - 6,000 fulfillment
             - 7,600 platform and payment fees
             - 9,500 creator commission
             - 12,000 ad spend
             - 8,550 expected refunds
             = 23,350 USD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now calculate the first payout before the separate operating outflows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;payout cash = 95,000
            - 8,550 expected refunds
            - 7,600 platform and payment fees
            - 9,500 creator commission
            - 10,000 reserve
            = 59,350 USD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally compare that payout with commitments due before the reserve releases. If inventory, ads, fulfillment, and creator sampling total USD 65,000, the projected buffer is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;59,350 payout cash - 65,000 committed outflows = -5,650 USD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cohort still contributes USD 23,350 to economic profit, but it is short USD 5,650 in the near-term cash window. Both statements can be true because profit and payment timing answer different questions. Inventory and fulfillment appear in both views, but the cohort profit view records their economic cost while the cash view records when each obligation is actually paid.&lt;/p&gt;

&lt;p&gt;These invented figures exclude fixed overhead, financing, taxes and settlement timing that is not yet known. They are a reproducible operating example, not net profit or a forecast of a real store.&lt;/p&gt;

&lt;h3&gt;
  
  
  Convert the result into a budget gate
&lt;/h3&gt;

&lt;p&gt;Do not release the next ad increase merely because the cohort contribution is positive. Require all three checks to pass:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mature contribution:&lt;/strong&gt; the cohort remains above the required contribution threshold after expected refunds and commissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Marginal ROAS:&lt;/strong&gt; the next spend tranche is above its break-even threshold, preferably tested as a small step rather than an all-at-once increase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Funding window:&lt;/strong&gt; projected cash covers the next inventory, fulfillment and ad-payment cycle without depending on an unreleased reserve.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The free &lt;a href="https://www.fz567.cn/tools/breakeven-roas-calculator" rel="noopener noreferrer"&gt;break-even ROAS calculator&lt;/a&gt; can be used to turn margin assumptions into an explicit spend threshold before the next budget decision.&lt;/p&gt;

&lt;p&gt;Record the decision date, the cohort IDs, the reserve assumption, the next committed outflow and the threshold used. If any input changes later, append a revised observation rather than overwriting the earlier decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reconcile refunds by stage
&lt;/h2&gt;

&lt;p&gt;Late refunds create two separate problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the economic profit for the original cohort changes;&lt;/li&gt;
&lt;li&gt;the cash forecast changes when the refund is actually deducted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Record the refund twice only if it belongs to two different views: once as an adjustment to the original cohort's profit, and once as an outflow or reduced settlement in the cash ladder. Never subtract the same refund twice from the same measure. The cohort ledger should state which event type was applied and when.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set liquidity triggers before they are needed
&lt;/h2&gt;

&lt;p&gt;Useful operating triggers include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;projected seven-day cash is below the next seven days of committed outflows;&lt;/li&gt;
&lt;li&gt;reserve growth exceeds the prior three cohorts' average by a material threshold;&lt;/li&gt;
&lt;li&gt;refund rate rises while settlement cash remains flat;&lt;/li&gt;
&lt;li&gt;ad spend clears more than one expected payout cycle ahead of revenue;&lt;/li&gt;
&lt;li&gt;inventory purchase commitments exceed the projected released cash for the next cycle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A trigger should identify an action, not merely show a red cell. Examples are reducing nonessential inventory purchases, pausing marginal ad spend, renegotiating creator payment timing, or increasing the opening cash buffer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rebuild the forecast without rewriting history
&lt;/h2&gt;

&lt;p&gt;Keep two timestamps for every material number: the business date it represents and the time it was observed. When a payout feed late-arrives, append the correction as a new version. The prior report remains reproducible, and the forecast can be updated with an explicit adjustment.&lt;/p&gt;

&lt;p&gt;This is especially important for teams comparing stores. A store with a longer settlement window can look worse on a payout-basis report while producing the same underlying contribution profit. Compare cohorts on profit first, then compare the timing of cash separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  A compact operating checklist
&lt;/h2&gt;

&lt;p&gt;Every day, check:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Are there new or late refunds attached to old cohorts?&lt;/li&gt;
&lt;li&gt;Did the settlement date or reserve amount change?&lt;/li&gt;
&lt;li&gt;Which ad and creator payments clear before the next payout?&lt;/li&gt;
&lt;li&gt;What is the lowest projected cash balance over the next 14 days?&lt;/li&gt;
&lt;li&gt;Which inventory commitment depends on a reserve release that has not happened yet?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The model does not need to predict every settlement to be useful. It needs to make timing assumptions visible, preserve the original ledger, and give operators a direct link between contribution profit and the money available to run the next cycle.&lt;/p&gt;

&lt;p&gt;I work on Starway Global and maintain a detailed &lt;a href="https://www.fz567.cn/blog/tiktok-payout-cashflow" rel="noopener noreferrer"&gt;TikTok Shop payout and cash-flow guide&lt;/a&gt; with the underlying framework. General operating guidance only; validate assumptions against your own settlement and refund data.&lt;/p&gt;

</description>
      <category>analytics</category>
    </item>
    <item>
      <title>A stop-loss decision tree for TikTok Shop GMV Max campaigns</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 07:07:31 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/a-stop-loss-decision-tree-for-tiktok-shop-gmv-max-campaigns-15ih</link>
      <guid>https://dev.to/starwayglobalfz/a-stop-loss-decision-tree-for-tiktok-shop-gmv-max-campaigns-15ih</guid>
      <description>&lt;p&gt;A falling ROAS is not, by itself, a reason to pause a TikTok Shop campaign. The right decision depends on whether the change is temporary noise, incomplete attribution, creative fatigue, or a genuine loss of unit economics.&lt;/p&gt;

&lt;p&gt;This decision tree keeps those cases separate. It is designed for operators who need a repeatable review at the end of each day without rebuilding yesterday's profit report.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with completed economics, not dashboard revenue
&lt;/h2&gt;

&lt;p&gt;Use four values for the same attribution window:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;settled or estimated net revenue;&lt;/li&gt;
&lt;li&gt;product cost and fulfillment cost;&lt;/li&gt;
&lt;li&gt;platform and payment fees;&lt;/li&gt;
&lt;li&gt;ad spend and known refunds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Calculate contribution profit before making a campaign decision. Revenue can rise while contribution profit falls, especially when discounts, affiliate commission, or delayed refunds are increasing.&lt;/p&gt;

&lt;p&gt;The relevant guardrail is break-even ROAS, not a universal target such as 2.0. Break-even ROAS changes with gross margin, refund rate, commission, and fulfillment cost. A SKU with a lower margin needs a higher ROAS for the same ad spend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a three-window review
&lt;/h2&gt;

&lt;p&gt;Do not compare one day with the previous day and call it a trend. Review three windows together:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Today:&lt;/strong&gt; detect an operational problem such as rejected creative, a stockout, or a tracking outage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trailing three days:&lt;/strong&gt; separate a normal daily fluctuation from a sustained decline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trailing seven days:&lt;/strong&gt; decide whether the campaign still creates incremental contribution profit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A useful rule is to act immediately only when the cause is known and directly reversible. Otherwise, wait until the three-day window confirms that the decline survives normal attribution lag.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch 1: data is incomplete
&lt;/h2&gt;

&lt;p&gt;If orders, refunds, or conversion events are still arriving, the first action is to freeze decisions. Do not pause the campaign because a delayed feed made today look worse than yesterday.&lt;/p&gt;

&lt;p&gt;Record the last successful event time and reconcile the same cohort after the platform attribution window closes. Segment the report by order date, not only by event date, so late conversions do not rewrite an already-published daily result without explanation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch 2: spend or traffic changed unexpectedly
&lt;/h2&gt;

&lt;p&gt;Check whether a bid, budget, product price, inventory status, or promotion changed. A traffic spike with stable conversion rate can still reduce ROAS when low-intent inventory displaces higher-intent inventory.&lt;/p&gt;

&lt;p&gt;If the only recent change is budget, use a small step change and compare the marginal profit after at least one full conversion window. Scaling a campaign from a profitable level does not guarantee that the next unit of spend is profitable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch 3: creative response is decaying
&lt;/h2&gt;

&lt;p&gt;Creative fatigue usually appears as a decline in click-through rate or conversion rate before the ROAS target misses. Replace one variable at a time: hook, visual proof, offer, or product angle.&lt;/p&gt;

&lt;p&gt;Do not replace every asset at once. If the previous winner still has adequate frequency and conversion, keep a control version so the next test has a baseline. A testing schedule is more useful than a single emergency creative.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch 4: campaign-level ROAS hides SKU-level losses
&lt;/h2&gt;

&lt;p&gt;GMV Max can allocate traffic across a catalog. A campaign can appear acceptable while a low-margin or high-return SKU consumes spend.&lt;/p&gt;

&lt;p&gt;Break the contribution result down by SKU and by order cohort. If profitable products are subsidizing unprofitable ones, adjust eligibility, price, or creative emphasis before raising the campaign budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch 5: the campaign is genuinely below break-even
&lt;/h2&gt;

&lt;p&gt;Pause or reduce spend when all three conditions are true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;completed contribution profit is negative after known refunds;&lt;/li&gt;
&lt;li&gt;the decline persists across the three-day and seven-day windows;&lt;/li&gt;
&lt;li&gt;no known data or inventory issue explains the result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use a staged reduction rather than an all-or-nothing stop when volume matters to learning. Record the decision time, the attribution window, the break-even threshold, and the exact change made. That record lets the next review distinguish a bad decision from a bad outcome.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update note (November 19, 2026):&lt;/strong&gt; Added a reproducible contribution and pending-refund example for the budget decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Worked example: separate completed profit from refund reserve
&lt;/h2&gt;

&lt;p&gt;Suppose one synthetic GMV Max cohort has USD 12,000 in completed net merchandise revenue after already-recorded refunds. The remaining variable costs are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product cost&lt;/td&gt;
&lt;td&gt;3,600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fulfillment&lt;/td&gt;
&lt;td&gt;900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform and payment fees&lt;/td&gt;
&lt;td&gt;720&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creator commission&lt;/td&gt;
&lt;td&gt;1,200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ad spend&lt;/td&gt;
&lt;td&gt;4,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pending refunds not yet recorded&lt;/td&gt;
&lt;td&gt;600&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The base pre-ad contribution is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;12,000 - 3,600 - 900 - 720 - 1,200 = 5,580 USD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With USD 4,000 of ad spend, contribution is USD 1,580 and break-even ROAS is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;12,000 / 5,580 = 2.15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The campaign used USD 4,000 to produce USD 12,000 of revenue, so actual ROAS is 3.00. It is above the 2.15 break-even line, but that comparison assumes the recorded revenue is mature.&lt;/p&gt;

&lt;p&gt;Now reserve the USD 600 of pending refunds before making a larger budget decision:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adjusted pre-ad contribution = 5,580 - 600 = 4,980 USD
contribution after ads = 4,980 - 4,000 = 980 USD
adjusted break-even ROAS = 12,000 / 4,980 = 2.41
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The campaign is still positive, but its cushion is thinner. If the pending-refund window has not closed, hold the current budget or test only a small tranche. Do not treat the full USD 1,580 as settled profit available for reinvestment.&lt;/p&gt;

&lt;p&gt;The decision changes when the next tranche has to justify marginal profit, not the cohort average. Record projected incremental revenue, incremental ad spend and pending refunds together; a 3.00 reported ROAS does not prove that the next 20% of spend will clear the adjusted threshold.&lt;/p&gt;

&lt;p&gt;These invented figures exclude fixed overhead, financing, taxes and unknown future refunds. They are an operating example, not a forecast. The complete &lt;a href="https://www.fz567.cn/guides/gmvmax-complete-guide" rel="noopener noreferrer"&gt;GMV Max operating guide&lt;/a&gt; expands the budget, creative and stop-loss rules behind this example.&lt;/p&gt;

&lt;h2&gt;
  
  
  A compact operator checklist
&lt;/h2&gt;

&lt;p&gt;Before pausing, ask:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Are refunds and conversions still incomplete?&lt;/li&gt;
&lt;li&gt;Did price, stock, commission, or tracking change?&lt;/li&gt;
&lt;li&gt;Is the problem campaign-wide or concentrated in a few SKUs?&lt;/li&gt;
&lt;li&gt;Is the decline visible on a three-day and seven-day basis?&lt;/li&gt;
&lt;li&gt;Is contribution profit below the current break-even ROAS?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before increasing spend, ask:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Is marginal contribution profit positive, not just average ROAS?&lt;/li&gt;
&lt;li&gt;Is the result based on a full conversion window?&lt;/li&gt;
&lt;li&gt;Is there a control creative or cohort for comparison?&lt;/li&gt;
&lt;li&gt;Can inventory and fulfillment support the additional volume?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal is not to protect a ROAS number. The goal is to protect contribution profit while preserving enough volume to learn.&lt;/p&gt;

&lt;p&gt;I work on Starway Global and maintain a free &lt;a href="https://www.fz567.cn/tools/breakeven-roas-calculator" rel="noopener noreferrer"&gt;break-even ROAS calculator&lt;/a&gt; and a detailed &lt;a href="https://www.fz567.cn/blog/gmvmax-roas-decline-recovery" rel="noopener noreferrer"&gt;GMV Max ROAS decline recovery guide&lt;/a&gt;. The canonical source for this article is the guide.&lt;/p&gt;

&lt;p&gt;This article is general operating guidance, not financial advice. Validate assumptions against your own settled order and refund data.&lt;/p&gt;

</description>
      <category>marketing</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Modeling Late TikTok Shop Refunds Without Rewriting Yesterday's Profit</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Fri, 13 Nov 2026 02:09:26 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/modeling-late-tiktok-shop-refunds-without-rewriting-yesterdays-profit-5ach</link>
      <guid>https://dev.to/starwayglobalfz/modeling-late-tiktok-shop-refunds-without-rewriting-yesterdays-profit-5ach</guid>
      <description>&lt;p&gt;A daily profit report is easy to build when every order, refund, and fee arrives on the day it occurred. Real marketplace operations are messier: refunds arrive late, commission estimates are finalized later, and settlement corrections can appear days after the sale.&lt;/p&gt;

&lt;p&gt;If the reporting layer overwrites yesterday's numbers whenever new information arrives, operators lose two things at once: a stable history and the ability to learn from the correction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate event time from posting time
&lt;/h2&gt;

&lt;p&gt;Store two timestamps for every money movement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;event date&lt;/strong&gt; — when the sale, refund, or fee is considered to have happened;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;posting date&lt;/strong&gt; — when the platform reported the adjustment to your system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This lets you show a stable event-date view while also surfacing when new corrections were discovered. Finance can use the latest posting state; operations can see whether a product suddenly accumulated late refunds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep revisions instead of destructive updates
&lt;/h2&gt;

&lt;p&gt;A settlement record should have an external identifier, a revision number, and the raw payload hash. When a corrected record arrives, append a new revision rather than replacing the old row. The current view can select the highest revision while the audit view preserves the history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculate both provisional and settled profit
&lt;/h2&gt;

&lt;p&gt;A practical model has two states:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provisional_profit = GMV - estimated_fees - estimated_creator_cost - ad_spend
settled_profit     = settled_revenue - final_fees - final_creator_cost - ad_spend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The estimate is useful for monitoring today. The settled figure is the source of truth after reconciliation. Display the difference prominently instead of hiding it in a support ticket.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add a late-event quality signal
&lt;/h2&gt;

&lt;p&gt;Track the posting lag for each adjustment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lag_days = business_date(posting_time) - business_date(event_time)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A store whose refunds typically post within two days but suddenly starts posting at day seven deserves investigation. The signal can reflect a marketplace change, a product problem, or a broken integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a reconciliation window
&lt;/h2&gt;

&lt;p&gt;Do not mark a day final immediately. Use a configurable window, compare event-date totals with later settled totals, and expose the unresolved amount. Once the difference falls inside an agreed tolerance, mark the day reconciled.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small schema that scales
&lt;/h2&gt;

&lt;p&gt;At minimum, keep:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;store and market identifiers;&lt;/li&gt;
&lt;li&gt;currency and the exchange-rate date;&lt;/li&gt;
&lt;li&gt;event date and posting date;&lt;/li&gt;
&lt;li&gt;source document ID and revision;&lt;/li&gt;
&lt;li&gt;gross revenue, refunds, platform fees, creator cost, and ad spend;&lt;/li&gt;
&lt;li&gt;provisional and settled contribution profit;&lt;/li&gt;
&lt;li&gt;quality flags and the last reconciliation time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not to make every number final immediately. It is to make uncertainty visible, auditable, and safe to revise.&lt;/p&gt;

&lt;p&gt;This model complements the &lt;a href="https://www.fz567.cn/blog/tiktok-profit-calculation" rel="noopener noreferrer"&gt;TikTok Shop profit calculation guide&lt;/a&gt;. You can test unit economics with the &lt;a href="https://www.fz567.cn/tools/profit-calculator" rel="noopener noreferrer"&gt;free profit calculator&lt;/a&gt; before loading a full marketplace ledger.&lt;/p&gt;

</description>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Designing a Multi-Store Profit Feed That Doesn't Lie</title>
      <dc:creator>Starway Global</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:37:58 +0000</pubDate>
      <link>https://dev.to/starwayglobalfz/designing-a-multi-store-profit-feed-that-doesnt-lie-8ef</link>
      <guid>https://dev.to/starwayglobalfz/designing-a-multi-store-profit-feed-that-doesnt-lie-8ef</guid>
      <description>&lt;p&gt;TikTok Shop operators often run several stores, several ad accounts, and several people who all need the same answer: &lt;strong&gt;are we actually making money?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A dashboard that only adds revenue from each store can look healthy while profit is leaking through returns, delayed fees, creator commissions, and campaign spend. The problem is usually not the chart. It is the grain and timing of the underlying profit feed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with one daily ledger grain
&lt;/h2&gt;

&lt;p&gt;Use one row per store, market, currency, and business date. Keep gross merchandise value, seller-funded discounts, platform fees, affiliate commissions, refunds, and ad spend as separate columns. Do not flatten them into a single revenue number too early; once the details disappear, reconciliation becomes guesswork.&lt;/p&gt;

&lt;p&gt;Store the source timestamp and the ingestion timestamp together. This makes late-arriving orders and corrected settlements visible instead of silently rewriting yesterday's total.&lt;/p&gt;

&lt;h2&gt;
  
  
  Normalize time before comparing stores
&lt;/h2&gt;

&lt;p&gt;Orders, ads, and settlements may use different time zones. Convert all event timestamps to a documented reporting time zone, then derive the business date from that normalized time. Pair every displayed metric with the time zone used to calculate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat returns and fees as delayed events
&lt;/h2&gt;

&lt;p&gt;A refund can arrive days after the order. A commission can be estimated first and finalized later. A robust feed should support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;event date&lt;/strong&gt; — when the sale happened;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;posting date&lt;/strong&gt; — when the adjustment became known;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;revision version&lt;/strong&gt; — which settlement record is current.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep both event-date and posting-date views. Finance needs the corrected ledger; operations often needs to see when a problem was discovered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Allocate shared costs explicitly
&lt;/h2&gt;

&lt;p&gt;Ad spend and creator cost should have a documented allocation rule. An ad account linked to two stores can be split by tracked revenue, order count, or a fixed operating rule. The exact rule matters less than making it stable, visible, and versioned.&lt;/p&gt;

&lt;p&gt;Do not let a visual grouping imply a precision that the source data does not have. Label estimated contribution separately from settled profit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make metric semantics part of the API
&lt;/h2&gt;

&lt;p&gt;A useful feed returns definitions alongside values. This synthetic example uses merchandise revenue &lt;strong&gt;before refunds&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"store_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"store_01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"business_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-12"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"currency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"USD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"merchandise_revenue_before_refunds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;8240.55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"refunds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;312.10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"platform_fees"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;641.22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"creator_cost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;530.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"ad_spend"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1120.40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cost_of_goods_sold"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1800.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"fulfilment_cost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;600.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"contribution_profit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3236.83&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"is_estimated"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Revenue is after seller-funded discounts, before the listed deductions. Contribution is &lt;code&gt;8240.55 - 312.10 - 641.22 - 530.00 - 1120.40 - 1800.00 - 600.00 = 3236.83 USD&lt;/code&gt;. These invented figures exclude fixed overhead, financing and income tax. This is estimated contribution, not settled cash or net profit. Normalize already-net source revenue before subtracting refunds or fees again. COGS and fulfilment costs are net of recorded recoveries and credits; never deduct or credit those twice. Store money as integer minor units or fixed decimals.&lt;/p&gt;

&lt;p&gt;The schema is intentionally boring. Boring fields are easier to audit, compare, and monitor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put anomalies into the data model
&lt;/h2&gt;

&lt;p&gt;Late settlements, duplicate imports, currency mismatches, and negative adjusted orders should become explicit quality flags. A feed that quietly drops these rows creates a more dangerous problem than a dashboard with a visible warning.&lt;/p&gt;

&lt;p&gt;A practical validation layer can check:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every order maps to one known store.&lt;/li&gt;
&lt;li&gt;Currency conversion uses the documented rate date.&lt;/li&gt;
&lt;li&gt;The settled total remains within a defined tolerance of the event-date estimate.&lt;/li&gt;
&lt;li&gt;Ad spend exists for every active campaign account.&lt;/li&gt;
&lt;li&gt;Refund and fee revisions never overwrite the raw source record.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Make duplicate imports harmless
&lt;/h2&gt;

&lt;p&gt;Scope refund IDs to store and source, retain revisions, and project the latest &lt;strong&gt;complete snapshot&lt;/strong&gt;. This SQLite example uses synthetic integer USD cents and increasing source versions. Source namespaces own distinct refunds here; overlapping feeds require canonical event mapping or one authoritative feed first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;refund_snapshot&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;store_id&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;revision&lt;/span&gt; &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;revision&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;currency&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;amount_cents&lt;/span&gt; &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
    &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount_cents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'integer'&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;amount_cents&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;revision&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- A repeated version must carry the same payload; otherwise stop the import.&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TRIGGER&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;reject_conflicting_version&lt;/span&gt;
&lt;span class="no"&gt;BEFORE&lt;/span&gt; &lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;refund_snapshot&lt;/span&gt;
&lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;refund_snapshot&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;
  &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;store_id&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;revision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;revision&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount_cents&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NEW&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount_cents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;BEGIN&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="no"&gt;RAISE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ABORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'conflicting refund snapshot version'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;refund_snapshot&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'store_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'source_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'refund_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'store_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'source_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'refund_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'store_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'source_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'refund_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'store_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'source_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'refund_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'store_b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'source_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'refund_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'store_a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'source_b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'refund_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;CONFLICT&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;revision&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;DO&lt;/span&gt; &lt;span class="k"&gt;NOTHING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;ranked&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;ROW_NUMBER&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;PARTITION&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_id&lt;/span&gt; &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;revision&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;version_rank&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;refund_snapshot&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount_cents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;refund_cents&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;ranked&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;version_rank&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currency&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;store_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected totals: &lt;code&gt;store_a = 1700&lt;/code&gt;, &lt;code&gt;store_b = 700&lt;/code&gt; cents. Revision 2 contributes 1500 once; revision 1 is retained without adding its 1000 again. Identical IDs across stores or independent sources remain separate. Replaying the import preserves totals. Conflicting versions raise an error.&lt;/p&gt;

&lt;p&gt;Incremental refund movements need movement-level identities and a different projection. Before production ingestion, validate inputs, retain raw payloads and timestamps, and extend the conflict check to every payload field. Event-date and posting-date attribution require additional source fields. This example demonstrates identity and totals, not a live platform integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the feed for decisions, not decoration
&lt;/h2&gt;

&lt;p&gt;Once the ledger is normalized, operators can answer useful questions consistently: which store has the best contribution margin, which campaign is creating revenue without profit, where returns are eroding a product, and which creator mix is improving repeatable economics.&lt;/p&gt;

&lt;p&gt;Multi-store reporting is less about connecting more charts and more about agreeing on one auditable definition of profit. The original operations guide behind this model is available in the &lt;a href="https://www.fz567.cn/blog/multi-store-management?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=multi-store-profit-feed&amp;amp;utm_content=article-guide-link" rel="noopener noreferrer"&gt;multi-store management playbook&lt;/a&gt;, and the &lt;a href="https://www.fz567.cn/tools/profit-calculator?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=multi-store-profit-feed&amp;amp;utm_content=article-tool-link" rel="noopener noreferrer"&gt;free profit calculator&lt;/a&gt; can help validate unit economics before the data is connected.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Updated November 16, 2026: added the cost boundary and a reproducible refund snapshot example. Maintained by Starway Global, publisher of the linked guide and calculator.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>tiktok</category>
      <category>ecommerce</category>
      <category>analytics</category>
    </item>
  </channel>
</rss>
