ballerinax/sap.businessone Ballerina library

1.0.1
Ballerina SAP Business One Connector

ballerinax/sap.businessone is a generic HTTP client for the SAP Business One Service Layer (OData V3).

It wraps ballerina/http:Client and transparently manages the Service Layer's session-based authentication:

  • Logs in with the configured company database, user name, and password (POST /Login).
  • Tracks the B1SESSION and ROUTEID cookies through the HTTP client's cookie store, so load-balanced Service Layer deployments work without extra configuration.
  • When a request fails with HTTP 401 (session expired — the Service Layer default timeout is 30 minutes), the client re-logs in and replays the request once.
  • ->logout() ends the session explicitly.

This package is the transport used by the ballerinax/sap.businessone.* module connectors (e.g. sap.businessone.sales, sap.businessone.inventory). Use it directly when you need an endpoint or query shape the module connectors don't expose.

Quickstart

Copy
import ballerinax/sap.businessone;

public function main() returns error? {
    businessone:Client b1 = check new ("https://localhost:50000/b1s/v1", {
        companyDb: "SBODEMOUS",
        username: "manager",
        password: "manager-password"
    });

    json orders = check b1->/Orders(headers = (), targetType = json, \$top = 5);
    check b1->logout();
}

Setup

Any SAP Business One on-premise installation (or B1 Cloud) with the Service Layer component installed exposes the endpoint at https://<host>:50000/b1s/v1. A valid B1 user with appropriate license and authorizations is required.

Import

import ballerinax/sap.businessone;Copy

Other versions

Metadata

Released date: 6 days ago

Version: 1.0.1

License: Apache-2.0


Compatibility

Platform: java21

Ballerina version: 2201.13.0

GraalVM compatible: Yes


Pull count

Total: 1362

Current verison: 304


Weekly downloads


Source repository


Keywords

Name/SAP Business One

Area/ERP & Business Operations

Vendor/SAP

Cost/Paid

Type/Connector

SAP Business One

Service Layer

OData

ERP


Contributors