Shopify Integration Documentation for Vantage
Overview
The Shopify integration within the Vantage analytics and data platform allows users to connect and interact with their Shopify stores directly. Through this component, users can retrieve information about products, orders, and inventory levels, enabling them to leverage their sales data for analytical purposes or operational enhancements.
Settings
1. shopDomain
- Input Type: String
- Description: The domain of the Shopify store. This is the unique identifier for the shop and is used as part of the API requests to specify which store the integration should interact with.
- Impact of Change: Changing the value will point the integration to a different Shopify store. Ensure the new shop domain corresponds to an existing store with the appropriate access rights.
- Default Value: None (must be provided during initialization).
2. accessToken
- Input Type: String
- Description: An OAuth access token that provides authenticated access to the Shopify API on behalf of the shop. It's crucial for making API requests securely.
- Impact of Change: If this token is updated or invalidated, the integration will not be able to access data from Shopify until a valid token is provided.
- Default Value: None (must be provided during initialization).
3. limit
- Input Type: Numeric
- Description: This parameter controls the number of results returned for product and order requests. The default is set to 50, which is generally acceptable for pagination.
- Impact of Change: Increasing the limit allows for more records to be fetched in one request, which can reduce the number of API calls but may impact performance for very large datasets.
- Default Value: 50
4. status
- Input Type: String
- Description: For both products and orders, this setting specifies their status. For products, it can be 'active' or 'inactive'; for orders, it may represent various order states.
- Impact of Change: Changing the status allows for filtering data based on active or inactive products and the various states of orders. This is crucial for data analysis focusing on particular subsets.
- Default Value: 'active' for products, 'open' for orders.
5. vendor
- Input Type: String or Null
- Description: This optional setting refers to the vendor or supplier of specific products. It can be used to filter products by vendor.
- Impact of Change: Specifying a vendor will return only products associated with that vendor, allowing for targeted analysis of product performance.
- Default Value: null (no vendor filter).
6. product_type
- Input Type: String or Null
- Description: Similar to the vendor, this optional parameter filters the returned products based on the defined product type.
- Impact of Change: Adjusting this filter will let users retrieve only those products pertaining to a specific category, which is essential for market analysis.
- Default Value: null (no product type filter).
7. financial_status
- Input Type: String or Null
- Description: This optional parameter allows filtering orders based on their financial status, such as paid, pending, or refunded.
- Impact of Change: Modifying this setting will affect which orders are retrieved, providing insight into financial metrics for selected orders.
- Default Value: null (no financial status filter).
8. fulfillment_status
- Input Type: String or Null
- Description: Similar to financial_status, this parameter allows users to filter orders by their fulfillment status, such as shipped, unshipped, or partially shipped.
- Impact of Change: By changing this setting, users can focus on orders that require attention, such as those yet to be fulfilled.
- Default Value: null (no fulfillment status filter).
9. inventory_item_ids
- Input Type: Array (of strings)
- Description: This parameter allows the input of specific inventory item IDs to query their inventory levels.
- Impact of Change: Providing a list of inventory item IDs will return the inventory levels only for those specified items, enabling detailed inventory tracking.
- Default Value: [] (an empty array, which will cause no specific items to be fetched).
How It Works
The Shopify integration inherits functionalities from the the base integration class and encapsulates methods to interact with Shopify's REST API. Upon instantiation, it initializes with the provided credentials, specifically the shopDomain and accessToken.
Key functions include:
- authorize(): Configures the request to include necessary headers for authentication when making API calls.
- testConnection(): Performs a basic connectivity check with the Shopify store by sending a request to access the store's information.
- getProducts(): Retrieves product data based on configurable filters such as limit, status, vendor, and product type.
- getOrders(): Fetches order data filtered by limit, financial status, and fulfillment status.
- getInventoryLevels(): Acquires inventory levels for specified inventory item IDs.
Use Cases & Examples
Use Case 1: E-commerce Reporting
A business uses Vantage to generate sales reports from their Shopify store. They configure the Shopify integration to pull data on active products to analyze sales performance by product type.
Example Configuration:
{
"shopDomain": "myshop.myshopify.com",
"accessToken": "shpat_12345",
"limit": 100,
"status": "active",
"product_type": "lifestyle"
}Use Case 2: Inventory Management
A store owner wishes to monitor inventory levels for specific products to prevent stockouts and manage restocking processes efficiently.
Example Configuration:
{
"shopDomain": "mystore.myshopify.com",
"accessToken": "shpat_67890",
"inventory_item_ids": ["123456789", "987654321"]
}Use Case 3: Order Fulfillment Optimization
A fulfillment manager needs to filter open orders that are unshipped to better allocate picking resources.
Example Configuration:
{
"shopDomain": "shopdemo.myshopify.com",
"accessToken": "shpat_112233",
"limit": 50,
"status": "open",
"fulfillment_status": "unshipped"
}Important Considerations
- Ensure that the access token has the necessary permissions to access the required data.
- Consider the Shopify API rate limits when configuring batch data retrieval to avoid hitting the thresholds too quickly.
- Depending on Shopify's API changes, adjust the integration as necessary to accommodate new features or endpoints.
In conclusion, the Shopify integration within Vantage offers businesses significant capabilities to harness their e-commerce data for informed decision-making and enhanced operational efficiency.