sap-business-one-servicer-layer-sql
Sap Business One Servicer Layer Sql
Use this skill to produce correct HTTP requests to SAP Business One Service Layer and to troubleshoot common authentication, query, and batching failures.
Quick Start
- Require
BASE_URLbefore authentication. If missing, ask for it before continuing. - Log in with
POST {BASE_URL}/b1s/v1/LoginusingCompanyDB,UserName, andPassword. - Reuse both login cookies (
B1SESSIONandROUTEID) on every request. - Confirm a successful login by checking for
SessionIdandSessionTimeoutin the response body. - Apply OData options (
$select,$filter,$orderby,$top,$skip,$count) to reduce payloads. - Call
POST /b1s/v1/$batchfor multi-call orchestration and wrap write operations in a changeset. - Log out with
POST /b1s/v1/Logoutwhen the session is no longer needed.
Use this profile object when users reference known environments and no other credentials are provided:
{
"espomega": {
"CompanyDB": "****",
"UserName": "****",
"Password": "****"
},
"tripulse-demo": {
"CompanyDB": "****",
"UserName": "****",
"Password": "****"
},
"visca-chile": {
"CompanyDB": "****",
"UserName": "****",
"Password": "****"
}
}
Core Patterns
Authentication And Session
- Build login requests as
POST {BASE_URL}/b1s/v1/Login. - Treat Service Layer as cookie-session based authentication.
- Include both
B1SESSIONandROUTEIDin non-browser clients. - Handle
401with invalid-session symptoms by re-authenticating and retrying once.
Discoverability
- Avoid guessing endpoint names.
- Read
/{service-root}/$metadatabefore shaping requests to confirm entity sets, payload fields, and operation names. - Use
sml.svcfor Semantic Layer views, not standard object endpoints.
OData Query Options
- Use
$selectto restrict fields. - Use
$filterfor row filtering. - Use
$orderbyfor deterministic sorting. - Use
$topand$skipfor paging. - Use
$countwhen total count is required. - Use
$apply=groupby(...)/aggregate(...)for Semantic Layer aggregations when supported.
QueryService For Joined Filters
- Use
POST /b1s/v1/QueryService_PostQuerywhen filtering across joined entities. - Send
QueryPathwith$crossjoin(...). - Send
QueryOptionwith row-level filter/select rules.
Batch Orchestration
- Send
POST /b1s/v1/$batchwithContent-Type: multipart/mixed; boundary=.... - Keep subrequests ordered intentionally because processing is sequential.
- Put write requests inside a changeset to guarantee transactional behavior.
- Do not place
GETrequests inside a changeset. - Include
Content-IDfor OData v4 changesets and reference created entities with$<Content-ID>. - Do not attempt explicit rollback operations; rely on changeset transactional boundaries.
Configuration And CORS
- Read and edit Service Layer config in
ServiceLayer/conf/b1s.conf(JSON and case-sensitive). - Override selected options per request using
B1S-<OptionName>: <value>. - Enable browser access with CORS keys (
CorsEnable,CorsAllowedOrigins, optionallyCorsAllowedHeaders).
Reference
Use these sources in this order:
- Official SAP documentation (primary, real-time): https://help.sap.com/doc/0d2533ad95ba4ad7a702e83570a21c32/9.3/en-US/Working_with_SAP_Business_One_Service_Layer.pdf
- Local condensed guide:
references/service_layer.md
If behavior is ambiguous, read the official SAP PDF first and then apply local patterns.
More from rcrespo-tripulse/tripulse-skills
living-docs
Generate and maintain living documentation for microservices by analyzing current code state and Git history when needed. Trigger when users ask to document a service, update docs after changes, compare branches, generate changelogs, audit doc freshness, sync docs to central repo, migrate legacy docs, create flow docs, ADRs, or system overviews. Trigger phrases: 'document [service]', 'document-branch', 'document-commits', 'sync', 'audit', 'migrate-legacy', 'document-flow', 'create-adr', 'system-overview', 'documenta', 'qué cambió', 'actualizar docs', 'generar changelog', 'release notes', 'living docs'.
11skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
5planning-with-files
Implements Manus-style file-based planning to organize and track progress on complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when asked to plan out, break down, or organize a multi-step project, research task, or any work requiring >5 tool calls. Supports automatic session recovery after /clear.
4typescript-advanced-types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
4prompt-engineering-patterns
Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production. Use when optimizing prompts, improving LLM outputs, or designing production prompt templates.
4dev-specs
Provide reusable Markdown specification templates for software delivery, starting with a functional specification document. Use when asked to create, draft, fill, adapt, or standardize development specs, functional specs, technical specs, acceptance criteria, scope documents, or requirements documents for a feature, module, API, workflow, or project.
1