SAP B1 HTTP Request
AI-generatedSummary
Sends an arbitrary authenticated HTTP request (GET, POST, PATCH, PUT, DELETE) to any SAP Business One Service Layer endpoint, once per input item, and returns the response as the item's JSON.
Inputs
- Session Mode — 'auto' (default) logs in with the sapB1ServiceLayerApi credentials before the run and logs out afterwards. 'input' reuses a B1SESSION from an upstream SAP B1 Login node and does not log out.
- B1 Session (required) — B1SESSION cookie value. Only shown in 'input' mode. An empty value throws an error.
- B1 Route — ROUTEID cookie value for load-balanced Service Layer setups. Only shown in 'input' mode.
- Method — HTTP method: DELETE, GET (default), PATCH, POST or PUT.
- Endpoint (required) — Path relative to /b1s/{version}, e.g. /Orders or /BusinessPartners('C001').
- Send Query Parameters / Query Parameters — Name/value pairs added to the query string, e.g. $filter, $select, $top. Pairs with an empty name are skipped.
- Send Headers / Headers — Extra name/value request headers. They are applied after the defaults and can override them, including Cookie and Content-Type.
- Send Body / Body Content Type / Body (JSON) / Body (Raw) — Request body as JSON or raw string. JSON is parsed, and invalid JSON throws an error. The request is still sent with json: true and a Content-Type: application/json header.
- Service Layer Options — API Version (v2 default, or v1) sets the URL path. Case Insensitive adds the sap-case-insensitive: true header. Cross Company adds $crosscompany=true to the query string.
- Return Full Response — If true, the item's JSON is the full response (body, status code and headers) rather than just the body.
Output shape
One output item per input item. Each has the Service Layer response as json (the body, or the full response object if Return Full Response is on), paired to the input item.
No automatic pagination: OData collections return a single page, so use $top/$skip yourself or follow the nextLink. Empty responses such as 204 give an empty/undefined body. On a 401 the node logs in again with the stored credentials and retries once, even in 'input' mode. A re-login in input mode is not logged out afterwards. Other errors throw a NodeApiError with the item index, and the node has no continue-on-fail handling in its code. In auto mode the logout is best-effort and runs even if a request fails.
Examples
Example 1: Query open sales orders with a filter
Session Mode: Auto; Method: GET; Endpoint: /Orders; Send Query Parameters on with $filter=DocumentStatus eq 'bost_Open' and $select=DocEntry,CardCode.
Example 2: Create a business partner
Method: POST; Endpoint: /BusinessPartners; Send Body on, JSON: {"CardCode":"C001","CardName":"Acme"}.
Example 3: Run several calls on one session
SAP B1 Login upstream; Session Mode: Use Session from Input; B1 Session = {{ $('SAP B1 Login').item.json.b1Session }}; B1 Route = {{ $('SAP B1 Login').item.json.b1RouteId }}.