Docs

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.

Working with your own store only? A personal access token is simpler. OAuth is for apps that many stores install. New to building apps? Start with Build Your First App, which has a complete example of this flow.

How It Works

  1. 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.

  2. 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.

  3. 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.

  4. 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

GEThttps://app.storeep.com/oauth/authorize

Send the merchant's browser to this address with these query parameters:

ParameterRequiredDescription
response_typeYesAlways code.
client_idYesYour client ID, app_ followed by 32 characters.
redirect_uriYesOne of the Redirect URIs of your version, matched character for character.
code_challengeYesThe base64url SHA-256 of your code verifier, 43 characters.
code_challenge_methodYesAlways S256.
storeYesThe id of the store, the one your App URL received as store.
scopeNoThe permissions you want, separated by spaces. Leave it out to get every permission your version declares. See Permissions.
stateNoA random value you make, and check when the merchant comes back. It stops a forged callback. It is optional, but always send it.
resourceNohttps://api.storeep.com, the API the token is for. Any other value is refused.
Authorization URL
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.com

Once 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:

ErrorCause
access_deniedThe merchant clicked Cancel.
invalid_requestA parameter is missing or malformed: code_challenge, code_challenge_method or store.
invalid_scopeA permission in scope is unknown or not declared by your version, or your version declares no permission at all.
invalid_targetresource is not https://api.storeep.com.
unsupported_response_typeresponse_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

POSThttps://mcp.storeep.com/oauth/token

Send 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.

FieldRequiredDescription
grant_typeYesauthorization_code for a first exchange, refresh_token for a refresh.
codeWith a codeThe code your Redirect URI received.
redirect_uriWith a codeThe same redirect_uri you sent in the authorization request.
code_verifierWith a codeThe PKCE verifier whose challenge you sent.
refresh_tokenWith a refreshYour newest refresh token for that store.
client_idYesYour client ID.
client_secretYesYour client secret, appsec_ followed by 64 characters.
resourceNohttps://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
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
200 OK
{
    "access_token": "3f9a...c41e",
    "token_type": "Bearer",
    "expires_in": 86400,
    "refresh_token": "b07d...92aa",
    "scope": "store:read orders:read",
    "store_id": "234567890123456789"
}
FieldDescription
access_tokenThe app access token, 64 characters. Send it as a Bearer token.
expires_inHow long the access token lasts, in seconds.
refresh_tokenThe token you trade for the next pair. It works once.
scopeThe permissions the token carries, separated by spaces.
store_idThe store the tokens belong to.
Take the store from 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
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
TokenLastsRule
Authorization code60 secondsWorks once.
Access token24 hoursAfter a refresh, the access token you held before keeps working until its own 24 hours end.
Refresh token90 daysWorks 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 503 with temporarily_unavailable. Keep your refresh token and try later.
  • When the merchant uninstalls your app, its tokens stop working at once.

Revoking a Token

POSThttps://mcp.storeep.com/oauth/revoke

To 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
curl -X POST "https://mcp.storeep.com/oauth/revoke" \
  -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
  -d token=YOUR_REFRESH_TOKEN

The 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

  1. Start a new version, turn the permission on in its Version tab, and get the version approved.
  2. Your tokens keep the permissions they had. A call that needs the new one answers 403 with insufficient permissions, requires: ....
  3. 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.
  4. 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
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

EndpointPermissionDescription
GET /v1/storestore:readThe store, its markets and currencies, its plan and its custom order statuses. See Store and Customers.
GET /v1/customerscustomers:readCustomers with their order count and lifetime value.
GET /v1/productsproducts:readProducts, see Products.
POST /v1/productsproducts:writeCreates a product, as a draft unless is_published is true.
PATCH /v1/products/{id}products:writeEdits the name, description, SEO fields, flags, gallery, and the stock and price of each option.
POST /v1/products/stockproducts:writeSets the stock of a product's options.
GET /v1/mediamedia:readThe files of the media library, newest first. See Media.
POST /v1/mediamedia:writeUploads one image.
GET /v1/ordersorders:readOrders, see Orders.
PATCH /v1/orders/{id}orders:writeMoves an order to a new status.
POST /v1/orders/notesorders:writeAdds a note to an order's timeline, under your app's name.
GET, PUT /v1/app-dataNoneYour app settings for this store, see App Settings.
GET, POST, DELETE /v1/app-webhooksThe one of the eventYour 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 422 with 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

StatusMessageWhat to do
401access token has expiredRefresh the token.
401access token has been revokedA refresh token was used twice. Send the merchant through authorization again.
401access token is invalidThe 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.
401this app is suspendedStoreep has paused your app. Every token stops working until the pause is lifted. Keep your tokens, and see Review and Publishing.
401this app has no approved versionSubmit a version for review. Until it is approved, your app runs on your development stores only.
403insufficient 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.