Developer ToolsFree generatorPDF, Excel, Word exportSAP Business OneAll SAP Business One tools

SAP Business One Service Layer Request Builder

The Service Layer is the REST and OData interface of SAP Business One, running as the b1s service on top of the database. This builder writes the usual requests so you can paste them into Postman, curl or an HTTP client.

Fill in

Generated code
Free, optional. Reopen it on any device.
Download:

1. Login (returns the B1SESSION cookie)

POST https://b1server.example.com:50000/b1s/v1/Login
Content-Type: application/json

{
  "CompanyDB": "SBODEMOUS",
  "UserName": "manager",
  "Password": "<password>"
}

2. Read an item with selected fields

GET https://b1server.example.com:50000/b1s/v1/Items('FG-1001')?$select=ItemCode,ItemName,InventoryItem,ItemWarehouseInfoCollection
Cookie: B1SESSION=<session id from login>

3. Find open sales orders of a customer

GET https://b1server.example.com:50000/b1s/v1/Orders?$select=DocEntry,DocNum,CardCode,DocDueDate,DocumentStatus&$filter=CardCode eq 'C20000' and DocumentStatus eq 'bost_Open'&$orderby=DocDueDate
Cookie: B1SESSION=<session id from login>

4. Create a sales order

POST https://b1server.example.com:50000/b1s/v1/Orders
Content-Type: application/json
Cookie: B1SESSION=<session id from login>

{
  "CardCode": "C20000",
  "DocDueDate": "2026-11-15",
  "DocumentLines": [
    {
      "ItemCode": "FG-1001",
      "Quantity": 25,
      "WarehouseCode": "01"
    }
  ]
}

5. Create a production order

POST https://b1server.example.com:50000/b1s/v1/ProductionOrders
Content-Type: application/json
Cookie: B1SESSION=<session id from login>

{
  "ItemNo": "FG-1001",
  "PlannedQuantity": 25,
  "DueDate": "2026-11-15",
  "Warehouse": "01",
  "ProductionOrderType": "bopotStandard"
}

6. Logout

POST https://b1server.example.com:50000/b1s/v1/Logout
Cookie: B1SESSION=<session id from login>

Entity and property names follow the Service Layer metadata (check /b1s/v1/$metadata on your server) and vary slightly by version. Port 50000 is the common default. Use a dedicated integration user and never paste real passwords into shared files.

Review of your Business One integration design

Optional: a short review of how your integration handles sessions, errors and approvals.

Optional. The tool and every export work without this. No spam.

Was this tool useful?

How the session works

You call Login once with the company database, user and password. The response sets a B1SESSION cookie, which every later request must send. Sessions time out after a period of inactivity, so long-running integrations should catch a 401 and log in again. Always call Logout when a batch finishes, because each session holds a licence slot.

  • Login once per batch, reuse the cookie
  • Handle session timeout by re-login
  • Logout frees the licence
  • Use $metadata to confirm entity names

Querying with OData options

Use $select to return only the fields you need, $filter for conditions, $orderby for sorting and $top or $skip for paging. The server returns pages and a next link when the result is large, so a loop must follow that link rather than assuming one response. Filter strings use eq, ne, gt, and and or, with text values in single quotes.

Creating documents safely

A POST to Orders or ProductionOrders runs the same validations as the client, so required fields, series and approval procedures apply. Test in a copy of the database first. Expect errors for closed periods, frozen items and missing warehouses, and log the response body, since it carries the B1 error code and message.

Frequently Asked Questions

What is the default Service Layer port?

Commonly 50000 for the Service Layer on HANA and SQL Server installations, served over HTTPS. Your administrator may have changed it or placed a load balancer in front, so confirm the actual URL with the server team.

Does the Service Layer use my B1 license?

Yes. Each session logged in as a B1 user consumes a license of the type assigned to that user, so use a dedicated integration user and log out when the work is done.

How do I page through large results?

Use $top and $skip, or follow the odata.nextLink the server returns. The server applies its own maximum page size, so do not assume that all rows arrive in one response.

Can I call the Service Layer from a browser?

Technically yes, but it needs CORS configuration and exposes credentials. Calls normally go from a backend service that holds the credentials and applies its own access rules.

Building an integration between Business One and your shop floor, portal or AI agents? Netray can help design it with human approval on any write-back.

Get SAP Business One alerts

Support and maintenance deadlines, release changes that affect SAP Business One sites, and new free SAP Business One tools. A couple of emails a month at most.

Free. Unsubscribe with one click from any email.

ArchRay builder
Design the on-prem AI stack for SAP Business One: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

New to SAP Business One? Start with the SAP Business One guide and toolkit.

Keep exploring

Free tools

ERP fixes and how-tos

Runs with your ERP

AI on your ERP

Integrations

Comparisons

Software