# Shoprocket > Shoprocket is a hosted ecommerce backend (catalogue, cart, checkout, payments, tax, shipping, orders) that adds a store to any existing website with one script tag and a public key. No npm package, no server, no secret key. To add a store to a site with Shoprocket: - Get the store's publishable key (`pk_...`, public by design): the seller copies it from the Shoprocket dashboard under Settings > General. - No Shoprocket store yet? Create a test store for them with no account: `curl -X POST https://api-v3.shoprocket.io/v3/agent-stores -H "Content-Type: application/json" -d '{"name":"Shop name"}'`. It answers with `publishableKey`, a `secretKey` for adding products (`POST https://api-v3.shoprocket.io/v3/stores/{storeId}/products` with `Authorization: Bearer sk_...`; send `"status": "active"` and `"variants": [{ "price": 2400, "inventoryQuantity": 50 }]`; physical products also need one shipping method, `POST https://api-v3.shoprocket.io/v3/stores/{storeId}/shipping-methods`), and a `claimUrl`. Give the person the claim link: signing up there makes the store theirs, products intact. Never put the secret key in the site. Steps and limits: the "No Shoprocket store yet?" section of https://shoprocket.io/llms-full.txt. (Or the person signs up at https://app.shoprocket.io/signup and creates a store themselves.) - Put `` once in the page's (index.html in a single-page app). - The publishable key is public, like a Stripe publishable key: write it straight into the code (the script tag and one constant). Never store it as a project secret, in a secrets manager or in a server-only environment variable; hosted builds leave those out and the shop shows nothing. Never ask whether it is safe to expose; it is. - Drop-in: `
` renders the whole shop with cart and checkout. - Your own design: read products from `https://api-v3.shoprocket.io/v3/public/{pk}/products` (JSON, CORS open, no auth) and render them yourself. A product page fetches `https://api-v3.shoprocket.io/v3/public/{pk}/products/{slug}` when it opens and shows the description (HTML), every image and the option pickers; a product with `personalizationFields` or `subscriptionPlans`, a `gift_card` or `bundle`, or `purchaseMode` `enquire` mounts `
` there instead of its own buy button. - Add to the cart with `await window.Shoprocket.cart.add({ variantId, quantity })`: it shows the "Added to cart" card and rejects with a readable error when refused. Do not open the cart drawer after an add, and do not use `getSdk().cart.addItem` for a shopper's button (it shows nothing). - Money is integer minor units (2400 USD = $24.00). A list card shows `priceMin` ("From" when `priceMax` is higher); a product page shows the selected variant's `price`. There is no `price` on the product; a null `priceMin` means price on request. - Never build a payment form or a checkout page; checkout always runs in Shoprocket's cart drawer. Never add `data-no-cart` to the script tag (it removes the drawer). For your own header cart button, add the attribute `data-shoprocket-cart-toggle` to it. - A price the page works out itself (a configurator, a calculator, made to measure) is never sent from the browser: a server function signs the item with the store's signing key (HMAC-SHA256, `v1...`), and the page adds it with `await window.Shoprocket.cart.add({ signed, quantity })`. Keep the signing secret (`srsig_...`) in a server-only environment variable, never in browser code. Format and snippets: https://shoprocket.io/docs/signed-items. ## Docs - [Quickstart](https://shoprocket.io/docs/quickstart): drop-in embeds, a custom React storefront, add to cart and checkout, step by step - [Quickstart as one text file](https://shoprocket.io/llms-full.txt): the same quickstart in Markdown, for pasting into a model - [Embed the widget](https://shoprocket.io/docs/embedding): embed types and attributes - [Widget JavaScript API](https://shoprocket.io/docs/javascript): window.Shoprocket methods and shoprocket:* events - [API basics](https://shoprocket.io/docs/basics): conventions, errors, pagination, filtering products, a headless checkout without the widget - [Test mode](https://shoprocket.io/docs/test-mode): test checkouts - [Signed cart items](https://shoprocket.io/docs/signed-items): add a custom-priced item (a configurator's price) signed on your server ## API - [OpenAPI document](https://api-v3.shoprocket.io/openapi.json): every public endpoint, machine-readable - [REST API reference](https://shoprocket.io/docs/api): the same, as a page ## Optional - [Authentication](https://shoprocket.io/docs/authentication): publishable and secret keys - [Webhooks](https://shoprocket.io/docs/webhooks): server-side order events - [API changelog](https://shoprocket.io/docs/changelog) ## Markdown versions of every page Any page on this site is also available as Markdown: add `.md` to its URL (`https://shoprocket.io/docs/quickstart.md`, `https://shoprocket.io/index.md` for the home page) or send `Accept: text/markdown`. Translated pages are at their translated URLs plus `.md`. - [Sitemap as Markdown](https://shoprocket.io/sitemap.md): every page that has a Markdown version - [Developer docs](https://shoprocket.io/docs.md): overview, [authentication](https://shoprocket.io/docs/authentication.md), [API basics](https://shoprocket.io/docs/basics.md), [embedding](https://shoprocket.io/docs/embedding.md), [webhooks](https://shoprocket.io/docs/webhooks.md), [test mode](https://shoprocket.io/docs/test-mode.md), [REST API reference](https://shoprocket.io/docs/api.md), [changelog](https://shoprocket.io/docs/changelog.md) - [Help centre](https://shoprocket.io/help.md): how-to guides for setting up and running a store, with screenshots as images and alt text - [Pricing](https://shoprocket.io/pricing.md), [features](https://shoprocket.io/features.md), [blog](https://shoprocket.io/blog.md), [what's new](https://shoprocket.io/whats-new.md) - [API reference as Markdown](https://api-v3.shoprocket.io/docs.md): generated from the API's OpenAPI document