<ACCESS_TOKEN>
URL | Description |
---|---|
Authorization Endpoint | https://accounts.salla.sa/oauth2/auth This URL initiates the process of obtaining the merchant's permission for the App to access their store data on Salla. |
Token Endpoint | https://accounts.salla.sa/oauth2/token After the merchant grants permission, the App exchanges the authorization code for an access token at this endpoint. |
Redirect URI | https://client-app.com/callback Once the authentication process is complete, the authorization server redirects the user's browser to the registered redirect URI. |
Refresh Token Endpoint | https://accounts.salla.sa/oauth2/token If a refresh token is granted, this endpoint allows the client to obtain a new access token when the current one expires. |
User Info Endpoint | https://accounts.salla.sa/oauth2/user/info Once the authentication process is completed successfully, the Merchant details can be received via this endpoint. |
Query Parameter | Description | Example |
---|---|---|
client_id | Identifies the client application making the request, which values can be fetched from your application on the Salla Partners Portal. | 1311508470xxx |
client_secret | Identifies the client application making the request, which values can be fetched from your application on the Salla Partners Portal. | 362985662xxx |
response_type | Specifies the desired response type from the authorization server. | code |
redirect_uri | Indicates the URI for user redirection after completing the authorization process. | https://your-app.com/callback-url |
scope | Specifies the requested permissions or access levels. | offline_access |
state | Used to maintain state between the authorization request and the callback to prevent cross-site request forgery attacks. | 1234xxxx |
code | The authorization code returned by the authorization endpoint. | xxxxxxxx |
grant_type | Specifies the type of grant being used to authenticate the client. | authorization_code |
https://accounts.salla.sa/oauth2/auth?client_id=your_client_id&response_type=code&redirect_uri=https://client-app.com/callback&scope=read write&state=random_value
client_id=your_client_id
is appended to the authorization URL, where your_client_id should be replaced with the actual client ID issued by the authorization server.app-id
as a parameter. This URL can be used to initiate the app installation process. When the merchant clicks on the installation URL, the App will be automatically installed into their Salla Store.app.store.authorize
, and then the process of generating the “access token” will be handled automatically at Salla‘s side back to you via the Webhook URL specified in the Webhooks/Notifications your of your App.app.store.authorize
event.app.updated
event. After that, Salla sends you the app store.authorized
event, which provides you with the new access token and refresh token. This information will be delivered to you via webhook. Accordingly, you are required to update the access token and refresh token in your database.expires
variable is returned as a unix timestamp value for the app event app.store.authorize
.https://yourapp.com/callback?code={code-value}&scope={app-scopes}+offline_access&state={state-value}
POST
request with the required parameters to the token endpoint.• Access tokens expire after 2 weeks (14 days). |
• If you want to generate the refresh token, set the scope value as offline_access . E.G: scope = offline_access . |
• The expires variable is returned as seconds timestamp value |
• Upon obtaining the access token, developers can utilize the User Info endpoint URL, https://accounts.salla.sa/oauth2/user/info , to retrieve the Merchant details and store them alongside the access tokens. |