How to Generate an Access Token in SAP B1? – SAP B1 User Guide

Table of Contents

Overview

SAP Business One or SAP B1 is a single self-contained solution that provides all the ERP requirements of small and medium-sized businesses and is affordable. This application covers all aspects of a business, including sales, financials, vendor relationships, CRM, procurement, inventory, manufacturing, project tracking, reporting, and planning.

In this tutorial, we’d like to demonstrate How to Generate an Access Token in SAP B1 for beginners. Please, keep watching.

Step 1: Going to your SAP B1 login dashboard

First of all, from the SAP B1 login dashboard. It is essential to note some information we need for SAP B1 authentication.

Including:

  • Base URL: Your SAP B1 URL
  • Business Database (CompanyDB): Open the Company window to see the full text of CompanyDB.
  • Username
  • Password
Step 1: Going to your SAPB1 login dashboard

Login to make sure that it’s still working well

Step 2: Verifying Credential

First, go to the Postman. Then, create a new POST with the Base URL:

https://sapb1.beehexa.com:50000/b1s/v1/Login

You need to click on the Body section, then tick at “raw” to fill in the data; remember to change the “text” to “JSON”.

beehexa_Step 2: Verifying Credential

Now, you need to declare the information:

  • Business Database
  • User Name
  • Password

I will show you our example below

{
"CompanyDB": "SBODemoUS",
"UserName": "hexasync",
"Password": "Admin@123"
}

After filling in all the information, select the setting and turn off “Enable SSL certificate verification.”

Click the send button to send the request.

As a result, the Postman will return the access token of your Sap Business One.

{
    "odata.metadata": "https://sapb1.beehexa.com:xxxxx/b1s/v1/$metadata#B1Sessions/@Element",
    "SessionId": "91bfa664-34a8-11ed-8000-0a0027000007",
    "Version": "1000160",
    "SessionTimeout": 30
}

We have successfully generated an access token in Sap Business One. 

Step 3: Retrieve inventory data in SAP B1

Now, Let’s try to retrieve inventory data from The Session ID

Create a new GET with the URL:

https://sapb1.beehexa.com:50000/b1s/v1/Items

Select the setting, and turn off “Enable SSL certificate verification.”

Click send button to send the request

Response: The API will return the data like this.  

Step 3: Retrieve inventory data

The above are all steps to Generate an Access Token in SAP B1.

Thank you for watching our video. If you want to know more about SAP B1, please let us know or refer to our BigCommerce API documentation if you have any questions about API.

I hope you can achieve it!

These steps will be shown visually in the video below.