Keys, domains and revocation
QuoShop key, headers, target store, allowed domains (CORS), rotation and revocation.
Every request authenticates with a QuoShop key. There is no user, password or session: the key designates the workspace, its scopes act as permissions. An integration never receives the credentials of a QuoSuite user.
Key format
qsh_k3v9x2m4p7r8t1wq_Hq7tY… (40 random characters)
└┬┘ └──────┬───────┘ └────┬────┘
│ public identifier secret
QuoShop perimeterqsh_: a QuoShop key (the store). Aqss_key (QuoSuite, the ERP) is refused here, and vice versa: 403API_KEY_WRONG_PERIMETER.- The public identifier (16 characters) is what the application and the plugins display:
qsh_k3v9x2m4p7r8t1wq_••••. - The secret is never stored by QuoSuite, only its hash: nobody can give it back to you.
Sending the key, selecting the store
GET /api/public/v1/quoshop/store HTTP/1.1
Authorization: Bearer qsh_k3v9x2m4p7r8t1wq_Hq7tY…
X-QuoShop-Store: my-store
Accept-Language: enAuthorization: Bearer <key>— orX-API-Key: <key>on hostings that strip theAuthorizationheader. Never in the URL.X-QuoShop-Store— identifier or slug of the store (GET /stores). Optional when the workspace has only one; otherwise 400 withdetail.stores. Another workspace’s store: 404; suspended store: 403.
Allowed domains (CORS)
A key without a domain is a server-to-server key: any call coming from a browser (Origin header) is refused. That is the right setting for a CMS plugin, which calls the API from PHP — and a leaked key would stay useless from a web page.
To call the API from a visitor’s browser (a JavaScript catalogue, for instance), create another key, read only, and declare your pages’ domains on it:
https://shop.example.com
https://*.example.com ← subdomains, not example.com itself
http://localhost:8080 ← developmentA call from an undeclared origin: 403 API_ORIGIN_NOT_ALLOWED. The preflight (OPTIONS) accepts the X-QuoShop-Store header.
Rotating a key
Settings › API & Integrations › the key › Rotate: a new value for the same key — same scopes, same domains, same webhook endpoints. With a grace period, the old value keeps being accepted while you deploy the new one; without grace, it is refused at once (401 API_KEY_INVALID).
On the integration side: paste the new value, test (GET /ping), then let the grace period run out. The QuoShop plugins test a key before saving it: a typo never replaces a working key.
Revoking a key
Revoke cuts the key immediately and for good, grace included. Its webhook endpoints receive nothing more. A key can also expire on the date chosen when it was created.
| Code (401) | Situation | What the integration must do |
|---|---|---|
API_KEY_REVOKED | key revoked | stop, ask for a new key |
API_KEY_EXPIRED | expiry date passed | stop, ask for a renewed key |
API_KEY_INVALID | unknown, or replaced without grace | stop, ask for the current key |
Good practice
- One key per integration (a site, a plugin, a script): you revoke one without cutting the others, and the audit log tells who did what.
- Minimal scopes: a showcase site does not need
orders:write. - Encrypted storage: the plugins encrypt the key at rest (WordPress: libsodium with the site’s security keys; PrestaShop:
PhpEncryptionwith the cookie key) and never display it again. - Never in a log: the plugins mask
qsh_…_••••andwhsec_••••in their logs.