Docs

Build Your First App

This guide takes you from an empty developer profile to an app that merchants install from the Storeep app market. Each step is one action, and ends with what you should see when it worked.

What an App Is

A Storeep app is a web service that you build and host yourself. Storeep never runs your server code. A merchant installs your app from the app market and approves its permissions. Your server then works with that store in four ways:

WhatWhat it gives your appReference
REST APIRead and change the store's data, within the permissions the merchant approved.OAuth for Apps
App webhooksA signed request to your server when an order is placed, a checkout is abandoned and more.App Webhooks
UI extensionsYour app page inside the Storeep dashboard, described in JSON and drawn by Storeep.UI Extensions
Storefront scriptsOne reviewed JavaScript file that Storeep hosts and loads on every storefront page.Storefront Scripts

Your app uses only the parts it needs. Many apps need nothing more than the API and one webhook.

Words Used in These Docs

WordMeaning
MerchantThe person who runs a store. A store can also have staff members, who each sign in with their own account.
InstallOne app on one store. Each install has its own tokens, its own settings and its own webhook subscriptions.
Development storeA store you own. It runs your newest version, even a draft, with no review and no charge.
VersionThe addresses, permissions, price, script and listing of your app at one point in time. Storeep reviews a version as a whole. See Step 8.

What You Need

  • A Storeep account with at least one store of your own.
  • A server that answers over https://. On your own machine, a tunnel in front of your server is enough.
  • PHP 8.4 or Node.js 18 to run the examples as they are. Any language works.

Step 1: Join

Sign in to your Storeep dashboard and open Settings, then App development. Click Become a developer, fill in your profile and click Join.

FieldWhat it is for
Developer nameMerchants see it under each of your apps. Once you have submitted a version you cannot change it yourself: contact support to change it.
WebsiteYour own site, for example https://example.com. Merchants see it in your app's install window.
Privacy policyA link to the page that says what your app does with a store's data, for example https://example.com/privacy. Merchants see it before they install, and you need it to submit a version.
Support emailMerchants write to you here, and we send your review results to this address. We email it a code to confirm it. No code is needed when it is the email you sign in with.
You should see the App development window, with the note that you have not created any app yet.
You can build and test before you confirm your support email, but you cannot submit a version for review until it is confirmed. If the code expired, click Send a new code.

Step 2: Create the App

In App development, click Add new app. Enter a name, your App URL and one Redirect URI, then click Create.

You should see a window with three credentials. It is shown once, so copy all three now.
CredentialLooks likeWhat it is forWhere you find it again
Client IDapp_...Names your app in the OAuth flow. It is not a secret.The Credentials tab of your app.
Client secretappsec_...Proves to the token endpoint that a request comes from your server.Nowhere. Storeep keeps only a fingerprint of it.
Signing keywhsec_...Lets your server check that a webhook or a UI request really comes from Storeep.The Credentials tab of your app.

The Credentials tab also shows your App ID, a number such as 123456789012345678. You need it for the address of your app page and in your storefront script.

Keep the client secret and the signing key on your server only, for example in the environment variables STOREEP_CLIENT_SECRET and STOREEP_SIGNING_KEY. Never put them in a browser, a mobile app or a public repository.

Fill In the Version Tab

Your app opens on its Version tab. Enter your addresses:

FieldWhat it is forExample
App URLThe page a merchant lands on right after they install your app. Your app starts the authorization from it.https://example.com/storeep
Redirect URIsUp to 10 addresses, one per line, where Storeep sends the authorization code. Each must match the redirect_uri your app sends, character for character.https://example.com/storeep/callback
Webhook URLOptional. Where Storeep sends the events your app subscribes to. You need it for Step 5.https://example.com/storeep/webhooks
UI URLOptional. The address Storeep asks for your app page. You need it for Step 6.https://example.com/storeep/ui

Every address must start with https:// and carry no # part. The App URL and the Redirect URIs open in the merchant's browser, so https://localhost:3000/callback or an IP address works for them while you develop. Storeep's own servers call the Webhook URL and the UI URL, so both must be reachable from the public internet with a valid certificate. On your own machine, put a tunnel in front of your server and enter the tunnel's https:// address.

Then, under Permissions, turn on Read store details and Read orders, and click Save. A new app starts with no permission, and the authorization is refused until one is on. See Permissions for the full list.

You should see the message that the version has been saved, and the badge Draft beside your app's name.

Step 3: Install It on Your Development Store and Connect

Open one of your own stores in the dashboard. In Settings, then App development, open your app, open its Activity tab and click Install on this store. A draft is not listed on the Apps page, so this tab is where its install starts.

