Skip to content

Conversation

@ervishnucs
Copy link

Description:
This PR improves the Shopify integration by migrating sync flows from REST API to GraphQL, enabling bulk operations, reducing API rate-limit issues, and adding real-time progress tracking for long-running sync jobs.

Issues:

  1. Shopify REST APIs were limited to small batches (≈100 records) and frequently hit 429 rate-limit errors
  2. Long-running sync jobs had no reliable progress visibility
  3. Webhook subscriptions, inventory updates, and product updates were unreliable with REST
  4. Syncing old orders
  5. Some data formats were incompatible with ERPNext expectations.

Fixes:

  1. Replaced REST APIs with GraphQL for products, inventory, orders, customers, and webhooks
  2. Implemented GraphQL bulk operations for product imports using JSONL processing
  3. Added real-time progress tracking using frappe.publish_realtime
  4. Improved webhook handling using GraphQL webhookSubscriptions
  5. Improved logging with clear PROCESS / COMPLETED / FAILED states
  6. Normalized the GraphQL Responses

Key Changes:

  1. Bulk product import tested with 20,000+ products without interruptions
  2. Product create/update handled via ProductSet mutation (variants, inventory, HSN, price)
  3. Inventory updates handled via inventorySetQuantities
  4. Safe product deletion across Shopify, Ecommerce Item, and ERP Item
  5. Added Shopify Bulk Sync Progress DocType for tracking long jobs
  6. Added Sales Return and Credit Note for orders return

Notes:

  1. Continuous long-queue testing is pending
  2. Variant-level deletion and some fulfillment status handling will be addressed in follow-up PRs
  3. Credit note creation is pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant