SellSN API docs
HomeHelpStatus
  • Introduction
  • Embeds
  • Webhooks
  • API reference
    • Authorization
    • Users
    • Stores
    • Orders
    • Products
    • Product groups
    • Tickets
    • Coupons
    • Miscellaneous objects
  • OAuth2
    • Credentials
    • Permissions
    • Authorizing users
Powered by GitBook
On this page

Was this helpful?

  1. OAuth2

Authorizing users

PreviousPermissions

Last updated 8 months ago

Was this helpful?

Step 1. Redirecting users to SellSN

You'll need to redirect your users to SellSN to begin the authorization process, you can use the following URL template to do so.

https://dash.sellsn.io/oauth2/[App ID]

You can pass more arguments to the login page, find below a table of all the URL query parameters you can set

Parameter
Required?
Example
Description

redirectUrl

https://my-site.com/return/sellsn

The authorized return URL to redirect users to after authorization has completed.

state

abc

The state to pass down to the redirect URL once authorized, can store specific values that might be useful to your application.

Step 2. Handling the return

Next, you'll need to exchange the returned access code for an API key to access the users account.

Once authorized, the user will be redirected to the given redirect URL in the previous step and we'll automatically add the following query parameters to the URL which you will need to perform the access code exchange process.

Parameter
Description

code

The access code for the exchange process, lasts 1 minute after issuance.

state

The state from the previous step (if provided).

Now, you can make a request to our API to get an API key to access the users account.

You need to provide your OAuth2 client secret only for the exchange access code request in the XOAuth2-Client-Secret header or your request will not be authorized.

And voila, you should have a valid JWT API key for the user in the data field of the exchange response.

Step 3. Using the API key

You from now can use the API key issued to access any endpoint that your app has permissions to access which is previously defined in your app settings. For example if I have users.view permissions then I can make a request to the Get User endpoint as seen below as long as I pass the API key in the Authorization header, for example Authorization: Bearer abc

Exchange access code

get

Exchanges the given access code for the OAuth2 application into an API key

Authorizations
Path parameters
appIdstring · uuidRequired

The ID of the OAuth2 application

codestringRequired

The access code to exchange into an API key