The install opens your App URL with the store's id, for example https://example.com/storeep?store=234567890123456789. From there your app runs the OAuth flow in three moves:

  1. Your App URL sends the merchant to the authorization page

    It creates a random state and a PKCE verifier, keeps both in the session, and redirects with the store id it received.

  2. The merchant approves

    The consent screen shows your app's name, the store, the permissions of your version and the address the merchant is sent back to. When the merchant clicks Connect, Storeep sends them to your Redirect URI with a code and your state.

  3. Your Redirect URI exchanges the code for tokens

    It checks the state, then posts the code, the verifier and your client credentials to the token endpoint. It keeps the tokens under the store_id of the answer, then sends the merchant to your app page.

install.php, your App URL
<?php

# encodes bytes as base64url without padding, the form pkce uses
function base64_url_encode(string $bytes): string
{
    # plain base64 of the bytes
    $base64 = base64_encode($bytes);

    # the url safe characters in place of base64's own
    $url_safe = strtr(string: $base64, from: '+/', to: '-_');

    # pkce drops the padding
    return rtrim(string: $url_safe, characters: '=');
}

# keeps the state and the verifier until storeep sends the merchant back
session_start();

# the store that just installed your app
$store_id = @$_GET['store'];

# storeep always names the store, a request without it did not come from an install
if (is_string($store_id))
{
    # 16 random bytes for the state
    $state_bytes = random_bytes(16);

    # a random state, checked on the way back so a forged callback is refused
    $state = bin2hex($state_bytes);

    # 48 random bytes for the verifier
    $verifier_bytes = random_bytes(48);

    # the pkce verifier, a secret only your server knows
    $verifier = base64_url_encode($verifier_bytes);

    # the verifier's sha256, as raw bytes
    $verifier_hash = hash(algo: 'sha256', data: $verifier, binary: true);

    # the S256 challenge storeep keeps until the token exchange
    $challenge = base64_url_encode($verifier_hash);

    # the verifier waits in the session under its state
    $_SESSION['oauth'][$state] = ['verifier' => $verifier];

    # your client, where storeep sends the merchant back, the state, the challenge, the store and the api the token is for
    $query = http_build_query([
        'response_type' => 'code',
        'client_id' => getenv('STOREEP_CLIENT_ID'),
        'redirect_uri' => 'https://example.com/storeep/callback',
        'state' => $state,
        'code_challenge' => $challenge,
        'code_challenge_method' => 'S256',
        'store' => $store_id,
        'resource' => 'https://api.storeep.com',
    ]);

    # sends the merchant to storeep's consent screen
    header('Location: https://app.storeep.com/oauth/authorize?' . $query);
}
# a missing store means the page was opened by hand
else exit;
callback.php, your Redirect URI
<?php

# reads the state and the verifier install.php kept
session_start();

# the state storeep sends back, the one install.php made
$state = @$_GET['state'];

# the code storeep sends back, traded for the tokens below
$code = @$_GET['code'];

# both come back when the merchant approves, a merchant who clicks Cancel sends error=access_denied instead of a code
if (is_string($state) && is_string($code))
{
    # the verifier this session kept for that state, null for a state it never made
    $pending = @$_SESSION['oauth'][$state];

    # a state works once, so a replayed callback finds nothing
    unset($_SESSION['oauth'][$state]);

    # a state this session never made means a forged callback
    if (is_array($pending))
    {
        # the code, the verifier and your client credentials
        $fields = http_build_query([
            'grant_type' => 'authorization_code',
            'code' => $code,
            'redirect_uri' => 'https://example.com/storeep/callback',
            'code_verifier' => $pending['verifier'],
            'client_id' => getenv('STOREEP_CLIENT_ID'),
            'client_secret' => getenv('STOREEP_CLIENT_SECRET'),
        ]);

        # the token endpoint
        $curl = curl_init('https://mcp.storeep.com/oauth/token');

        # answers as text, never waits more than 15 seconds and posts the fields
        curl_setopt_array(handle: $curl, options: [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 15,
            CURLOPT_POSTFIELDS => $fields,
        ]);

        # the answer's body
        $body = curl_exec($curl);

        # the status, checked before the body is read
        $status = curl_getinfo(handle: $curl, option: CURLINFO_RESPONSE_CODE);

        # anything but a 200 means the code expired or was already used
        if ($status === 200)
        {
            # the tokens as an array, null when the body is not json
            $answer = json_decode(json: (string) $body, associative: true);

            # a body that is not json is a failed exchange
            if (is_array($answer))
            {
                # when the access token runs out, as a unix time
                $expires_at = time() + $answer['expires_in'];

                # your own function: keeps the tokens under the store the answer names, never the one in the address
                save_tokens(store_id: $answer['store_id'], access_token: $answer['access_token'], refresh_token: $answer['refresh_token'], expires_at: $expires_at);

                # your app id, shown on the Credentials tab
                $app_id = getenv('STOREEP_APP_ID');

                # sends the merchant back to your app page in their dashboard
                header('Location: https://app.storeep.com/apps/' . $app_id);
            }
            else
            {
                # tells the merchant how to try again
                exit('Token exchange failed, install the app again.');
            }
        }
        else
        {
            # tells the merchant how to try again
            exit('Token exchange failed, install the app again.');
        }
    }
    else
    {
        # tells the merchant how to try again
        exit('Authorization failed, install the app again.');
    }
}
else
{
    # tells the merchant how to try again
    exit('Authorization failed, install the app again.');
}

