Hi @m4doyle ,
I would like to outline a potential solution for enabling B2B customers to download filtered product CSV files from our Shopify Plus catalog, which contains approximately 4 million SKUs.
The proposed approach involves the following key components:
Customer Interface (Frontend): A straightforward form, potentially embedded as an app or functioning independently, would allow users to specify their desired product filters, such as brand, color, and category.
Backend Service (Node.js or Laravel): Upon form submission, a background job would be enqueued, containing the selected filter parameters. If no other bulk operation is currently in progress, this job would initiate a Shopify Admin GraphQL Bulk API product query, retrieving only the necessary fields.
Queue and Job Handling: A job queue system, such as BullMQ or Laravel Queues, would manage these tasks. To comply with Shopify’s limitation of a single concurrent bulk operation per store, we would ensure that only one bulk job runs at any given time. Once the Shopify bulk job concludes, as indicated by a webhook notification, the resulting JSONL file would be downloaded.
Data Filtering and CSV Generation: The downloaded JSONL file would then be parsed server-side, and the user’s specified filters (e.g., color, brand) would be applied programmatically. Subsequently, a CSV file would be generated using a suitable library like fast-csv or csv-writer.
Storage and Notification: The generated CSV file would be uploaded to a storage solution such as Amazon S3. Following this, the user would be notified via email with a direct download link, or the link would be made accessible through a user dashboard.
Please let me know if you need more information .
Thanks