Responses
200
The object was successfully returned.
401
The OAuth2 client secret or access code is invalid
403
The OAuth2 client secret or access code is invalid
404
The OAuth2 application ID was not found
get
GET /oauth2/{appId}/exchange/{code} HTTP/1.1
Host: api.sellsn.io
Authorization: Bearer JWT
Accept: */*
{
  "success": true,
  "message": "text",
  "data": "text"
}

Get user

get

Gets the currently signed-in user account data, requires the Scopes.ViewUser permission

Authorizations
Responses
200
The object was successfully returned.
401
You are not authorized, check your API key and try again.
403
You are not authorized to access this endpoint, you may be missing an API key scope or be requesting a privileged endpoint.
get
GET /user HTTP/1.1
Host: api.sellsn.io
Authorization: Bearer JWT
Accept: */*
{
  "success": true,
  "message": "text",
  "data": {
    "id": "text",
    "dateCreated": "2025-05-21T13:30:01.620Z",
    "plan": "text",
    "setupCompletionState": 0,
    "disabledPaymentMethods": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "email": "text",
    "userName": "text",
    "allowMarketplace": true,
    "stores": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "dateCreated": "2025-05-21T13:30:01.620Z",
        "name": "text",
        "description": "text",
        "url": "\n                store\n            ",
        "customDomain": "text",
        "termsOfService": "text",
        "copyright": "text",
        "privacyPolicy": "text",
        "preferredCurrency": "text",
        "isVerified": true,
        "prependProductNameToReceipt": true,
        "featuredProduct": {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "dateCreated": "2025-05-21T13:30:01.620Z",
          "name": "text",
          "description": "text",
          "tags": [
            "text"
          ],
          "imageNames": [
            "text"
          ],
          "cost": 1,
          "type": 0,
          "subscriptionPeriod": "text",
          "stock": 1,
          "amountSold": 1,
          "ignoreOutOfStock": true,
          "isPinned": true,
          "isDynamic": true,
          "rating": 1,
          "minimumQuantity": 1,
          "maximumQuantity": 1,
          "order": 1,
          "visibility": 0,
          "likes": 1,
          "customValueKeys": [
            "text"
          ],
          "store": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "dateCreated": "2025-05-21T13:30:01.620Z",
            "name": "text",
            "description": "text",
            "url": "\n                store\n            ",
            "customDomain": "text",
            "termsOfService": "text",
            "copyright": "text",
            "privacyPolicy": "text",
            "preferredCurrency": "text",
            "isVerified": true,
            "prependProductNameToReceipt": true,
            "featuredProduct": "[Circular Reference]",
            "visits": 1,
            "reviews": 1,
            "rating": 1,
            "resolvedTickets": 1,
            "productsSold": 1,
            "theme": {
              "properties": {
                "ANY_ADDITIONAL_PROPERTY": "text"
              }
            },
            "socialMediaAccounts": {
              "tikTok": "text",
              "youTube": "text",
              "twitter": "text",
              "facebook": "text",
              "discord": "text",
              "telegram": "text",
              "instagram": "text"
            },
            "profileImage": "text",
            "scopes": [
              "text"
            ],
            "isDiscordBotConfigured": true,
            "domain": "text"
          },
          "discordRoleId": 1,
          "requireDiscordAuthorization": true,
          "useDiscordIntegration": true
        },
        "visits": 1,
        "reviews": 1,
        "rating": 1,
        "resolvedTickets": 1,
        "productsSold": 1,
        "theme": {
          "properties": {
            "ANY_ADDITIONAL_PROPERTY": "text"
          }
        },
        "socialMediaAccounts": {
          "tikTok": "text",
          "youTube": "text",
          "twitter": "text",
          "facebook": "text",
          "discord": "text",
          "telegram": "text",
          "instagram": "text"
        },
        "profileImage": "text",
        "scopes": [
          "text"
        ],
        "isDiscordBotConfigured": true,
        "domain": "text"
      }
    ],
    "twoFactorEnabled": true,
    "discordWebhookUrl": "text",
    "lastPasswordUpdate": "2025-05-21T13:30:01.620Z",
    "cashAppOptions": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "dateCreated": "2025-05-21T13:30:01.620Z",
      "isEnabled": true,
      "email": "text",
      "verificationCode": "text",
      "isAcceptingRequests": true,
      "tag": "text"
    },
    "payPalOptions": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "dateCreated": "2025-05-21T13:30:01.620Z",
      "isEnabled": true,
      "isFriendsAndFamilyEnabled": true,
      "isAcceptingRequests": true,
      "email": "text",
      "payPalEmail": "text"
    },
    "disabled": true,
    "planExpiry": "2025-05-21T13:30:01.620Z",
    "enabledCryptocurrencies": [
      "text"
    ],
    "stripeOptions": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "dateCreated": "2025-05-21T13:30:01.620Z",
      "isEnabled": true,
      "publishableKey": "text"
    },
    "ownedReferralLink": "text",
    "referralLink": "text",
    "atlasReports": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "dateCreated": "2025-05-21T13:30:01.620Z",
        "email": "text",
        "reason": "text",
        "gateway": "text",
        "reporter": "text",
        "resolved": true,
        "type": "text",
        "userId": "text"
      }
    ],
    "stripeEnabled": true,
    "apiKeyActive": true,
    "isCryptoEnabled": true,
    "isCardsToCryptoEnabled": true,
    "isSumUpEnabled": true,
    "isTazaEnabled": true,
    "refreshAt": "2025-05-21T13:30:01.620Z"
  }
}
  • Step 1. Redirecting users to SellSN
  • Step 2. Handling the return
  • GETExchange access code
  • Step 3. Using the API key
  • GETGet user