save_tokens() is your own function. It stores the access token, the refresh token and the expiry time in your database, under the store id. Every later call to the API for that store reads them back.

You should see the consent screen, titled Connect followed by your app's name. A draft shows the warning Unverified on it, because Storeep has not reviewed the app yet. That is normal. Click Connect and you land on your app's window in the dashboard, at https://app.storeep.com/apps/123456789012345678. It stays empty until Step 6.

If the Request Is Refused

If the screen says the request was refused, it names the reason. While your version is a draft, the reason is shown to you on the screen itself. These three are the most common:

The screen saysWhat to do
the app version declares no permissionTurn on at least one permission on the Version tab and click Save.
redirect_uri is missing or is not one of the Redirect URIs saved on the Version tabMake the redirect_uri your app sends match a saved Redirect URI, character for character.
This app is not installed in this store, or you are not a member of it.Install the app on that store first, signed in as a member of it.

An access token lasts 24 hours. Before it runs out, your server trades the refresh token for a new pair, and keeps the new refresh token every time. OAuth for Apps has the request and every rule.

Step 4: Call the API

Send the access token as a Bearer token, with the date of the API version you built against:

cURL
curl "https://api.storeep.com/v1/store" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Storeep-Version: 2026-11-30"
You should see the status 200 and your store:
200 OK
{
    "data": {
        "store_id": "234567890123456789",
        "name": "My Test Store",
        "storefront_url": "https://example.com",
        "theme": "velvet",
        "time_zone": "Africa/Casablanca",
        "weight_unit": "kg",
        "is_published": true,
        "created_at": "2026-11-20 09:12:05",
        "plan": {
            "name": "starter",
            "term": null,
            "renews_at": null,
            "sales_remaining": null,
            "orders_remaining": null
        },
        "markets": [
            {
                "market_id": "234567890123456790",
                "market": "MA",
                "currency": "MAD",
                "symbol": "DH",
                "symbol_position": "after_space",
                "is_primary": true,
                "is_enabled": true
            }
        ],
        "custom_statuses": []
    }
}

A 401 or a 403 names what is wrong, see Error Handling. Every endpoint your app can call is listed on the Overview.

Step 5: Receive Webhooks

To hear about new orders as they happen, subscribe the store to the event. Your version needs a Webhook URL (Step 2), and the token needs the permission of the event, here Read orders. Subscribe each store once, for example right after the token exchange:

cURL
curl -X POST "https://api.storeep.com/v1/app-webhooks" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"event": "order-created"}'
You should see the status 201 and your subscription:
201 Created
{
    "data": {
        "id": "385064997585164584",
        "event": "order-created",
        "is_enabled": true
    }
}

Place a test order on your store. Within seconds your Webhook URL receives a POST whose type is order-created.

  • Check the Storeep-Signature header before you trust the body. Verifying Requests has a complete handler in PHP and in Node.js.
  • Answer with a 2xx status within 10 seconds, then do the slow work in the background.
  • Your app always receives app-uninstalled and customer-redact, with no subscription. Handle both, see App Webhooks.

Step 6: Draw Your App Page

With a UI URL on your version (Step 2), your app has its own page in the merchant's dashboard. When the merchant opens your app, Storeep sends a signed POST to that address, and your server answers with the page as JSON. Storeep draws it with its own components, so it looks like the rest of the dashboard:

Your answer
{
    "view": {
        "name": "settings",
        "actions": [
            { "type": "save", "action": "save" }
        ],
        "blocks": [
            { "type": "input", "name": "sender_name", "label": "Sender name", "value": "", "required": true }
        ]
    }
}
You should see a text field and a Save button when you open your app's window, at https://app.storeep.com/apps/123456789012345678 with your own app id. If the page does not show, the reason is listed under Recent page errors on the Activity tab of your app.

