> For the complete documentation index, see [llms.txt](https://docs.ecwid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecwid.com/changelog/september-2025/september-19/store-id-is-now-required-for-external-apps-authentication.md).

# Store ID is now required for external apps' authentication

{% hint style="danger" %}
**Breaking changes!**\
When released, the changes listed below will break some apps' logic. Please update your apps to ensure they are ready for the change.
{% endhint %}

#### What's new

A small addition to the authentication flow for external apps. When a user installs the app, you now receive not only the **temporary code**, but also the **store ID** on your server. And to obtain the access token for that store, you need to pass both the **code** and **store ID** in the following <mark style="color:blue;">`POST`</mark> request.

{% content-ref url="/spaces/uOzT5egoVTAjMJwRuMQT/pages/AFVM0V8oFIdw8c7C5bft" %}
[Native and external apps](/launch-apps/native-and-external-apps.md)
{% endcontent-ref %}

#### Changes in API

Before the change, incoming token requests looked like:

```
https://www.example.com/myapp?code=abcd123456
```

where:

* `https://www.example.com/myapp`  is the **redirectUrl**
* `abcd123456`  is the **code**

Now incoming requests have an additional parameter:

```
https://www.example.com/myapp?code=abcd123456&store_id=1003 
```

where:

* `1003` is the store ID from which the installation was triggered

And here is how your following request for the access token should look:

```http
POST /api/oauth/token/{store_id} HTTP/1.1
Host: my.ecwid.com
Content-Type: application/x-www-form-urlencoded

client_id={client_id}&client_secret={client_secret}&code={code}&redirect_uri={redirect_uri}&grant_type=authorization_code
```

The only change here is the new **{store\_id} param** passed in the request path.

#### Timeline

For now, we support both the old and the new flows for external apps' authentication. We recommend updating your applications now.

The old flow will be disabled **in \~5-6 months**. However, we'll monitor non-updated apps and notify developers before shutdown.

#### How to update the app

1. Check if your app is an external app. External applications handle the authentication process (when users install the app) on their side and have a **redirectUrl** specified in the app dashboard.
2. Make sure your **redirectUrl** parses both `code` and `store_id` query params from incoming requests.
3. Add `/{store_id}` path param to the follow-up call.\
   So it looks like <mark style="color:blue;">`POST`</mark> `/api/oauth/token/{store_id}` \
   instead of <mark style="color:blue;">`POST`</mark> `/api/oauth/token`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecwid.com/changelog/september-2025/september-19/store-id-is-now-required-for-external-apps-authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
