THIS IS A PREMIUM INTEGRATION
Prerequisites: This integrations is only available via consultation with your account manager. Please talk to your account manager if you would like to have this activated for your organisation. To enable the Shopify integration, you need to have created a Shopify store and added an app that can integrate with . Learning Pool support will guide you through this process.
Note: Neither test features are available for workflows using a Shopify trigger. This is because the Shopify integration does not use xAPI statements.
The Shopify integration adds the ability to trigger workflows based on events that happen in your Shopify store. For example, if someone buys access to a learning experience via Shopify, could then automatically enrol them in the corresponding learning experience in the LXP.
Preparing your LXs
-
Within your shopify store, create a single Shopify product per Learning Experience (LX)
-
Untick 'This is a physical product'
-
SKU is now a mandatory field when creating an item, potentially you could use the LX alias for this field, but any value would work.
-
Once the item is created it will generate a product id, this can be found in the address bar, it is usually a 13 digit number, unique for this product.
-
Navigate to Stream LXP admin and find the course you have created a Shopify Item for.
-
Navigate to settings which should show “External ref” with an empty field.
-
Populate that field with the product id from the shopify store, and then save.
Your LX experience is now linked to a shopify product.
Alert: Each learning experience must only be linked to one product and each product must only be linked to one learning experience.
Types of trigger
The Shopify integration comes with three types of trigger which will appear when you create a new workflow:
The triggers should be self-explanatory:
When an order is created |
This is triggered when an order is created. You can use it to automatically enrol users on the corresponding learning experiences in your LXP. |
When an order is cancelled |
This is triggered when an order is cancelled by an admin user or otherwise fails.
'Order Cancel' covers a wider ‘failure’ scenarios including:
You could, for example, use this trigger to get a notification when an order is unsuccessful order so you can then manually revoke access to any purchased LXs. |
When a refund is created |
Triggered when an admin creates a refund in your Shopify store. This trigger gives you a way to handle refunded orders. For example, you can get notified when a refund was made so you can then manually revoke access to purchased LXs. |
Enrolling a user that has bought a course via Automation
Prerequisite:
-
Shopify app created and successfully integrated.
-
Stream LXP successfully integrated.
-
At least one LX successfully linked to a shopify product.
-
Create a new workflow using the ‘When an order is created’ shopify trigger.
-
Add a condition workflow item, to check if there is an error retrieving the course. Set the variable to the global variable ‘Course Retrieval Error', and the operator to 'does exist’. If there is an error when the workflow is run, it will travel down the true path.
- On the false path from that condition item, add a ‘Create User’ workflow item.
-
Add the 'Enrol on learning experience' Workflow item
Example Workflow of Enrolling from an Order Created in Shopify
Revoking access when a refund or cancellation happened in Shopify
-
Create a new workflow using the ‘When an order is cancelled’ or 'When a refund is created' shopify trigger.
-
Notify the organisation's access administrator and/or shopify admin that a refund/cancellation was created using any of Automation's communication Workflow item (ie. Email, Slack, SMS, MS Teams)
- Offline/manual refunding process happens
Example Workflow of Access Revocation
When an order is cancelled
When a refund is created
As refunds are triggered by Shopify admins instead of customers themselves, this workflow is best used to notify than an admin refund has been done.
Additional variables
Workflows using the Shopify integration come with a long list of additional global variables that pull through a lot of information from Shopify (Click here to read more about how variables work in .) These can be used to locate or create new users in the LXP (click here to read more about creating new users) and to enrol them on the appropriate learning experience (click here to read more about enrolling learners on LXs.)
|
Additional outputs
When you add a Shopify trigger to a workflow you will see the option to add Outputs:
When an action in your Shopify store triggers a workflow, a JSON payload is sent to . Much of the information included in it are used to populate the global variables mentioned above, but you can use the Outputs to extract additional information using JSON dot notation.
Here's an example of the JSON payload sent to :
{
"id": 5295116091688,
"admin_graphql_api_id": "gid://shopify/Order/5295116091688",
"app_id": 580111,
"browser_ip": "82.10.180.123",
"buyer_accepts_marketing": false,
"cancel_reason": null,
"cancelled_at": null,
"cart_token": "14bfdc7642bdf0b1c36316b7725b512c",
"checkout_id": 36674445377832,
"checkout_token": "0b67f89c4336e566cb63363bd1d485c8",
"client_details": {
"accept_language": "en-GB",
"browser_height": null,
"browser_ip": "82.10.180.123",
"browser_width": null,
"session_hash": null,
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
},
"closed_at": null,
"confirmed": true,
"contact_email": "aran.bacall+demo6@learningpool.com",
"created_at": "2023-04-13T08:49:32+01:00",
"currency": "GBP",
"current_subtotal_price": "5254.00",
"current_subtotal_price_set": {
"shop_money": {
"amount": "5254.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "5254.00",
"currency_code": "GBP"
}
},
"current_total_additional_fees_set": null,
"current_total_discounts": "0.00",
"current_total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"current_total_duties_set": null,
"current_total_price": "5254.00",
"current_total_price_set": {
"shop_money": {
"amount": "5254.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "5254.00",
"currency_code": "GBP"
}
},
"current_total_tax": "0.00",
"current_total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"customer_locale": "en-GB",
"device_id": null,
"discount_codes": [],
"email": "aran.bacall+demo6@learningpool.com",
"estimated_taxes": false,
"financial_status": "paid",
"fulfillment_status": null,
"landing_site": "/73484435752/orders/f1722b34d601dca9c35657a6bb2e0b55",
"landing_site_ref": null,
"location_id": null,
"merchant_of_record_app_id": null,
"name": "#1158",
"note": null,
"note_attributes": [],
"number": 158,
"order_number": 1158,
"order_status_url": "https://the-store-the-merrier.myshopify.com/73484435752/orders/d9b0ca7c9714b4e4d8baf8cb304bb86e/authenticate?key=3cf374bb99a8601252b3347a189445e7",
"original_total_additional_fees_set": null,
"original_total_duties_set": null,
"payment_gateway_names": [
"bogus"
],
"phone": null,
"presentment_currency": "GBP",
"processed_at": "2023-04-13T08:49:31+01:00",
"reference": "8d0d7d3abffb7f37a402a5ad53417569",
"referring_site": "",
"source_identifier": "8d0d7d3abffb7f37a402a5ad53417569",
"source_name": "web",
"source_url": null,
"subtotal_price": "5254.00",
"subtotal_price_set": {
"shop_money": {
"amount": "5254.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "5254.00",
"currency_code": "GBP"
}
},
"tags": "",
"tax_lines": [],
"taxes_included": true,
"test": true,
"token": "d9b0ca7c9714b4e4d8baf8cb304bb86e",
"total_discounts": "0.00",
"total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"total_line_items_price": "5254.00",
"total_line_items_price_set": {
"shop_money": {
"amount": "5254.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "5254.00",
"currency_code": "GBP"
}
},
"total_outstanding": "0.00",
"total_price": "5254.00",
"total_price_set": {
"shop_money": {
"amount": "5254.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "5254.00",
"currency_code": "GBP"
}
},
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"total_tax": "0.00",
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2023-04-13T08:49:33+01:00",
"user_id": null,
"billing_address": {
"first_name": "Demo",
"address1": "Clockwise Offices. Riverhouse",
"phone": null,
"city": "Belfast",
"zip": "BT1 2BE",
"province": "Northern Ireland",
"country": "United Kingdom",
"last_name": "Six",
"address2": "48-60 High St",
"company": null,
"latitude": 54.600329,
"longitude": -5.926466599999999,
"name": "Demo Six",
"country_code": "GB",
"province_code": "NIR"
},
"customer": {
"id": 6933037482280,
"email": "aran.bacall+demo6@learningpool.com",
"accepts_marketing": false,
"created_at": "2023-04-13T08:49:31+01:00",
"updated_at": "2023-04-13T08:49:32+01:00",
"first_name": "Demo",
"last_name": "Six",
"state": "disabled",
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": null,
"email_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_updated_at": null
},
"sms_marketing_consent": null,
"tags": "",
"currency": "GBP",
"accepts_marketing_updated_at": "2023-04-13T08:49:31+01:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/6933037482280",
"default_address": {
"id": 9156824596776,
"customer_id": 6933037482280,
"first_name": "Demo",
"last_name": "Six",
"company": null,
"address1": "Clockwise Offices. Riverhouse",
"address2": "48-60 High St",
"city": "Belfast",
"province": "Northern Ireland",
"country": "United Kingdom",
"zip": "BT1 2BE",
"phone": null,
"name": "Demo Six",
"province_code": "NIR",
"country_code": "GB",
"country_name": "United Kingdom",
"default": true
}
},
"discount_applications": [],
"fulfillments": [],
"line_items": [
{
"id": 13813447688488,
"admin_graphql_api_id": "gid://shopify/LineItem/13813447688488",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "Non-Linked Shopify LX 6",
"price": "10.00",
"price_set": {
"shop_money": {
"amount": "10.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "10.00",
"currency_code": "GBP"
}
},
"product_exists": true,
"product_id": 8219165294888,
"properties": [],
"quantity": 1,
"requires_shipping": false,
"sku": null,
"taxable": false,
"title": "Non-Linked Shopify LX 6",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"variant_id": 44917392048424,
"variant_inventory_management": null,
"variant_title": null,
"vendor": "The Store, the Merrier",
"tax_lines": [],
"duties": [],
"discount_allocations": []
},
{
"id": 13813447721256,
"admin_graphql_api_id": "gid://shopify/LineItem/13813447721256",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "Double Linked Shopify LX 4 & 5",
"price": "10.00",
"price_set": {
"shop_money": {
"amount": "10.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "10.00",
"currency_code": "GBP"
}
},
"product_exists": true,
"product_id": 8219160576296,
"properties": [],
"quantity": 1,
"requires_shipping": false,
"sku": null,
"taxable": false,
"title": "Double Linked Shopify LX 4 & 5",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"variant_id": 44917364228392,
"variant_inventory_management": null,
"variant_title": null,
"vendor": "The Store, the Merrier",
"tax_lines": [],
"duties": [],
"discount_allocations": []
},
{
"id": 13813447754024,
"admin_graphql_api_id": "gid://shopify/LineItem/13813447754024",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "Linked Shopify LX 1",
"price": "1000.00",
"price_set": {
"shop_money": {
"amount": "1000.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "1000.00",
"currency_code": "GBP"
}
},
"product_exists": true,
"product_id": 8210695160104,
"properties": [],
"quantity": 1,
"requires_shipping": false,
"sku": "",
"taxable": false,
"title": "Linked Shopify LX 1",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"variant_id": 44880737272104,
"variant_inventory_management": null,
"variant_title": null,
"vendor": "The Store, the Merrier",
"tax_lines": [],
"duties": [],
"discount_allocations": []
},
{
"id": 13813447786792,
"admin_graphql_api_id": "gid://shopify/LineItem/13813447786792",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "Linked Shopify LX 2",
"price": "3000.00",
"price_set": {
"shop_money": {
"amount": "3000.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "3000.00",
"currency_code": "GBP"
}
},
"product_exists": true,
"product_id": 8210699026728,
"properties": [],
"quantity": 1,
"requires_shipping": false,
"sku": "",
"taxable": false,
"title": "Linked Shopify LX 2",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"variant_id": 44880749527336,
"variant_inventory_management": null,
"variant_title": null,
"vendor": "The Store, the Merrier",
"tax_lines": [],
"duties": [],
"discount_allocations": []
},
{
"id": 13813447819560,
"admin_graphql_api_id": "gid://shopify/LineItem/13813447819560",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "Linked Shopify LX 3",
"price": "1234.00",
"price_set": {
"shop_money": {
"amount": "1234.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "1234.00",
"currency_code": "GBP"
}
},
"product_exists": true,
"product_id": 8210700501288,
"properties": [],
"quantity": 1,
"requires_shipping": false,
"sku": "",
"taxable": false,
"title": "Linked Shopify LX 3",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "GBP"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "GBP"
}
},
"variant_id": 44880754606376,
"variant_inventory_management": null,
"variant_title": null,
"vendor": "The Store, the Merrier",
"tax_lines": [],
"duties": [],
"discount_allocations": []
}
],
"payment_terms": null,
"refunds": [],
"shipping_address": null,
"shipping_lines": []
}
If, for example, you wanted to save the user's IP address to a custom variable called "Browser IP", you would configure the trigger like this: