<?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: https://www.toptoyfactory.com/  </title>
    <description>The latest articles on DEV Community by https://www.toptoyfactory.com/   (@cps_toys_375cc2d62681abcc).</description>
    <link>https://dev.to/cps_toys_375cc2d62681abcc</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%2F4023575%2F8fd375fd-84e4-4f38-97ec-633aa78bd388.png</url>
      <title>DEV Community: https://www.toptoyfactory.com/  </title>
      <link>https://dev.to/cps_toys_375cc2d62681abcc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cps_toys_375cc2d62681abcc"/>
    <language>en</language>
    <item>
      <title>Five Validation Rules for a Wholesale Toy Product Feed</title>
      <dc:creator>https://www.toptoyfactory.com/  </dc:creator>
      <pubDate>Fri, 10 Jul 2026 06:52:47 +0000</pubDate>
      <link>https://dev.to/cps_toys_375cc2d62681abcc/five-validation-rules-for-a-wholesale-toy-product-feed-3da8</link>
      <guid>https://dev.to/cps_toys_375cc2d62681abcc/five-validation-rules-for-a-wholesale-toy-product-feed-3da8</guid>
      <description>&lt;p&gt;A wholesale product feed is easy to generate and surprisingly easy to get wrong.&lt;/p&gt;

&lt;p&gt;When a buyer is comparing hundreds of toys, a feed should do more than repeat a product title and image. It should preserve the commercial facts that determine whether the item can actually enter a shortlist: the item number, minimum order quantity, carton packing, destination-market compliance, and the exact page where the buyer can request a current quotation.&lt;/p&gt;

&lt;p&gt;I recently organized a public toy-catalog feed for a B2B sourcing project. These are the five validation rules that made the data useful to both procurement teams and software.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Give every product one durable canonical URL
&lt;/h2&gt;

&lt;p&gt;A feed should never invent a second URL for the same item. The product page remains the source of truth, while JSON, sitemaps and internal search point back to it.&lt;/p&gt;

&lt;p&gt;A small validation check catches duplicate slugs and malformed URLs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;feed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;products&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="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&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="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https:&lt;/span&gt;&lt;span class="dl"&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;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Non-HTTPS URL: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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="nx"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slug&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="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Duplicate slug: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this project, the canonical catalog is published on &lt;a href="https://www.toptoyfactory.com/" rel="noopener noreferrer"&gt;TopToyFactory&lt;/a&gt;, while the established &lt;a href="https://www.cps-toys.com/" rel="noopener noreferrer"&gt;CPS TOYS company catalog&lt;/a&gt; remains a useful buyer destination and company reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Separate a real SKU from marketing copy
&lt;/h2&gt;

&lt;p&gt;Titles change. Item numbers should not.&lt;/p&gt;

&lt;p&gt;A usable record keeps the SKU in its own field instead of forcing a buyer or application to extract it from a long title:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"slug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"automatic-electronic-water-gun"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"sku"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"CPS284639"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bulk Automatic Electronic Water Gun"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Wholesale Water Guns"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This matters when a buyer sends screenshots, spreadsheets, packaging artwork and sample feedback over several weeks. The SKU is the join key across those conversations.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Treat MOQ and case pack as different facts
&lt;/h2&gt;

&lt;p&gt;MOQ answers &lt;strong&gt;how much must be ordered&lt;/strong&gt;. Case pack answers &lt;strong&gt;how many pieces are packed in one export carton&lt;/strong&gt;. They are related, but they are not interchangeable.&lt;/p&gt;

&lt;p&gt;For example:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"moq"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"5CTNS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"case_pack"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"18 pcs/carton"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"lead_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Contact for current lead time"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A buyer can use those fields to estimate the starting piece quantity, but the factory still needs to confirm mixed-item rules, packaging changes and current production scheduling.&lt;/p&gt;

&lt;p&gt;A good feed therefore avoids false precision. If the current FOB/EXW price or lead time is not public, it should say so instead of inserting a zero or stale number.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Store certificate names as claims to verify, not universal promises
&lt;/h2&gt;

&lt;p&gt;Toy compliance depends on the item, age grading, materials, destination market and test scope. A feed can expose available certificate labels, but it should also tell the user to confirm the evidence for the exact SKU.&lt;/p&gt;

&lt;p&gt;A practical model looks like this:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"certifications"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"EN71"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ASTM"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"HR4040"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"CE"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"rfq_required"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"verification_note"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Confirm certificate scope by item number and destination market"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That wording is more useful than a blanket statement such as “all products are certified.” It tells the buyer what to ask for before approving a sample or packaging layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Keep the feed machine-readable without hiding the buyer path
&lt;/h2&gt;

&lt;p&gt;A product feed is not a substitute for a product page. It is an index.&lt;/p&gt;

&lt;p&gt;Each record should include a clear next action:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;canonical product URL;&lt;/li&gt;
&lt;li&gt;quote-cart or RFQ URL;&lt;/li&gt;
&lt;li&gt;contact page;&lt;/li&gt;
&lt;li&gt;the facts a buyer must supply, such as target market, quantity and packaging;&lt;/li&gt;
&lt;li&gt;a timestamp or generation date for the feed itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The public implementation is available in the &lt;a href="https://github.com/kxxxyyy/toptoyfactory-sourcing-data" rel="noopener noreferrer"&gt;TopToyFactory sourcing data repository&lt;/a&gt;, with a browser-friendly &lt;a href="https://kxxxyyy.github.io/toptoyfactory-sourcing-data/" rel="noopener noreferrer"&gt;RFQ checklist and data index&lt;/a&gt;. The repository includes a company facts file, a product feed and an LLM-oriented text index.&lt;/p&gt;

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

&lt;p&gt;Before publishing a B2B product feed, I now check:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every slug is unique.&lt;/li&gt;
&lt;li&gt;Every product URL is HTTPS and canonical.&lt;/li&gt;
&lt;li&gt;SKU, MOQ and case pack are separate fields.&lt;/li&gt;
&lt;li&gt;Empty prices are explicit, never represented as zero.&lt;/li&gt;
&lt;li&gt;Certificate labels include a verification note.&lt;/li&gt;
&lt;li&gt;Images return successfully and include meaningful alternative text on the product page.&lt;/li&gt;
&lt;li&gt;The feed links to a real RFQ or contact path.&lt;/li&gt;
&lt;li&gt;The generation date and product count are present.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The main lesson is simple: structured data becomes valuable when it preserves procurement context. A smaller set of honest, comparable facts is more useful than a large feed filled with guessed prices, duplicated URLs or vague compliance claims.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
