OAuth for Apps
An app gets its own app access token for each store that installs it. The merchant approves the permissions once, and the app then calls the API on that store only.
How It Works
- The merchant installs your app
Storeep opens the App URL of your version with the store's id, for example
https://example.com/storeep?store=234567890123456789. - Your app asks for authorization
Your app redirects the merchant to the authorization page with a PKCE challenge. The merchant reads the permissions and clicks Connect.
- Your app exchanges the code
Storeep redirects to your Redirect URI with a code. Your server exchanges it, with your client secret and the PKCE verifier, for an access token and a refresh token.
- Your app calls the API
It sends the access token as a Bearer token. The token works on the one store that approved it, with the permissions the merchant approved.
Authorization Request
https://app.storeep.com/oauth/authorizeSend the merchant's browser to this address with these query parameters:
| Parameter | Required | Description |
|---|---|---|
response_type | Yes | Always code. |
client_id | Yes | Your client ID, app_ followed by 32 characters. |
redirect_uri | Yes | One of the Redirect URIs of your version, matched character for character. |
code_challenge | Yes | The base64url SHA-256 of your code verifier, 43 characters. |
code_challenge_method | Yes | Always S256. |
store | Yes | The id of the store, the one your App URL received as store. |
scope | No | The permissions you want, separated by spaces. Leave it out to get every permission your version declares. See Permissions. |
state | No | A random value you make, and check when the merchant comes back. It stops a forged callback. It is optional, but always send it. |
resource | No | https://api.storeep.com, the API the token is for. Any other value is refused. |
https://app.storeep.com/oauth/authorize?response_type=code
&client_id=YOUR_CLIENT_ID
&redirect_uri=https%3A%2F%2Fexample.com%2Fstoreep%2Fcallback
&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
&code_challenge_method=S256
&store=234567890123456789
&state=YOUR_STATE
&resource=https%3A%2F%2Fapi.storeep.comOnce the merchant clicks Connect, Storeep redirects to https://example.com/storeep/callback?code=...&state=YOUR_STATE. The code works once and lasts 60 seconds, so exchange it at once. The address also carries iss=https://mcp.storeep.com. If the merchant clicks Cancel, you receive error=access_denied and your state instead of a code.
What the Merchant Sees
- The consent screen shows your app's name, the store, every permission the token will carry and the address the merchant is sent back to.
- The merchant approves all the permissions together, or none.
- The app must be installed on the store, and the merchant must be signed in as a member of it.
- A staff member can connect an app only when their role covers the Apps section and everything the app asks for. Otherwise the screen tells them to ask the store owner.
- A draft version, which only your development stores can run, shows the warning Unverified.
When the Request Is Refused
A refused request comes back to your Redirect URI with error, error_description, your state and iss:
| Error | Cause |
|---|---|
access_denied | The merchant clicked Cancel. |
invalid_request | A parameter is missing or malformed: code_challenge, code_challenge_method or store. |
invalid_scope | A permission in scope is unknown or not declared by your version, or your version declares no permission at all. |
invalid_target | resource is not https://api.storeep.com. |
unsupported_response_type | response_type is not code. |
Two refusals never redirect, so that a code can never reach an address you did not register: an unknown client_id, and a redirect_uri that is not one of your Redirect URIs. Both show a page to the merchant instead. While your version is a draft, a malformed request is also shown on the screen, with its reason, instead of being sent to your Redirect URI.
Token Exchange
https://mcp.storeep.com/oauth/tokenSend the parameters as form fields (application/x-www-form-urlencoded), not as JSON. Your server makes this call. Never put the client secret in a browser or a mobile app.
| Field | Required | Description |
|---|---|---|
grant_type | Yes | authorization_code for a first exchange, refresh_token for a refresh. |
code | With a code | The code your Redirect URI received. |
redirect_uri | With a code | The same redirect_uri you sent in the authorization request. |
code_verifier | With a code | The PKCE verifier whose challenge you sent. |
refresh_token | With a refresh | Your newest refresh token for that store. |
client_id | Yes | Your client ID. |
client_secret | Yes | Your client secret, appsec_ followed by 64 characters. |
resource | No | https://api.storeep.com. Any other value is refused. |
You can also send the client ID and the client secret as HTTP Basic credentials instead of the two fields, as the examples below do.
curl -X POST "https://mcp.storeep.com/oauth/token" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d grant_type=authorization_code \
-d code=YOUR_CODE \
-d redirect_uri=https://example.com/storeep/callback \
-d code_verifier=YOUR_CODE_VERIFIER{
"access_token": "3f9a...c41e",
"token_type": "Bearer",
"expires_in": 86400,
"refresh_token": "b07d...92aa",
"scope": "store:read orders:read",
"store_id": "234567890123456789"
}| Field | Description |
|---|---|
access_token | The app access token, 64 characters. Send it as a Bearer token. |
expires_in | How long the access token lasts, in seconds. |
refresh_token | The token you trade for the next pair. It works once. |
scope | The permissions the token carries, separated by spaces. |
store_id | The store the tokens belong to. |
store_id in this answer, never from the address your app was opened with. Anyone can type an address.Refreshing a Token
Before the access token runs out, trade the refresh token for a new pair. The answer has the same fields as the first exchange.
curl -X POST "https://mcp.storeep.com/oauth/token" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d grant_type=refresh_token \
-d refresh_token=YOUR_REFRESH_TOKEN| Token | Lasts | Rule |
|---|---|---|
| Authorization code | 60 seconds | Works once. |
| Access token | 24 hours | After a refresh, the access token you held before keeps working until its own 24 hours end. |
| Refresh token | 90 days | Works once. Each refresh starts a new 90 days, so an app that refreshes regularly never asks the merchant again. |
- Keep the new refresh token from every answer, and store it before you use the new access token.
- A refresh token used again within 30 seconds of its rotation is refused without harm. This happens when two of your workers refresh at once: use the tokens the first one received.
- A refresh token used again later revokes every token of the install. The merchant then has to connect again.
- A new approval by the merchant replaces every older token of that store.
- While Storeep has paused your app, the token endpoint answers
503withtemporarily_unavailable. Keep your refresh token and try later. - When the merchant uninstalls your app, its tokens stop working at once.
Revoking a Token
https://mcp.storeep.com/oauth/revokeTo disconnect a store, post one of its tokens with your client credentials. Either token works, and every token of that install is revoked at once.
curl -X POST "https://mcp.storeep.com/oauth/revoke" \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d token=YOUR_REFRESH_TOKENThe answer is 200 with an empty body, also for a token that is unknown or already revoked. A request without your client credentials answers 401 with invalid_client, and nothing is revoked. Revoking does not uninstall your app: the merchant can connect again with the Connect again link at the bottom of your app's window.
Asking for a New Permission
- Start a new version, turn the permission on in its Version tab, and get the version approved.
- Your tokens keep the permissions they had. A call that needs the new one answers
403withinsufficient permissions, requires: .... - Send the merchant through authorization again. At the bottom of your app's window, a note names you as its developer, with your support email, your website and your privacy policy. Its Connect again link opens your App URL with
?store=and the store id, exactly as an install does. You can also send the merchant the authorization address yourself. - The new approval replaces every older token of that store. Use the new pair from then on.
A version that drops a permission needs nothing from the merchant. Your tokens lose it as soon as the version is live.
Calling the API
curl "https://api.storeep.com/v1/store" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Storeep-Version: 2026-11-30"Send a Storeep-Version header with the date of the API version you built against, see Versions.
Endpoints for Apps
| Endpoint | Permission | Description |
|---|---|---|
GET /v1/store | store:read | The store, its markets and currencies, its plan and its custom order statuses. See Store and Customers. |
GET /v1/customers | customers:read | Customers with their order count and lifetime value. |
GET /v1/products | products:read | Products, see Products. |
POST /v1/products | products:write | Creates a product, as a draft unless is_published is true. |
PATCH /v1/products/{id} | products:write | Edits the name, description, SEO fields, flags, gallery, and the stock and price of each option. |
POST /v1/products/stock | products:write | Sets the stock of a product's options. |
GET /v1/media | media:read | The files of the media library, newest first. See Media. |
POST /v1/media | media:write | Uploads one image. |
GET /v1/orders | orders:read | Orders, see Orders. |
PATCH /v1/orders/{id} | orders:write | Moves an order to a new status. |
POST /v1/orders/notes | orders:write | Adds a note to an order's timeline, under your app's name. |
GET, PUT /v1/app-data | None | Your app settings for this store, see App Settings. |
GET, POST, DELETE /v1/app-webhooks | The one of the event | Your app's event subscriptions, see App Webhooks. |
- Send every write as a JSON body, except an image upload.
- Send every id as a string, so it keeps all its digits.
- A refused write answers
422with a message naming the field to fix. - Each install can make 1,000 writes in any 24 hours, see Rate Limits.
- An app access token cannot use
/v1/webhooks. Those are the store's own webhooks.
When a Token Is Refused
| Status | Message | What to do |
|---|---|---|
401 | access token has expired | Refresh the token. |
401 | access token has been revoked | A refresh token was used twice. Send the merchant through authorization again. |
401 | access token is invalid | The token was replaced by a newer approval, revoked by your app, or the app was uninstalled or the store changed owner. Use your newest token, or authorize again. |
401 | this app is suspended | Storeep has paused your app. Every token stops working until the pause is lifted. Keep your tokens, and see Review and Publishing. |
401 | this app has no approved version | Submit a version for review. Until it is approved, your app runs on your development stores only. |
403 | insufficient permissions, requires: ... | Declare the permission in a new version, then ask the merchant to connect again. |
The token endpoint has its own error format, see OAuth Errors.