{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Shopify Export Integration CLI","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"shopify-export-integration-cli","__idx":0},"children":["Shopify Export Integration CLI"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can export data results from TD to Shopify using CLI (TD Toolbelt)."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This feature is in BETA version. For more information, contact your Customer Success Representative."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/td-toolbelt"},"children":["TD Toolbelt"]}," is installed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Shopify and Shopify credentials."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limitations","__idx":2},"children":["Limitations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The query result must match require columns(name & data type) with resource type"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Action"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Resource"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Column require"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Query"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[metafield_id: Integer, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT metafield_id, value FROM table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shop"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT key, namespace, value FROM table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Product"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[product_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT product_id, key, namespace, value FROM table ORDER BY product_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Product Variant"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[variant_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT variant_id, key, namespace, value FROM table ORDER BY variant_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Product Image"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[product_id: Integer, image_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT product_id, image_id, key, namespace, value FROM table ORDER BY product_id, image_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom Collection"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[custom_collection_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT custom_collection_id, key, namespace, value FROM table ORDER BY custom_collection_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Smart Collection"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[smart_collection_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT smart_collection_id, key, namespace, value FROM table ORDER BY smart_collection_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[customer_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT customer_id, key, namespace, value FROM table ORDER BY customer_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Order"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[order_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT order_id, key, namespace, value FROM table ORDER BY order_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Draft Order"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[draft_order_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT draft_order_id, key, namespace, value FROM table ORDER BY draft_order_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Blog"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[blog_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT blog_id, key, namespace, value FROM table ORDER BY blog_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Article"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[blog_id: Integer, article_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT blog_id, article_id, key, namespace, value FROM table ORDER BY blog_id, article_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Page"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["[page_id: Integer, key: String, namespace: String, value: any]"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SELECT page_id, key, namespace, value FROM table ORDER BY page_id"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Please use ORDER BY to increase performance"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"using-the-command-line-to-create-your-connection","__idx":3},"children":["Using the Command Line to Create Your Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the CLI to configure your connection."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query --database your_database \n--result configuration query\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table identifies the configuration keys with descriptions."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Config Key"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-the-treasure-data-toolbelt","__idx":4},"children":["Install the Treasure Data Toolbelt"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open a terminal and run the following command to install the newest ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["Treasure Data Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuration keys and descriptions are as follows:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"Config Key"},"children":["Config Key "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"15%","data-label":"Type"},"children":["Type "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"15%","data-label":"Required"},"children":["Required "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"50%","data-label":"Description"},"children":["Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shopify_metafield"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shopify API Key."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["password"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shopify password."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["store_name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your Store Name from Shopify"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["action"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Yes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Only accept: create or update"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["create: create new metafield for resource"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["update: update value of exist metafield"]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resource"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes (for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["action"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create"]},")"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Only accept value:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["shop"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["product"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["product_variant"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["product_image"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["custom_collection"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["smart_collection"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["customer"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["order"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["draft_order"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["blog"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["article"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["page"]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["stop_on_failed_record"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If checked, export jobs will terminate if an error record occurs. If left unchecked, export jobs still proceed even if a metafield created/updated failed."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":5},"children":["Examples"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-shop","__idx":6},"children":["Create a Metafield for Shop"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"shop\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT page_id, key, namespace, value FROM table ORDER BY page_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-product","__idx":7},"children":["Create a Metafield for Product"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"product\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT product_id, key, namespace, value FROM table ORDER BY product_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-product-variant","__idx":8},"children":["Create a Metafield for Product Variant"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"product_variant\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT variant_id, key, namespace, value FROM table ORDER BY variant_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-product-image","__idx":9},"children":["Create a Metafield for Product Image"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"product_image\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT product_id, image_id, key, namespace, value FROM table ORDER BY product_id, image_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-custom-collection","__idx":10},"children":["Create a Metafield for Custom Collection"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"custom_collection\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT custom_collection_id, key, namespace, value FROM table ORDER BY custom_collection_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-smart-collection","__idx":11},"children":["Create a Metafield for Smart Collection"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"smart_collection\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT smart_collection_id, key, namespace, value FROM table ORDER BY smart_collection_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-customer","__idx":12},"children":["Create a Metafield for Customer"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"customer\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT customer_id, key, namespace, value FROM table ORDER BY customer_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-order","__idx":13},"children":["Create a Metafield for Order"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"order\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT order_id, key, namespace, value FROM table ORDER BY order_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-draft-order","__idx":14},"children":["Create a Metafield for Draft Order"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"draft_order\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT draft_order_id, key, namespace, value FROM table ORDER BY draft_order_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-blog","__idx":15},"children":["Create a Metafield for Blog"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"blog\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT blog_id, key, namespace, value FROM table ORDER BY blog_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-article","__idx":16},"children":["Create a Metafield for Article"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"article\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT blog_id, article_id, key, namespace, value FROM table ORDER BY blog_id, article_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-metafield-for-page","__idx":17},"children":["Create a Metafield for Page"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"create\",\n    \"resource\": \"page\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT page_id, key, namespace, value FROM table ORDER BY page_id\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"update-a-metafield","__idx":18},"children":["Update a Metafield"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query \\\n  --database my_db \\\n  --result '{\n    \"type\": \"shopify_metafield\",\n    \"apikey\": \"xxxx\",\n    \"password\": \"xxxx\",\n    \"store_name\": \"xxxxx\",\n    \"action\": \"update\",\n    \"stop_on_failed_record\": false\n  }' \\\n  \"SELECT metafield_id, value FROM table\"\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Shopify Export Integration CLI","id":"shopify-export-integration-cli","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Limitations","id":"limitations","depth":2},{"value":"Using the Command Line to Create Your Connection","id":"using-the-command-line-to-create-your-connection","depth":2},{"value":"Install the Treasure Data Toolbelt","id":"install-the-treasure-data-toolbelt","depth":2},{"value":"Examples","id":"examples","depth":2},{"value":"Create a Metafield for Shop","id":"create-a-metafield-for-shop","depth":3},{"value":"Create a Metafield for Product","id":"create-a-metafield-for-product","depth":3},{"value":"Create a Metafield for Product Variant","id":"create-a-metafield-for-product-variant","depth":3},{"value":"Create a Metafield for Product Image","id":"create-a-metafield-for-product-image","depth":3},{"value":"Create a Metafield for Custom Collection","id":"create-a-metafield-for-custom-collection","depth":3},{"value":"Create a Metafield for Smart Collection","id":"create-a-metafield-for-smart-collection","depth":3},{"value":"Create a Metafield for Customer","id":"create-a-metafield-for-customer","depth":3},{"value":"Create a Metafield for Order","id":"create-a-metafield-for-order","depth":3},{"value":"Create a Metafield for Draft Order","id":"create-a-metafield-for-draft-order","depth":3},{"value":"Create a Metafield for Blog","id":"create-a-metafield-for-blog","depth":3},{"value":"Create a Metafield for Article","id":"create-a-metafield-for-article","depth":3},{"value":"Create a Metafield for Page","id":"create-a-metafield-for-page","depth":3},{"value":"Update a Metafield","id":"update-a-metafield","depth":3}],"frontmatter":{"seo":{"title":"Shopify Export Integration CLI"}},"lastModified":"2026-01-09T05:58:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/shopify-export-integration-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}