---
title: Session ID
slug: session-id
docTags: 
createdAt: 2023-12-18T15:20:10.096Z
---

This section explains the process of generating a Session ID through our UpStart Commerce Management APIs.

## Generate a Session ID

### Step 1: Create an Account on the UpStart Commerce Portal

To initiate the Session ID generation process, you must first have an account on the UpStart Portal. If you have not registered yet, create an account by visiting [this link.](https://sandbox.nochannel.io/setup/create)

### Step 2: Obtain Tenant ID and Session ID

For authorization, you will require two parameters **Tenant ID** and **Session ID**.

1. **For Tenant ID and Site ID:&#x20;**&#x59;ou can create a valid X-Upstart-tenant and X-Upstart-site by visiting [this link](https://sandbox.nochannel.io/setup/create) or you can request the UpStart Commerce Support Team to create it for you. After successfully obtaining them, replace your specific Tenant ID and Site ID in the authorization field.
2. **For Session ID:&#x20;**&#x4D;ake the relevant API call to automatically generate a Session ID by using the `Curl` below.

**Request:**

```curl
curl --location 'https://nochannel-test-1-api.nochannel-test.upstart.team/v1/user/session-login' \
--header 'Content-Type: application/json' \
--header 'Cache-Control: no-cache' \
--header 'X-Upstart-tenant:<your-tenantid>' \
--data '{
	"login": "test",
	"tenant": "<your-tenantid>",
	"site": "<your-siteid>",
	"password": "<your-password>"
}'
```

:::hint{type="info"}
For more information, go to the [obtain Session ID](https://apidocs.upstartcommerce.com/docs/user-svc/b7470480b133f-session-login-user) endpoint example request.
:::

### Step 3: Check the Status Code

Upon making a Session ID creation request, it responds with a status code indicating the outcome.

- **Success (HTTP 200):**
  The server has successfully processed your request.
- **Error Responses:**
  **HTTP 401:** The server was unable to process the request. Check and ensure that the provided credentials are valid.
  **HTTP 403:** The request contains valid credentials, but the user's roles may be insufficient or the credentials may be expired.

**Response:**

```json
{
    "sessionId": "<your-sessionid>"
}
```

:::hint{type="warning"}
**Note**: For authorization, you will need two parameters **Tenant ID and Session ID**. Ensure to securely store these values for further API interactions.
:::

After executing the `Curl`, you have successfully generated a valid Session ID. Now, you can use this Session ID to further explore UpStart Commerce Management APIs.

## How to Use Session ID

You can utilize the generated Session ID in the header of your API request using the Authorization field. This step is crucial for authenticating and accessing UpStart Commerce APIs.

:::BlockQuote
**Header Key:**  X-Upstart-Session-Id
:::

:::BlockQuote
**Header Value:  &#x20;**\<your-sessionid>
:::

**Example API Request:**

Replace `<your-sessionid>` in the Authorization header with the actual X-Upstart-Session-Id obtained from response above.

![](https://api.archbee.com/api/optimize/Yc_G-eLlbuN1stqxAdHsJ/-FhlLotHXP5jlXj7-lSKx_image.png)

## Make Your First API Call with Session ID

To make your first call by using a Session ID, you need to add your Session ID, Site ID, and Tenant ID (created above) in the request header by using the `Curl` below.

**Request:**

```curl
curl --location 'https://nochannel-test-1-api.nochannel-test.upstart.team/v1/user/list' \
--header 'Accept: application/json' \
--header 'X-Upstart-tenant: <your-tenantid>;' \
--header 'X-Upstart-site: <your-siteid>;' \
--header 'X-Upstart-Session-Id: <SessionId obtained from step 2>;'
```

:::hint{type="info"}
For more information, go to the [Get Users by Tenant ID](https://apidocs.upstartcommerce.com/docs/user-svc/303e2f9c0d2f6-get-users-by-tenant) example request.
:::

**Response:**

```json
[
    {
        "id": "id",
        "login": " username",
        "name": "name",
        "userRoles": {
            "<tenantId>": {
                "roleIds": [
                    "tenant.admin"
                ],
                "sites": {
                    "<siteId>": {
                        "roleIds": []
                    }
                }
            }
        },
        "tenant": "<tenantId>",
        "emailAddress": "emailaddress@example.com",
        "registrationDate": "2023-10-20T15:49:37.738P",
        "lock": false,
        "system": true
    },
    {
        "id": "id",
        "login": "username",
        "name": "name",
        "userRoles": {
            "<tenantId>": {
                "roleIds": [
                    "portal.order.mgmt",
                    "portal.qa.mgmt",
                    "portal.customers.mgmt",
                    "portal.promotions.mgmt",
                    "portal.inventory.mgmt",
                    "portal.ratings.mgmt",
                    "portal.data-capture.mgmt",
                    "portal.data-feed.mgmt",
                    "portal.default",
                    "portal.shipping-carrier.mgmt",
                    "portal.cart.mgmt",
                    "portal.wishlist.mgmt",
                    "portal.clotho.mgmt",
                    "portal.pim.mgmt",
                    "portal.users.mgmt",
                    "portal.catalog.mgmt",
                    "portal.quotes.mgmt",
                    "portal.return-policy.mgmt",
                    "portal.locations.mgmt",
                    "portal.finance-offers.mgmt",
                    "portal.analytics.mgmt",
                    "portal.configurations.mgmt",
                    "portal.pricing-feed.mgmt"
                ],
                "sites": {
                    "<siteId>": {
                        "roleIds": []
                    }
                }
            }
        },
        "tenant": "<tenantId>",
        "emailAddress": "emailaddress@example.com",
        "registrationDate": "2024-12-21T15:09:42.300P",
        "lock": false,
        "system": false
    },
    {
        "id": "id",
        "login": "username",
        "name": "name",
        "userRoles": {
            "<tenantId>": {
                "roleIds": [
                    "portal.locations.mgmt",
                    "portal.default"
                ],
                "sites": {
                    "<siteId>": {
                        "roleIds": []
                    }
                }
            }
        },
        "tenant": "<tenantId>",
        "emailAddress": "emailaddress@example.com",
        "registrationDate": "2023-11-21T16:30:38.131Z",
        "lock": false,
        "system": false
    }
]
```

Upon receiving the successful response for the Get User by Tenant ID request, you have completed your first UpStart Commerce Management API call, using the Session ID.
