[{"data":1,"prerenderedAt":290,"buildId":291},["ShallowReactive",2],{"docs-\u002Fgetting-started\u002Fauthentication":3,"docs-nav":213},{"id":4,"title":5,"body":6,"description":205,"extension":206,"meta":207,"navigation":208,"path":209,"seo":210,"stem":211,"__hash__":212},"docs\u002F1.getting-started\u002F3.authentication.md","Authentication",{"type":7,"value":8,"toc":198},"minimark",[9,13,17,52,76,81,109,113,124,128,131,166,170,187,191,194],[10,11,5],"h1",{"id":12},"authentication",[14,15,16],"p",{},"Every call carries your key and the business it's for:",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-bash shiki shiki-themes github-light","Authorization: Bearer qp_sk_live_...\nQwikiPay-Business: qp_biz_live_9f2c1a7e40b3d815\n","bash","",[25,26,27,43],"code",{"__ignoreMap":23},[28,29,32,36,40],"span",{"class":30,"line":31},"line",1,[28,33,35],{"class":34},"s7eDp","Authorization:",[28,37,39],{"class":38},"sYBdl"," Bearer",[28,41,42],{"class":38}," qp_sk_live_...\n",[28,44,46,49],{"class":30,"line":45},2,[28,47,48],{"class":34},"QwikiPay-Business:",[28,50,51],{"class":38}," qp_biz_live_9f2c1a7e40b3d815\n",[14,53,54,55,59,60,63,64,67,68,71,72,75],{},"Your ",[56,57,58],"strong",{},"keys belong to your account",": one public and one secret key for test, and the same for live. The ",[56,61,62],{},"business ID"," picks which of your businesses the payment belongs to, so each website's money lands in its own wallet. Each business has a test ID (",[25,65,66],{},"qp_biz_test_...",") and a live ID (",[25,69,70],{},"qp_biz_live_...","); send the one matching your key's mode, or the call is refused with ",[25,73,74],{},"business_id_mode_mismatch",". Another account's business ID is refused too.",[77,78,80],"h2",{"id":79},"secret-key-your-server-only","Secret key: your server only",[82,83,84,96,99,102],"ul",{},[85,86,87,88,91,92,95],"li",{},"Use it from your server. A call with a secret key that comes from a web browser (it has an ",[25,89,90],{},"Origin"," header) is refused with ",[25,93,94],{},"secret_key_in_browser","; if you see that, the key has leaked into a page: roll it.",[85,97,98],{},"Keep it in an environment variable or secret manager, never in your code repository.",[85,100,101],{},"We show it once, when you create it, and store only a one-way hash. We can't show it again either.",[85,103,104,105,108],{},"Optionally restrict your live secret key to your servers' IP addresses in ",[56,106,107],{},"Developers",".",[77,110,112],{"id":111},"public-key-your-web-page","Public key: your web page",[14,114,115,116,121,122,108],{},"The public key only opens a checkout (",[117,118,120],"a",{"href":119},"\u002Fpayments\u002Fdrop-in","drop-in","). It can't read payments or balances. Calls with it must come from a page on your business's domain; we check the browser's ",[25,123,90],{},[77,125,127],{"id":126},"your-domain-is-checked","Your domain is checked",[14,129,130],{},"When you add a business you prove you own its domain. After that:",[82,132,133,148],{},[85,134,135,136,139,140,143,144,147],{},"Browser calls must come from that domain or one of its subdomains (",[25,137,138],{},"shop.example.com",", ",[25,141,142],{},"pay.shop.example.com","). ",[25,145,146],{},"example.com.evil.io"," never matches.",[85,149,150,153,154,157,158,161,162,165],{},[25,151,152],{},"redirect_url"," and your webhook URL must be ",[25,155,156],{},"https:\u002F\u002F"," addresses on that domain. In test mode ",[25,159,160],{},"localhost"," and ",[25,163,164],{},"*.test"," also work.",[77,167,169],{"id":168},"rolling-and-revoking","Rolling and revoking",[82,171,172,178,184],{},[85,173,174,177],{},[56,175,176],{},"Roll"," a secret key to get a new one; the old one keeps working for 24 hours so you can deploy without downtime.",[85,179,180,183],{},[56,181,182],{},"Revoke"," a key and it stops working at once.",[85,185,186],{},"Live key changes need a code from your authenticator app, and we email you about every key change.",[77,188,190],{"id":189},"limits","Limits",[14,192,193],{},"300 calls a minute per key. Ten wrong keys from one address in ten minutes blocks that address for an hour. Request bodies are capped at 32 KB.",[195,196,197],"style",{},"html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}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);}",{"title":23,"searchDepth":45,"depth":45,"links":199},[200,201,202,203,204],{"id":79,"depth":45,"text":80},{"id":111,"depth":45,"text":112},{"id":126,"depth":45,"text":127},{"id":168,"depth":45,"text":169},{"id":189,"depth":45,"text":190},"Keys, business IDs and where calls may come from.","md",{},true,"\u002Fgetting-started\u002Fauthentication",{"title":5,"description":205},"1.getting-started\u002F3.authentication","Er-vUARUnk1XQvYPgBz6Ujs31Kvhu-uBic9K01eBbmY",[214,218,237,261,273],{"title":215,"path":216,"stem":217},"QwikiPay API","\u002F","0.index",{"title":219,"path":220,"stem":221,"children":222,"page":236},"Getting Started","\u002Fgetting-started","1.getting-started",[223,227,231,232],{"title":224,"path":225,"stem":226},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F1.quickstart",{"title":228,"path":229,"stem":230},"Test and live mode","\u002Fgetting-started\u002Ftest-and-live-mode","1.getting-started\u002F2.test-and-live-mode",{"title":5,"path":209,"stem":211},{"title":233,"path":234,"stem":235},"Businesses","\u002Fgetting-started\u002Fbusinesses","1.getting-started\u002F4.businesses",false,{"title":238,"path":239,"stem":240,"children":241,"page":236},"Payments","\u002Fpayments","2.payments",[242,245,249,253,257],{"title":243,"path":119,"stem":244},"Drop-in checkout","2.payments\u002F1.drop-in",{"title":246,"path":247,"stem":248},"Hosted checkout","\u002Fpayments\u002Fhosted-checkout","2.payments\u002F2.hosted-checkout",{"title":250,"path":251,"stem":252},"Direct charges","\u002Fpayments\u002Fdirect-charges","2.payments\u002F3.direct-charges",{"title":254,"path":255,"stem":256},"Confirm a payment","\u002Fpayments\u002Fconfirm-a-payment","2.payments\u002F4.confirm-a-payment",{"title":258,"path":259,"stem":260},"Disputes","\u002Fpayments\u002Fdisputes","2.payments\u002F5.disputes",{"title":262,"path":263,"stem":264,"children":265,"page":236},"Webhooks","\u002Fwebhooks","3.webhooks",[266,269],{"title":262,"path":267,"stem":268},"\u002Fwebhooks\u002Foverview","3.webhooks\u002F1.overview",{"title":270,"path":271,"stem":272},"Verify signatures","\u002Fwebhooks\u002Fverify-signatures","3.webhooks\u002F2.verify-signatures",{"title":274,"path":275,"stem":276,"children":277,"page":236},"Reference","\u002Freference","4.reference",[278,282,286],{"title":279,"path":280,"stem":281},"Idempotency","\u002Freference\u002Fidempotency","4.reference\u002F1.idempotency",{"title":283,"path":284,"stem":285},"Errors","\u002Freference\u002Ferrors","4.reference\u002F2.errors",{"title":287,"path":288,"stem":289},"Countries and payment methods","\u002Freference\u002Fcountries","4.reference\u002F3.countries",1796429326073,"f8f2bc0b-2f84-41e1-84f7-47b53c87c561"]