When the merchant saves, Storeep sends you the action with the fields. UI Extensions has a complete handler, the session token and every component.

Step 7: Ship a Storefront Script (Optional)

To add something to the storefront itself, upload one JavaScript file of up to 50 KB under Storefront script on the Version tab, and click Save. Storeep hosts the file and loads it on every page of the stores that install your app.

You should see your script run on the storefront of your development store, which loads the script of your draft. Every other store loads the script of your approved version only.

Storefront Scripts covers the limits, how the script reads its settings and the review rules.

Step 8: Prepare the Listing and Submit

A version holds the addresses, permissions, price, script and listing of your app. It is a Draft (you can change it), In review (locked), Live (running on every store, locked) or Rejected (you can change it and submit again). An app has one live version.

Before you submit, complete the version:

WhatWhereRule
IconVersion tabA square PNG, JPEG or WebP image of at least 144 pixels, up to 1 MB.
PermissionsVersion tabAt least one, and only the ones your app uses.
PricingVersion tabFree, or a monthly price in US dollars, with an optional free trial. See Pricing and Payouts.
Charges outside StoreepVersion tabNone, or the list of services you bill merchants for yourself, such as courier fees or SMS credits, and what each one pays for. Never the app's own features. See Pricing and Payouts.
ListingListing tabWhat merchants read in the app market, one row per language. English is required: a name of up to 60 characters, a description of 50 to 1,000 characters and up to 10 keywords of up to 30 characters each. Write in plain words. The em dash is not allowed.
Webhook URLVersion tabRequired when your app asks for Read orders or Read customers, so it can receive erasure requests.
ProfileDeveloper profileA confirmed support email and a privacy policy link.

Then click Submit for review.

You should see the badge In review beside your app's name. We email the result to your support email, usually within 2 working days.

A Storeep reviewer checks four things:

  • Each permission matches what your app does.
  • The listing is clear and reads naturally in each of its languages.
  • The storefront script, if any, stays small and behaves well.
  • Your privacy policy link works.

After You Submit

What happensWhat you do
You want to change a version that is in review.Click Withdraw from review. The version goes back to Draft, and you submit it again when it is ready.
The version is approved.Nothing. Its badge turns Live, your app is listed in the app market, and every store that installed it runs the new version.
The version is rejected.Its badge turns Rejected, and the Version tab shows a note titled What to change before you submit again. The same note is in the email. Fix what it names and submit again.

Updating a Live App

  • Click Start a new version. It starts as a copy of the live version.
  • The live version keeps running on every store until the new one is approved.
  • Your development stores run the new draft at once, so you can test it first.
  • To give up the new version, click Discard this draft. The live version keeps running.
  • A version that adds a permission does not change the tokens you already hold. Each merchant has to connect again to approve it: they click Connect again at the bottom of your app's window, or you send them to the authorization address. See Asking for a New Permission.

Review and Publishing covers what reviewers refuse, price changes, suspension and deleting an app.

Step 9: Get Paid

A paid app is billed through Storeep, so you never handle a card. The merchant pays from their Storeep wallet, you receive 80% of every charge, and Storeep writes your statement on the 1st of each month. Enter your payout details on the Earnings tab of App development. Pricing and Payouts has every rule, and One-Time Charges shows how to ask for a single payment, such as a pack of credits.

Rotating Your Secrets

Click Rotate secrets on the Credentials tab to get a new client secret and a new signing key.

After a rotation the previous client secret and signing key keep working for 24 hours, so you can deploy the new ones without downtime. Session tokens of your app page are signed with the new signing key at once, so deploy it right after you rotate. If a secret leaked, rotate, deploy, then click Stop the previous secrets now.

You cannot rotate again while the previous secrets still work. Verifying Requests shows how your server accepts both signing keys during those 24 hours.

Checklist Before You Submit

  • Your support email is confirmed and your profile has a privacy policy link.
  • The client secret and the signing key live on your server only.
  • Your app checks state, uses PKCE and reads the store from the token answer.
  • Your app refreshes its tokens and keeps the new refresh token every time.
  • Your webhook endpoint checks Storeep-Signature and answers with a 2xx status within 10 seconds.
  • Your app handles app-uninstalled and customer-redact.
  • You ask only for the permissions your app uses.
  • No address of the version points to localhost or an IP address.
  • The icon is set, and the English listing is complete and free of em dashes.
  • You installed and tested the newest version on your development store.

Reference