[{"data":1,"prerenderedAt":574},["ShallowReactive",2],{"navigation_docs":3,"-developers-authentication":58,"-developers-authentication-surround":569},[4,9,31,42],{"title":5,"path":6,"stem":7,"icon":8},"Introduction","\u002F","1.introduction","i-lucide-house",{"title":10,"icon":11,"path":12,"stem":13,"children":14,"page":30},"Guides","i-lucide-compass","\u002Fguides","2.guides",[15,20,25],{"title":16,"path":17,"stem":18,"icon":19},"Getting Started","\u002Fguides\u002Fgetting-started","2.guides\u002F1.getting-started","i-lucide-rocket",{"title":21,"path":22,"stem":23,"icon":24},"Add a location","\u002Fguides\u002Fadd-a-location","2.guides\u002F2.add-a-location","i-lucide-store",{"title":26,"path":27,"stem":28,"icon":29},"Add Products","\u002Fguides\u002Fadd-products","2.guides\u002F3.add-products","i-lucide-package-plus",false,{"title":32,"path":33,"stem":34,"children":35,"icon":41},"Developers","\u002Fdevelopers","3.developers\u002F1.introduction",[36],{"title":37,"path":38,"stem":39,"icon":40},"Authentication","\u002Fdevelopers\u002Fauthentication","3.developers\u002F2.authentication","i-lucide-key-round","i-lucide-terminal",{"title":43,"icon":44,"path":45,"stem":46,"children":47,"page":30},"API Reference","i-lucide-book-open","\u002Fapi-reference","4.api-reference",[48,53],{"title":49,"path":50,"stem":51,"icon":52},"Products","\u002Fapi-reference\u002Fproducts","4.api-reference\u002F1.products","i-lucide-package",{"title":54,"path":55,"stem":56,"icon":57},"Collections","\u002Fapi-reference\u002Fcollections","4.api-reference\u002F2.collections","i-lucide-layers",{"id":59,"title":37,"body":60,"description":562,"extension":563,"links":564,"meta":565,"navigation":566,"path":38,"seo":567,"stem":39,"__hash__":568},"docs\u002F3.developers\u002F2.authentication.md",{"type":61,"value":62,"toc":555},"minimark",[63,67,70,75,78,81,85,88,128,131,135,138,141,145,152,175,540,544,551],[64,65,66],"p",{},"ShopQuery API requests are authenticated with an app token.",[64,68,69],{},"An app belongs to a merchant account and can read that merchant's catalog. Treat the token like a password: it grants access to merchant product data and is only shown once when it is created.",[71,72,74],"h2",{"id":73},"create-an-account","Create an account",[64,76,77],{},"Sign up for ShopQuery and complete merchant setup. You need an active merchant workspace before you can create an app token.",[64,79,80],{},"If you are building for a merchant, ask them to invite you to their ShopQuery account or create the app on your behalf.",[71,82,84],{"id":83},"create-an-app","Create an app",[64,86,87],{},"In the merchant dashboard:",[89,90,91,100,106,112,123],"ol",{},[92,93,94,95,99],"li",{},"Open ",[96,97,98],"strong",{},"Settings",".",[92,101,102,103,99],{},"Go to ",[96,104,105],{},"Apps",[92,107,108,109,99],{},"Click ",[96,110,111],{},"Create App",[92,113,114,115,119,120,99],{},"Enter a clear name, such as ",[116,117,118],"code",{},"Website storefront"," or ",[116,121,122],{},"Inventory agent",[92,124,108,125,99],{},[96,126,127],{},"Create",[64,129,130],{},"ShopQuery creates a merchant-wide app token. It is not tied to a single store location, so it can read catalog data across the merchant account.",[71,132,134],{"id":133},"save-the-token","Save the token",[64,136,137],{},"The token is shown once after the app is created. Copy it immediately and store it in a secure place, such as your deployment platform's encrypted environment variables or a secret manager.",[64,139,140],{},"Do not commit tokens to source control, place them in browser code, or share them in support chats. If a token is exposed, delete the app and create a new one.",[71,142,144],{"id":143},"send-authenticated-requests","Send authenticated requests",[64,146,147,148,151],{},"Pass the token in the ",[116,149,150],{},"Authorization"," header using the bearer scheme.",[153,154,159],"pre",{"className":155,"code":156,"language":157,"meta":158,"style":158},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Authorization: Bearer \u003Capp_token>\nAccept: application\u002Fjson\n","http","",[116,160,161,169],{"__ignoreMap":158},[162,163,166],"span",{"class":164,"line":165},"line",1,[162,167,168],{},"Authorization: Bearer \u003Capp_token>\n",[162,170,172],{"class":164,"line":171},2,[162,173,174],{},"Accept: application\u002Fjson\n",[176,177,178,341,488],"code-group",{},[153,179,184],{"className":180,"code":181,"filename":182,"language":183,"meta":158,"style":158},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const response = await fetch(\"https:\u002F\u002Fapi.shopquery.ai\u002Fv1\u002Fproducts\", {\n    headers: {\n        Authorization: `Bearer ${process.env.SHOPQUERY_TOKEN}`,\n        Accept: \"application\u002Fjson\",\n    },\n});\n\nconst products = await response.json();\n","Fetch","js",[116,185,186,226,237,273,291,297,309,316],{"__ignoreMap":158},[162,187,188,192,196,200,204,208,211,214,218,220,223],{"class":164,"line":165},[162,189,191],{"class":190},"spNyl","const",[162,193,195],{"class":194},"sTEyZ"," response ",[162,197,199],{"class":198},"sMK4o","=",[162,201,203],{"class":202},"s7zQu"," await",[162,205,207],{"class":206},"s2Zo4"," fetch",[162,209,210],{"class":194},"(",[162,212,213],{"class":198},"\"",[162,215,217],{"class":216},"sfazB","https:\u002F\u002Fapi.shopquery.ai\u002Fv1\u002Fproducts",[162,219,213],{"class":198},[162,221,222],{"class":198},",",[162,224,225],{"class":198}," {\n",[162,227,228,232,235],{"class":164,"line":171},[162,229,231],{"class":230},"swJcz","    headers",[162,233,234],{"class":198},":",[162,236,225],{"class":198},[162,238,240,243,245,248,251,254,257,259,262,264,267,270],{"class":164,"line":239},3,[162,241,242],{"class":230},"        Authorization",[162,244,234],{"class":198},[162,246,247],{"class":198}," `",[162,249,250],{"class":216},"Bearer ",[162,252,253],{"class":198},"${",[162,255,256],{"class":194},"process",[162,258,99],{"class":198},[162,260,261],{"class":194},"env",[162,263,99],{"class":198},[162,265,266],{"class":194},"SHOPQUERY_TOKEN",[162,268,269],{"class":198},"}`",[162,271,272],{"class":198},",\n",[162,274,276,279,281,284,287,289],{"class":164,"line":275},4,[162,277,278],{"class":230},"        Accept",[162,280,234],{"class":198},[162,282,283],{"class":198}," \"",[162,285,286],{"class":216},"application\u002Fjson",[162,288,213],{"class":198},[162,290,272],{"class":198},[162,292,294],{"class":164,"line":293},5,[162,295,296],{"class":198},"    },\n",[162,298,300,303,306],{"class":164,"line":299},6,[162,301,302],{"class":198},"}",[162,304,305],{"class":194},")",[162,307,308],{"class":198},";\n",[162,310,312],{"class":164,"line":311},7,[162,313,315],{"emptyLinePlaceholder":314},true,"\n",[162,317,319,321,324,326,328,331,333,336,339],{"class":164,"line":318},8,[162,320,191],{"class":190},[162,322,323],{"class":194}," products ",[162,325,199],{"class":198},[162,327,203],{"class":202},[162,329,330],{"class":194}," response",[162,332,99],{"class":198},[162,334,335],{"class":206},"json",[162,337,338],{"class":194},"()",[162,340,308],{"class":198},[153,342,345],{"className":180,"code":343,"filename":344,"language":183,"meta":158,"style":158},"import axios from \"axios\";\n\nconst { data: products } = await axios.get(\n    \"https:\u002F\u002Fapi.shopquery.ai\u002Fv1\u002Fproducts\",\n    {\n        headers: {\n            Authorization: `Bearer ${process.env.SHOPQUERY_TOKEN}`,\n            Accept: \"application\u002Fjson\",\n        },\n    },\n);\n","Axios",[116,346,347,367,371,403,414,419,428,455,470,476,481],{"__ignoreMap":158},[162,348,349,352,355,358,360,363,365],{"class":164,"line":165},[162,350,351],{"class":202},"import",[162,353,354],{"class":194}," axios ",[162,356,357],{"class":202},"from",[162,359,283],{"class":198},[162,361,362],{"class":216},"axios",[162,364,213],{"class":198},[162,366,308],{"class":198},[162,368,369],{"class":164,"line":171},[162,370,315],{"emptyLinePlaceholder":314},[162,372,373,375,378,381,383,385,387,390,392,395,397,400],{"class":164,"line":239},[162,374,191],{"class":190},[162,376,377],{"class":198}," {",[162,379,380],{"class":230}," data",[162,382,234],{"class":198},[162,384,323],{"class":194},[162,386,302],{"class":198},[162,388,389],{"class":198}," =",[162,391,203],{"class":202},[162,393,394],{"class":194}," axios",[162,396,99],{"class":198},[162,398,399],{"class":206},"get",[162,401,402],{"class":194},"(\n",[162,404,405,408,410,412],{"class":164,"line":275},[162,406,407],{"class":198},"    \"",[162,409,217],{"class":216},[162,411,213],{"class":198},[162,413,272],{"class":198},[162,415,416],{"class":164,"line":293},[162,417,418],{"class":198},"    {\n",[162,420,421,424,426],{"class":164,"line":299},[162,422,423],{"class":230},"        headers",[162,425,234],{"class":198},[162,427,225],{"class":198},[162,429,430,433,435,437,439,441,443,445,447,449,451,453],{"class":164,"line":311},[162,431,432],{"class":230},"            Authorization",[162,434,234],{"class":198},[162,436,247],{"class":198},[162,438,250],{"class":216},[162,440,253],{"class":198},[162,442,256],{"class":194},[162,444,99],{"class":198},[162,446,261],{"class":194},[162,448,99],{"class":198},[162,450,266],{"class":194},[162,452,269],{"class":198},[162,454,272],{"class":198},[162,456,457,460,462,464,466,468],{"class":164,"line":318},[162,458,459],{"class":230},"            Accept",[162,461,234],{"class":198},[162,463,283],{"class":198},[162,465,286],{"class":216},[162,467,213],{"class":198},[162,469,272],{"class":198},[162,471,473],{"class":164,"line":472},9,[162,474,475],{"class":198},"        },\n",[162,477,479],{"class":164,"line":478},10,[162,480,296],{"class":198},[162,482,484,486],{"class":164,"line":483},11,[162,485,305],{"class":194},[162,487,308],{"class":198},[153,489,494],{"className":490,"code":491,"filename":492,"language":493,"meta":158,"style":158},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl \"https:\u002F\u002Fapi.shopquery.ai\u002Fv1\u002Fproducts\" \\\n    -H \"Authorization: Bearer $SHOPQUERY_TOKEN\" \\\n    -H \"Accept: application\u002Fjson\"\n","Curl","bash",[116,495,496,511,528],{"__ignoreMap":158},[162,497,498,502,504,506,508],{"class":164,"line":165},[162,499,501],{"class":500},"sBMFI","curl",[162,503,283],{"class":198},[162,505,217],{"class":216},[162,507,213],{"class":198},[162,509,510],{"class":194}," \\\n",[162,512,513,516,518,521,524,526],{"class":164,"line":171},[162,514,515],{"class":216},"    -H",[162,517,283],{"class":198},[162,519,520],{"class":216},"Authorization: Bearer ",[162,522,523],{"class":194},"$SHOPQUERY_TOKEN",[162,525,213],{"class":198},[162,527,510],{"class":194},[162,529,530,532,534,537],{"class":164,"line":239},[162,531,515],{"class":216},[162,533,283],{"class":198},[162,535,536],{"class":216},"Accept: application\u002Fjson",[162,538,539],{"class":198},"\"\n",[71,541,543],{"id":542},"rotate-access","Rotate access",[64,545,546,547,550],{},"If an app is no longer needed, delete it from ",[96,548,549],{},"Settings -> Apps",". Create a new app when you need a fresh token for another integration, environment, or developer.",[552,553,554],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":158,"searchDepth":171,"depth":171,"links":556},[557,558,559,560,561],{"id":73,"depth":171,"text":74},{"id":83,"depth":171,"text":84},{"id":133,"depth":171,"text":134},{"id":143,"depth":171,"text":144},{"id":542,"depth":171,"text":543},"Create an app token and authenticate ShopQuery API requests with a bearer token.","md",null,{},{"icon":40},{"title":37,"description":562},"hrjpEgTuIz4EzeFobBpvKueNKDD-gfKFdhgLmcYmVgM",[570,572],{"title":32,"path":33,"stem":34,"children":-1,"description":571,"icon":41},"Build merchant-scoped catalog experiences with the ShopQuery API.",{"title":49,"path":50,"stem":51,"description":573,"icon":52,"children":-1},"Read and search merchant-scoped products.",1778749034466]