sap-business-one-servicer-layer-sql
SKILL.md
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.
Weekly Installs
4
Repository
rcrespo-tripuls…e-skillsFirst Seen
13 days ago
Security Audits
Installed on
opencode4
gemini-cli4
github-copilot4
codex4
kimi-cli4
cursor4