Syncing Assortments with Sanity
8 min
overview this guide explains how to bring assortment subscriptions from sanity into the oms, keep their weekly schedules in sync, and understand what you're seeing in the admin what this feature does your assortment products and their weekly schedules ("what ships each week") are authored in sanity the oms reads that content and creates the matching records it needs to actually fulfill subscriptions a product (the thing customers buy), and for products flagged as an assortment , a subscription type plus its weekly schedule (the list of which items ship in each date window) the sync is one way sanity β oms you make changes in sanity, then import or re sync them here importing a product or assortment go to subscription types β import from sanity (/admin/subscription types/import) use the search box and the type filter (e g assortment) to find the entry you want each row shows a status not imported β nothing exists in the oms for this entry yet partial β product only β the product was created, but the assortment's schedule/weekly line items did not import this needs attention (see troubleshooting) imported β fully imported for assortments, this means the schedule and at least one weekly window are present click import (or re sync if it already exists) this pulls the current published state from sanity when an assortment imports successfully, you're taken to its schedule page and shown how many windows and line items were created the assortment schedule open an assortment's schedule from subscription types β the schedule link in the assortments column, or directly after importing the page lists each week (date window) and the line items that ship in it a subscription type that's date based shows a schedule by week a sequence based type (selected by installment number instead of date) shows installments rather than weeks β the labels adjust automatically the in sanity column compares each window against the current sanity content so you can see what's unchanged versus what differs keeping the schedule up to date use the sync schedule button on the schedule page to re pull this assortment's weekly windows from sanity it rebuilds the week by week line items from the latest published content but leaves the subscription type's configuration untouched re syncing overwrites the oms schedule with the current sanity state, so it's the safe way to push corrections β fix the content in sanity, then click sync schedule the assortment calendar subscription types β assortment calendar gives a week by week grid across your date based assortments, so you can see at a glance what ships when and spot gaps use the show types filter to focus on specific assortments, and the earlier / later buttons to move through time if nothing appears, the page tells you why no date based subscription types configured yet, none selected in the filter, or no assortments scheduled in the visible date range updating an assortment later to change what ships edit the assortment content in sanity and publish in the oms, either re sync from the import page, or open the schedule and click sync schedule both overwrite the oms with the latest sanity state re importing an assortment you previously imported does not create duplicates β it updates the existing product and rebuilds the schedule deleting and re importing you can delete an assortment's subscription type from the admin if you later re import the same assortment from sanity, it will recreate cleanly β you don't need to do anything special troubleshooting an assortment shows "partial β product only" / the product page has no link to a schedule this means the product imported but the schedule didn't the most common causes the items in the schedule aren't in the oms yet the weekly line items reference coffees/products that also need to exist in the oms the import tries to pull these in automatically; if some can't be found in sanity, those weeks or line items are skipped check that the referenced products are published in sanity the weekly schedules across the assortment's variants don't match every variant of the assortment must follow the same set of weekly date windows if one variant's weeks differ, the import won't build the schedule line the dates up in sanity and re import after fixing the cause in sanity, click re sync (or sync schedule ) and the status should move to imported the import page won't load entries sanity features only appear when sanity is configured for the store if the page shows an error or the sanity options are missing, the store may not have its sanity connection set up β contact your administrator a label still says the old wording after a change was shipped the admin reflects the deployed version if a screen looks out of date right after a release, it may be waiting on the latest deploy to reach this environment quick reference you want toβ¦ do this bring an assortment into the oms import from sanity β import update an already imported assortment re sync (import page) or sync schedule (schedule page) see what ships each week open the assortment's schedule see everything across assortments by week assortment calendar understand a row's state read the status badge (not imported / partial β product only / imported)