{"info":{"_postman_id":"14276246-0554-4fcd-b9cc-0ec88ac447fc","name":"[V2-NEW]Shopflo Checkout Integration with Shopify","description":"<html><head></head><body><p>This document describes the integration process with shopflo checkout.</p>\n<h3 id=\"prerequisites\">Prerequisites:</h3>\n<ul>\n<li>Shopflo custom app to be present on Shopify Store</li>\n</ul>\n<h4 id=\"shopflo--shopify-integration-flow\">Shopflo &lt;&gt; Shopify Integration flow:</h4>\n<img src=\"https://content.pstmn.io/dc7300f8-0da9-40ad-b8b7-99db53be79db/V2hhdHNBcHAgSW1hZ2UgMjAyMi0xMC0xOSBhdCAxLjU2LjQ1IFBNLmpwZWc=\">\n\n<h4 id=\"shopflo-in-app-checkout-flow\">Shopflo In app Checkout Flow:</h4>\n<img src=\"https://content.pstmn.io/f7180d61-7c33-43eb-8ae4-f2194f06898d/U2NyZWVuc2hvdCAyMDIyLTEwLTE5IGF0IDIuMjkuMTggUE0ucG5n\"></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"24352092","collectionId":"14276246-0554-4fcd-b9cc-0ec88ac447fc","publishedId":"2sB3dWsSPH","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-12-22T08:55:55.000Z"},"item":[{"name":"Token API","item":[{"name":"Create Checkout Token V2","id":"987d51d1-f376-45a9-a09f-8d023da43889","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"your_key_generated_by_brand","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"sf_session_id\": \"d84aed9f-9029-4ab7-ba43-ef2648be1212s\", \n    \"items\": [\n        {\n            \"id\": \"43497948545272\", \n            \"quantity\": 2, \n            \"name\": \"Minoxidil 5%\", \n            \"product_name\": \"Minoxidil 5%\", \n            \"variant_name\": \"M\", \n            \"price\": 650, \n            \"sku\": \"CCSCC\", \n            \"product_id\": \"89098989989\", \n            \"image\": \"https://cdn.shopify.com/s/files/1/0646/4362/9304/products/FreeSatinPillowcase-24thOctober_1.png?v=1669719330\", \n            \"properties\": { \n                \"key\": \"value\"\n            },\n            \"images\": [\n                \"url1\",\n                \"url2\"\n            ], \n            \"line_price\": {\n                \"total\": \"499.00\", \n                \"sub_total\": \"699.00\", \n                \"discounts\": [\n                    { \n                        \"code\": \"discount1\",\n                        \"amount\": \"75.00\" \n                    },\n                    {\n                        \"code\": \"discount2\",\n                        \"amount\": \"25.00\"\n                    }\n                ],\n                \"tax\": { \n                    \"amount\": \"50.00\",\n                    \"included\": true\n                }\n            }\n        },\n        {\n            \"id\": \"43497948545272\", \n            \"quantity\": 2, \n            \"name\": \"Minoxidil 5%\", \n            \"product_name\": \"Minoxidil 5%\", \n            \"variant_name\": \"M\", \n            \"price\": 650, \n            \"sku\": \"CCSCC\", \n            \"product_id\": \"89098989989\", \n            \"image\": \"https://cdn.shopify.com/s/files/1/0646/4362/9304/products/FreeSatinPillowcase-24thOctober_1.png?v=1669719330\", \n            \"properties\": { \n                \"key\": \"value\"\n            },\n            \"images\": [\n                \"url1\",\n                \"url2\"\n            ], \n            \"line_price\": {\n                \"total\": \"499.00\", \n                \"sub_total\": \"699.00\", \n                \"discounts\": [\n                    { \n                        \"code\": \"discount1\",\n                        \"amount\": \"75.00\" \n                    },\n                    {\n                        \"code\": \"discount2\",\n                        \"amount\": \"25.00\"\n                    }\n                ],\n                \"tax\": { \n                    \"amount\": \"50.00\",\n                    \"included\": true\n                }\n            }\n        }\n    ],\n    \"ui_config\": { \n        \"layout\": {\n            \"available_elements\": [\n                \"HEADER\",\n                \"ORDER_SUMMARY\",\n                \"COUPON_INPUT\",\n                \"COUPON_LIST\"\n            ],\n            \"metadata\": {\n                \"is_order_summary_open\": true\n            }\n        }\n    },\n    \"customer\": { \n        \"authentication\": {\n            \"shop_storefront_token\": \"6c075625379da82c0d788345a048f2bb\",\n            \"platform\": \"SHOPIFY_STOREFRONT\",\n            \"user_token\": \"dc58c5a09d4a3329e0ec734d3c730f31\"\n        }\n    },\n    \"discounts\": [ \n        {\n            \"type\": \"CODE\",\n            \"code\": \"XYZ\"\n        },\n        {\n            \"type\": \"CUSTOM_DISCOUNT\", \n            \"code\": \"discount1\",\n            \"title\": \"Discount title\",\n            \"amount\": \"300.00\",\n            \"is_stackable\": true,\n            \"is_removable\": true,\n            \"is_auto_applied\": false\n        },\n        {\n            \"type\": \"CUSTOM_DISCOUNT\",\n            \"code\": \"discount2\",\n            \"title\": \"Discount title\",\n            \"amount\": \"100.00\",\n            \"is_stackable\": true,\n            \"is_removable\": true,\n            \"is_auto_applied\": false\n        }\n    ],\n    \"tags\": [\n        \"shopflo\",\n        \"test\",\n        \"your_identifier\"\n    ], \n    \"note_attributes\": [ \n        {\n            \"name\": \"name1\",\n            \"value\": \"value1\"\n        },\n        {\n            \"name\": \"name2\",\n            \"value\": \"value2\"\n        }\n    ],\n    \"payment_config\": { \n        \"allowed_modes\": [\n            \"UPI\",\n            \"COD\",\n            \"REWARDS_WALLET\",\n            \"BHARATX\"\n        ]\n    },\n    \"back_url\": \"https://yourstore.com/where_you_came_from\", \n    \"success_url\": \"https://yourstore.com/thank_you_page?your_var1=your_value1&{checkout_id}&{platform_order_id}\" \n}"},"url":"https://api.shopflo.co/kratos/api/v2/token","description":"<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>sf_session_id</td>\n<td>[Mandatory] String</td>\n<td>Session id of the user entering checkout</td>\n</tr>\n<tr>\n<td>customer.authentication.token</td>\n<td>[Optional] String</td>\n<td>Authentication token for customer, eg: Storefront access token(For shopify SF token only users with mobile number in shopify will be logged in)</td>\n</tr>\n<tr>\n<td>customer.authentication.platform</td>\n<td>[Optional] String</td>\n<td>Platform for customer authentication token, presently supports \"SHOPIFY_STOREFRONT\"</td>\n</tr>\n<tr>\n<td>ui_config</td>\n<td>[Optional] Object</td>\n<td>Config to alter ui of the checkout, eg:  <br />{  <br />\"layout\": {  <br />\"available_elements\": [  <br />\"HEADER\",  <br />\"ORDER_SUMMARY\",  <br />\"COUPON_INPUT\",  <br />\"COUPON_LIST\"  <br />],  <br />\"metadata\": {  <br />\"is_order_summary_open\": true  <br />}  <br />}  <br />}</td>\n</tr>\n<tr>\n<td>items</td>\n<td>[Mandatory] Array of item object</td>\n<td>Array of items to be used for checkout</td>\n</tr>\n<tr>\n<td>back_url</td>\n<td>[Mandatory] String</td>\n<td>This will be the url where user will be taken when they decide to exit checkout</td>\n</tr>\n<tr>\n<td>payment config</td>\n<td>[Optional] Object</td>\n<td>This is used in case selective payment methods must be displayed for a particular checkout instance.</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Structure of Item Object:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id</td>\n<td>String</td>\n<td>Variant Id of the item selected for checkout</td>\n</tr>\n<tr>\n<td>quantity</td>\n<td>Number</td>\n<td>Quantity of item selected</td>\n</tr>\n<tr>\n<td>line_price.sub_total</td>\n<td>String</td>\n<td>Price of individual variant of the item</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["kratos","api","v2","token"],"host":["api","shopflo","co"],"query":[],"variable":[]}},"response":[{"id":"ac8b3198-0b7f-456f-8643-3949106151fe","name":"Create Checkout Token V2","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"your_key_generated_by_brand","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"sf_session_id\": \"d84aed9f-9029-4ab7-ba43-ef2648be1212s\", // your unique session id for analytics aggregation\n    \"items\": [\n        {\n            \"id\": \"43497948545272\", //mandatory\n            \"quantity\": 2, //mandatory\n            \"name\": \"Minoxidil 5%\", //mandatory\n            \"product_name\": \"Minoxidil 5%\", //mandatory\n            \"variant_name\": \"M\", //mandatory\n            \"price\": 650, //mandatory\n            \"sku\": \"CCSCC\", //mandatory\n            \"product_id\": \"89098989989\", //mandatory\n            \"image\": \"https://cdn.shopify.com/s/files/1/0646/4362/9304/products/FreeSatinPillowcase-24thOctober_1.png?v=1669719330\", //mandatory\n            \"properties\": { //optional\n                \"key\": \"value\"\n            },\n            \"images\": [\n                \"url1\",\n                \"url2\"\n            ], //optional\n            \"line_price\": {\n                \"total\": \"499.00\", //optional\n                \"sub_total\": \"699.00\", //mandatory\n                \"discounts\": [\n                    { //optional and pass the line level attribution for checkout UI line item price strike through otherwise passing global discount objects is enough\n                        \"code\": \"discount1\",\n                        \"amount\": \"75.00\" // pass per quantity value here and if the discount * quantity is not summing up to the global discount object total then an exception will be raised\n                    },\n                    {\n                        \"code\": \"discount2\",\n                        \"amount\": \"25.00\"\n                    }\n                ],\n                \"tax\": { //optional\n                    \"amount\": \"50.00\",\n                    \"included\": true\n                }\n            }\n        },\n        {\n            \"id\": \"43497948545272\", //mandatory\n            \"quantity\": 2, //mandatory\n            \"name\": \"Minoxidil 5%\", //mandatory\n            \"product_name\": \"Minoxidil 5%\", //mandatory\n            \"variant_name\": \"M\", //mandatory\n            \"price\": 650, //mandatory\n            \"sku\": \"CCSCC\", //mandatory\n            \"product_id\": \"89098989989\", //mandatory\n            \"image\": \"https://cdn.shopify.com/s/files/1/0646/4362/9304/products/FreeSatinPillowcase-24thOctober_1.png?v=1669719330\", //mandatory\n            \"properties\": { //optional\n                \"key\": \"value\"\n            },\n            \"images\": [\n                \"url1\",\n                \"url2\"\n            ], //optional\n            \"line_price\": {\n                \"total\": \"499.00\", //optional\n                \"sub_total\": \"699.00\", //mandatory\n                \"discounts\": [\n                    { //optional and pass the line level attribution for checkout UI line item price strike through otherwise passing global discount objects is enough\n                        \"code\": \"discount1\",\n                        \"amount\": \"75.00\" // pass per quantity value here and if the discount * quantity is not summing up to the global discount object total then an exception will be raised\n                    },\n                    {\n                        \"code\": \"discount2\",\n                        \"amount\": \"25.00\"\n                    }\n                ],\n                \"tax\": { //optional\n                    \"amount\": \"50.00\",\n                    \"included\": true\n                }\n            }\n        }\n    ],\n    \"ui_config\": { //optional\n        \"layout\": {\n            \"available_elements\": [\n                \"HEADER\",\n                \"ORDER_SUMMARY\",\n                \"COUPON_INPUT\",\n                \"COUPON_LIST\"\n            ],\n            \"metadata\": {\n                \"is_order_summary_open\": true\n            }\n        }\n    },\n    \"customer\": { //optional\n        \"authentication\": {\n            \"shop_storefront_token\": \"6c075625379da82c0d788345a048f2bb\",\n            \"platform\": \"SHOPIFY_STOREFRONT\",\n            \"user_token\": \"dc58c5a09d4a3329e0ec734d3c730f31\"\n        }\n    },\n    \"discounts\": [ //optional\n        {\n            \"type\": \"CODE\",\n            \"code\": \"XYZ\"\n        },\n        {\n            \"type\": \"CUSTOM_DISCOUNT\", //   Pass this for your custom discounts and this is mandatory if the line item level discounts are passed\n            \"code\": \"discount1\",\n            \"title\": \"Discount title\",\n            \"amount\": \"300.00\",\n            \"is_stackable\": true,\n            \"is_removable\": true,\n            \"is_auto_applied\": false\n        },\n        {\n            \"type\": \"CUSTOM_DISCOUNT\",\n            \"code\": \"discount2\",\n            \"title\": \"Discount title\",\n            \"amount\": \"100.00\",\n            \"is_stackable\": true,\n            \"is_removable\": true,\n            \"is_auto_applied\": false\n        }\n    ],\n    \"tags\": [\n        \"shopflo\",\n        \"test\",\n        \"your_identifier\"\n    ], // optional and will be forwarded in downstream order\n    \"note_attributes\": [ // optional and will be forwarded in downstream order\n        {\n            \"name\": \"name1\",\n            \"value\": \"value1\"\n        },\n        {\n            \"name\": \"name2\",\n            \"value\": \"value2\"\n        }\n    ],\n    \"payment_config\": { //optional object, send it when its requried to show certain payment options\n        \"allowed_modes\": [\n            \"UPI\",\n            \"COD\",\n            \"REWARDS_WALLET\",\n            \"BHARATX\"\n        ]\n    },\n    \"back_url\": \"https://yourstore.com/where_you_came_from\", //      This will be the url where user will be taken when they decide to exit checkout\n    \"success_url\": \"https://yourstore.com/thank_you_page?your_var1=your_value1&{checkout_id}&{platform_order_id}\" // this parameter is not needed to be sent if you are using Shopify thank you page for order confirmation \n}","options":{"raw":{"language":"json"}}},"url":"https://api.shopflo.co/kratos/api/v2/token"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 26 Dec 2022 10:43:39 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"218"},{"key":"Connection","value":"keep-alive"},{"key":"server","value":"gunicorn"},{"key":"apigw-requestid","value":"dwAiPhapBcwEPsg="},{"key":"vary","value":"Accept"},{"key":"allow","value":"POST, PUT, PATCH, GET, DELETE, OPTIONS, HEAD"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"token_id\": \"fcec066f-a652-4f48-9128-6a12e9dade6e\",\n        \"checkout_url\": \"https://checkout.shopflo.com/?tokenId=fcec066f-a652-4f48-9128-6a12e9dade6e&auth=c81c1516-81b9-4d50-aa08-cdc61876757c\",\n        \"application_id\": \"bacb1287-80b2-4a8e-93d4-8fa75726e12f\"\n    }\n}"}],"_postman_id":"987d51d1-f376-45a9-a09f-8d023da43889"}],"id":"282d9eda-28e5-40f9-8907-d398458e2570","description":"<h3 id=\"steps-to-integrate-shopflo-on-custom-websites\"><strong>Steps to Integrate Shopflo on Custom Websites:</strong></h3>\n<h5 id=\"1-install-shopflo-script-on-your-website\"><strong>1. Install Shopflo Script on your website:</strong></h5>\n<ul>\n<li><p>Add the following script in the head tag of root file so that SDK is installed on the website</p>\n</li>\n<li><p>Get the merchant id from Shopflo team and put in place of</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>&lt;script&gt;\n    (function (f, l, o, j, s, d, k) {\n        f[o] = f[o] || { m_id: s };\n        d = l.createElement(j); d.async = 1; d.src = \"https://bridge.shopflo.com/v2/shopflo.js\";\n        k = l.getElementsByTagName(j)[0]; k.parentNode.insertBefore(d, k);\n    })(window, document, \"Shopflo\", \"script\", &lt;shopflo_merchant_key&gt;)\n&lt;/script&gt;\n\n</code></pre><blockquote>\n<p>It is important to put the script in root file so that SDK can be called from any page<br />If the script doesn’t load on first page load - UTM attribution will be incorrect </p>\n</blockquote>\n<h5 id=\"2-creating-checkout-using-shopflo-token-api-v2\"><strong>2. Creating checkout using Shopflo Token API v2</strong></h5>\n<ul>\n<li>Fetch sessionId from the shopflo SDK, the session Id is valid for 30 mins</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Shopflo.getSessionId()\n\n</code></pre><blockquote>\n<p>For correct session and conversion funnel tracking, sessionId is an important parameter. </p>\n</blockquote>\n<ul>\n<li>Pass the session Id along with others parameters required for the Token API to your backend to create token (<a href=\"https://documenter.getpostman.com/view/18622847/Uze1xQoK#e4f96eaa-2703-48e4-8ca9-38ec9fa30507\">document here</a>)</li>\n</ul>\n<blockquote>\n<p>The token API should be called from the application backend to ensure data security </p>\n</blockquote>\n<h5 id=\"3-opening-shopflo-checkout\"><strong>3. Opening Shopflo checkout</strong></h5>\n<ul>\n<li><p>The token API will return checkout URL that you can pass to the SDK to invoke the checkout.</p>\n</li>\n<li><p>Checkout will open in an iFrame if the browser supports third party cookies. Otherwise, this will redirect to new page to Shopflo domain.</p>\n</li>\n<li><p>GA/FB and other downstream events are also taken care of by Shopflo checkout (Ensure that you’ve set these up correctly in the <a href=\"https://dashboard.shopflo.co/\">Shopflo dashboard</a> for it to work)</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Shopflo.openFloCheckout(checkout_url) // checkout_url is the url returned by token API\n\n</code></pre><h5 id=\"4-verifying-the-shopflo-checkout-installation\">4. Verifying the Shopflo checkout installation</h5>\n<ul>\n<li><p>Verify the flow of following information from cart to checkout is correct:</p>\n<ul>\n<li><p>Item prices</p>\n</li>\n<li><p>Cart price</p>\n</li>\n<li><p>Product variant and images</p>\n</li>\n<li><p>Cart discounts</p>\n</li>\n<li><p>Freebies with strike-through amounts and cart value</p>\n</li>\n</ul>\n</li>\n<li><p>Also place some test orders to test your payment gateway integrations</p>\n<ul>\n<li><p>Through all payment methods</p>\n</li>\n<li><p>If there are more than 1 PG setup, place orders with all these PGs</p>\n</li>\n</ul>\n</li>\n<li><p>Once this is done, verify that Shopflo checkout is being initialized from all buttons on the website</p>\n<ul>\n<li><p>Product Buy now buttons</p>\n</li>\n<li><p>Cart Page</p>\n</li>\n<li><p>Side cart (if any)</p>\n</li>\n<li><p>Any other buttons that initiate checkout</p>\n</li>\n</ul>\n</li>\n</ul>\n<h5 id=\"5-app-only-back-button-support\">5. [App Only] Back button support</h5>\n<p>To enhance the user experience by enabling back button support during app checkouts, it's essential to implement custom handling within the app. This process involves incorporating a <code>back_url</code> parameter into the token api payload. The URL should be structured to facilitate user navigation, such as <code>www.yourwebsite.com/cart?action=backToCart</code>.</p>\n<p>Upon triggering this URL, your application should employ a regular expression (regex) to identify when the webview is engaged in a back action. Following this detection, the app should then execute code to close the webview, thereby aligning with the user's expectation of the back button's functionality. Below is an example of how this can be implemented in your application's code in react native webview:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">const { url } = navState;\nif (url.endsWith(\"action=backToCart\")) {\n  closeWebview();\n}\n\n</code></pre>\n","_postman_id":"282d9eda-28e5-40f9-8907-d398458e2570"},{"name":"Shopflo Event","item":[{"name":"Shopflo Event for UTM Tracking","id":"0c4e9c1b-a9ea-4fd9-8a32-aa02fda1b1d7","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true,"content-length":true,"host":true,"user-agent":true,"accept":true,"accept-encoding":true,"connection":true}},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"eventName\": \"store_page_view\",\n    \"sessionId\": \"94abf541-aa12-4ec6-9df3-c0f1asdas0dfe1c\",\n    \"timestamp\": 1683116344749,\n    \"merchantId\": \"asdad-1261-4205-aed7-bd87f9eee7b8\",\n    \"eventPayload\": {\n        \"uiData\": {\n            \"longSessionId\": \"asdad-1234-40sad-aed7-bd87f9eee7b8\",\n            \"pageUrl\": \"https://xyz.com/pages/activewear?utm_source=google&utm_medium=cpc&utm_campaign=XYZ&utm_term=xyz&utm_content=Brand_Exact&gclid=CjwKCAjwjMiiBhA4EiwAZe6jQ5LKByWgx6O12CTA2qZagf8A4xv3vP5h0oAlbyU-P7clLAXq21JkuBoCle4QAvD_BwE\",\n            \"pageTitle\": \"XYZ\",\n            \"pagePath\": \"/pages/activewear\",\n            \"utmParams\": [\n                {\n                    \"name\": \"utm_source\",\n                    \"value\": \"google\"\n                },\n                {\n                    \"name\": \"utm_medium\",\n                    \"value\": \"cpc\"\n                },\n                {\n                    \"name\": \"utm_campaign\",\n                    \"value\": \"Search_Campaigns_The_XYZ_Brand\"\n                },\n                {\n                    \"name\": \"utm_term\",\n                    \"value\": \"xyz\"\n                },\n                {\n                    \"name\": \"utm_content\",\n                    \"value\": \"Brand_Exact\"\n                },\n                {\n                    \"name\": \"gclid\",\n                    \"value\": \"CjwKCAjwjMiiBhA4EiwAZe6jQ5LKByWgx6O12CTA2qZagf8A4xv3vP5h0oAlbyU-P7clLAXq21JkuBoCle4QAvD_BwE\"\n                }\n            ],\n            \"landingPageUrl\": \"/pages/activewear\"\n        }\n    },\n    \"eventType\": \"load\"\n}"},"url":"https://hits.shopflo.com/api/v1/spark","description":"<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>eventName</td>\n<td>String</td>\n<td>Name of the event to be sent, going to be \"store_page_view\" for tracking UTMs</td>\n</tr>\n<tr>\n<td>sessionId</td>\n<td>UUID</td>\n<td>Unique session ID for the user, this is required to be the same as being pass to Token API</td>\n</tr>\n<tr>\n<td>timestamp</td>\n<td>String</td>\n<td>Timing</td>\n</tr>\n<tr>\n<td>merchantId</td>\n<td>UUID</td>\n<td>Merchant Id of each</td>\n</tr>\n<tr>\n<td>eventType</td>\n<td>String</td>\n<td>\"load\"</td>\n</tr>\n<tr>\n<td>landingPageUrl</td>\n<td>String</td>\n<td>page where the user laned without query parameters</td>\n</tr>\n<tr>\n<td>eventPayload.uiData.longSessionId</td>\n<td>String</td>\n<td>Unique Long Session ID for the user</td>\n</tr>\n<tr>\n<td>eventPayload.uiData.pageUrl</td>\n<td>String (optional)</td>\n<td>URL of the page where the event isbeing fired from</td>\n</tr>\n<tr>\n<td>eventPayload.uiData.pageTitle</td>\n<td>String (optional)</td>\n<td>title of the page where the event is being fired from</td>\n</tr>\n<tr>\n<td>eventPayload.uiData.pagePath</td>\n<td>String (optional)</td>\n<td>Path of the page where the event is being fired from</td>\n</tr>\n<tr>\n<td>eventPayload.uiData.utmParams</td>\n<td>Array of name,value object</td>\n<td>Ex:  <br />{  <br />\"name\": \"utm_source\",  <br />\"value\": \"google\"  <br />}  <br />Allowed names: utm_source, utm_medium, utm_campaign, utm_term, utm_content,</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","v1","spark"],"host":["hits","shopflo","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"0c4e9c1b-a9ea-4fd9-8a32-aa02fda1b1d7"}],"id":"e66d0b97-edda-4176-8fdd-22f1ae49b68f","description":"<h2 id=\"troubleshooting-utm-params\">Troubleshooting UTM Params</h2>\n<p>If you are not using Shopflo SDK while using the Token API there would be two additional steps needed to make sure UTM data is passed on to our backend.</p>\n<ol>\n<li><p><strong>Generate session ID on the frontend:</strong><br /> Session ID is needed to map the user journey in the shopflo Infrastructure. Generate a unique Session ID on the frontend, this can be done with the help of libraries like UUID generator (<a href=\"https://www.npmjs.com/package/uuid\">https://www.npmjs.com/package/uuid</a>). The expiry duration for session id is 30 minutes. Hence, for any checkouts being initiated by that user in a 30 minute window will have same session id until expiry.</p>\n</li>\n<li><p><strong>Trigger Shopflo Event to map session with utm parameters:</strong><br /> Get all the UTM parameters and trigger Shopflo Page View event. This will map the session with UTM parameters and this can be used for attribution.</p>\n</li>\n</ol>\n<p><strong>Note:</strong> The utm tracking is taken care by the Shopflo SDK on web if the session id on website and token API matches</p>\n","_postman_id":"e66d0b97-edda-4176-8fdd-22f1ae49b68f"}],"event":[{"listen":"prerequest","script":{"id":"af795bf0-4184-4c16-99f0-9651dc9fc9dc","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"2739d03d-884c-4b9b-9ae7-85cb66bf086c","type":"text/javascript","exec":[""]}}],"variable":[{"id":"17eab51a-1e94-4671-8cfb-bcfff76d5335","key":"env","value":"api"}]}