অথেনটিকেশন

নিজের ব্যাকএন্ডের জন্য এপিআই কী, মার্চেন্টের হয়ে কাজ করা অ্যাপের জন্য ওএথ — এবং দুটোর সাধারণ স্কোপ নিয়ম।

Version v1 · updated 2026-02-01

There are exactly two ways to authenticate. Which one is correct is decided by a single question: does the credential belong to you, or to a merchant who has to consent to what you do with it?

API keyOAuth app
Use whenYou own the storeYou build for other merchants
Credential livesYour server, in a secret managerIssued per merchant, refreshable
ConsentImplicit (you are the owner)Explicit consent screen, revocable
ScopesChosen at key creationRequested ∩ allowed by registration
RotationManual, zero-downtime overlapRefresh token rotation on every use

API keys#

Send the key as a bearer token. Framique stores only a hash, so a lost key cannot be recovered — it is rotated. Rotation issues a second live key so you can deploy before revoking the first.

GET /api/public/v1/products?limit=25 HTTP/1.1
Host: your-store.framique.com
Authorization: Bearer fq_live_9f2c…
Accept: application/json

OAuth 2.0 with PKCE#

Public clients (CLI tools, single-page apps) must use PKCE; there is no implicit flow and no client secret in a browser. Authorization codes are single-use and expire in 60 seconds, and a reused code revokes the whole grant family — a replayed code is treated as theft, not as a retry.

Exchange the code for tokens
curl -s -X POST "https://api.framique.com/api/public/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "authorization_code",
    "code": "'"$CODE"'",
    "client_id": "'"$CLIENT_ID"'",
    "code_verifier": "'"$VERIFIER"'",
    "redirect_uri": "https://app.example.com/callback"
  }'

Scopes#

Scopes are the same catalogue everywhere: the consent screen, the key editor and the gateway authorizer all read one table, so a scope cannot mean one thing on screen and another at the door. A `.write` scope implies `.read` of the same resource and nothing else.

Framique public REST API endpoints
EndpointWhat it doesSamples
GET/meIdentity of the calling credential
GET/ordersList orders (cursor paginated)
GET/orders/{id}Fetch one order
POST/orders/{id}/notesAppend an order note
GET/productsList products (cursor paginated)
GET/products/{id}Fetch one product
POST/productsCreate a draft product
GET/customersList customers (cursor paginated)
GET/exportsList export jobs
POST/exportsStart an export job
GET/exports/{id}Export job detail + signed URL
GET/webhooksList webhook endpoints
POST/webhooksRegister a webhook endpoint
DELETE/webhooks/{id}Delete a webhook endpoint
GET/themesList installed themes
GET/themes/{id}Fetch one installed theme
GET/themes/{id}/assetsList a theme's CSS, font and image assets
POST/themes/{id}/activateActivate a theme on the storefront
GET/marketplace/themesList published marketplace themes