Syncing Assortments with Sanity
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) |