enhancementgood first issueintegrationnew-featurenew-integration
Métriques du dépôt
- Stars
- (1 930 étoiles)
- Métriques de merge PR
- (Métriques PR en attente)
Description
Description
Add Shopify integration to sync e-commerce data including orders, products, customers, inventory, and store analytics into CORE.
Reference Implementations
Existing Integrations (use as templates)
integrations/github/- OAuth-based API integrationintegrations/linear/- Project management integrationintegrations/slack/- For reference
Required Files Structure
integrations/shopify/
├── src/
│ ├── index.ts # Main entry, OAuth spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # Shopify Admin API utilities
│ ├── account-create.ts # OAuth setup
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
Shopify Admin API Integration
OAuth Setup
- Use OAuth 2.0 Authorization Code flow
- Register app on Shopify Partners dashboard
- API Version: 2026-01 (latest)
- Supports both REST and GraphQL Admin APIs
- Required scopes:
read_orders,read_products,read_customers,read_inventory,read_analytics,read_fulfillments - Base URL:
https://{store}.myshopify.com/admin/api/2026-01/
Key Endpoints (REST)
GET /orders.json- List ordersGET /orders/{id}.json- Get order detailsGET /products.json- List productsGET /products/{id}.json- Get product detailsGET /customers.json- List customersGET /inventory_levels.json- Inventory levelsGET /fulfillments.json- Fulfillment statusGET /webhooks.json- List registered webhooks
Key Endpoints (GraphQL)
POST /graphql.json- All GraphQL queries (recommended by Shopify)orders- Query orders with filteringproducts- Query products and variantscustomers- Query customer datainventoryItems- Query inventory
Events to Track
- Orders - New orders, fulfillments, cancellations, refunds
- Products - Product creation, updates, inventory changes
- Customers - New customers, profile updates, account events
- Inventory - Stock level changes, restock events
- Fulfillments - Shipping updates, delivery confirmations
- Analytics - Sales trends, conversion metrics
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement Shopify OAuth 2.0 flow in
account-create.ts - Create API utilities in
utils.tsfor orders, products, customers, and inventory - Implement sync logic in
schedule.tswith webhook support for real-time events - Convert e-commerce events to CORE activity format
- Add error handling and rate limiting (40 requests/min for REST, cost-based for GraphQL)
- Create integration documentation
- Add to
integrations/README.md
Technical Notes
- Shopify strongly recommends GraphQL over REST for new integrations
- REST rate limit: 40 requests per app per store per minute
- GraphQL uses a cost-based rate limiting system
- API is versioned (e.g., 2026-01); old versions are deprecated on a rolling basis
- Webhooks available for real-time event notifications (orders, products, customers, etc.)
- Consider using Shopify's official Node.js library:
@shopify/shopify-api
Resources
- REST Admin API Reference
- GraphQL Admin API Reference
- Shopify Developer Documentation
- Shopify API Node.js Library
Labels
enhancement, integration, new-feature