Actions
The ballerinax/sap.businessone.production package exposes the following clients:
Available clients:
| Client | Purpose |
|---|---|
Client | Manage SAP Business One production and MRP objects — bills of materials, production orders, resources, resource capacities and groups, routing stages, and sales forecasts — via the Service Layer OData API. |
Client
The Client provides access to all production and MRP objects exposed by the SAP Business One Service Layer — bills of materials (product trees), production orders, resources, resource capacities, resource groups, resource properties, route stages, routing date calculations, and sales forecasts.
Configuration
Session credentials (businessone:SessionConfig, from ballerinax/sap.businessone)
| Field | Type | Default | Description |
|---|---|---|---|
companyDb | string | Required | The SAP Business One company database to connect to |
username | string | Required | The SAP Business One user name |
password | string | Required | The SAP Business One user's password |
ConnectionConfig
| Field | Type | Default | Description |
|---|---|---|---|
httpVersion | http:HttpVersion | http:HTTP_2_0 | The HTTP version understood by the client |
http1Settings | http:ClientHttp1Settings | | Configurations related to HTTP/1.x protocol |
http2Settings | http:ClientHttp2Settings | | Configurations related to HTTP/2 protocol |
timeout | decimal | 30 | The maximum time to wait (in seconds) for a response before closing the connection |
forwarded | string | "disable" | The choice of setting forwarded/x-forwarded header |
followRedirects | http:FollowRedirects | Required | Configurations associated with Redirection |
poolConfig | http:PoolConfiguration | Required | Configurations associated with request pooling |
cache | http:CacheConfig | | HTTP caching related configurations |
compression | http:Compression | http:COMPRESSION_AUTO | Specifies the way of handling compression (accept-encoding) header |
circuitBreaker | http:CircuitBreakerConfig | Required | Configurations associated with the behaviour of the Circuit Breaker |
retryConfig | http:RetryConfig | Required | Configurations associated with retrying |
cookieConfig | http:CookieConfig | Required | Configurations associated with cookies |
responseLimits | http:ResponseLimitConfigs | | Configurations associated with inbound response size limits |
secureSocket | http:ClientSecureSocket | Required | SSL/TLS-related options |
proxy | http:ProxyConfig | Required | Proxy server related options |
socketConfig | http:ClientSocketConfig | | Provides settings related to client socket configuration |
validation | boolean | true | Enables the inbound payload validation functionality provided by the constraint package |
laxDataBinding | boolean | true | Enables relaxed data binding on the client side. nil values are treated as optional, and absent fields are handled as nilable types |
Initializing the client
import ballerinax/sap.businessone.production;
configurable string serviceUrl = ?;
configurable string companyDb = ?;
configurable string username = ?;
configurable string password = ?;
production:Client b1Client = check new (
{companyDb, username, password},
serviceUrl = serviceUrl
);
Operations
Product Trees (BOM)
listProductTrees
Queries the ProductTrees collection, returning a page of bill-of-materials entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListProductTreesHeaders | No | Prefer header for Service Layer paging control, e.g. odata.maxpagesize=100 |
queries | ListProductTreesQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: ProductTreesCollectionResponse|error
Sample code:
production:ProductTreesCollectionResponse trees = check b1Client->listProductTrees(
queries = {dollarTop: 10, dollarSelect: "TreeCode,TreeType,Quantity"}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ProductTrees",
"value": [
{"TreeCode": "A00001", "TreeType": "iProductionTree", "Quantity": 1}
]
}
createProductTrees
Creates a new ProductTree (product tree/BOM) entity.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ProductTree | Yes | The product tree to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: ProductTree|error
Sample code:
production:ProductTree created = check b1Client->createProductTrees({
TreeCode: "A00001",
TreeType: "iProductionTree",
Quantity: 1,
ProductTreeLines: [{ItemCode: "B00001", Quantity: 2}]
});
Sample response:
{
"TreeCode": "A00001",
"TreeType": "iProductionTree",
"Quantity": 1
}
getProductTrees
Retrieves a single ProductTree by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
treeCode | string | Yes | Key property TreeCode (Edm.String) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetProductTreesQueries | No | $expand, $select |
Returns: ProductTree|error
Sample code:
production:ProductTree tree = check b1Client->getProductTrees("A00001");
Sample response:
{
"TreeCode": "A00001",
"TreeType": "iProductionTree",
"Quantity": 1
}
deleteProductTrees
Deletes a ProductTree by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
treeCode | string | Yes | Key property TreeCode (Edm.String) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteProductTrees("A00001");
updateProductTrees
Partially updates a ProductTree using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
treeCode | string | Yes | Key property TreeCode (Edm.String) |
payload | ProductTree | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateProductTrees("A00001", {Quantity: 2});
Production Orders
listProductionOrders
Queries the ProductionOrders collection, returning a page of production order entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListProductionOrdersHeaders | No | Prefer header for Service Layer paging control |
queries | ListProductionOrdersQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: ProductionOrdersCollectionResponse|error
Sample code:
production:ProductionOrdersCollectionResponse orders = check b1Client->listProductionOrders(
queries = {dollarFilter: "ProductionOrderStatus eq 'boposReleased'", dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ProductionOrders",
"value": [
{"AbsoluteEntry": 101, "ItemNo": "B00001", "ProductionOrderStatus": "boposReleased", "PlannedQuantity": 10}
]
}
createProductionOrders
Creates a new ProductionOrder.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ProductionOrder | Yes | The production order to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: ProductionOrder|error
Sample code:
production:ProductionOrder order = check b1Client->createProductionOrders({
ItemNo: "B00001",
ProductionOrderType: "bopotStandard",
PlannedQuantity: 10,
DueDate: "2026-08-01",
Warehouse: "01"
});
Sample response:
{
"AbsoluteEntry": 101,
"ItemNo": "B00001",
"ProductionOrderStatus": "boposPlanned",
"PlannedQuantity": 10
}
getProductionOrders
Retrieves a single ProductionOrder by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetProductionOrdersQueries | No | $expand, $select |
Returns: ProductionOrder|error
Sample code:
production:ProductionOrder order = check b1Client->getProductionOrders(101);
Sample response:
{
"AbsoluteEntry": 101,
"ItemNo": "B00001",
"ProductionOrderStatus": "boposReleased",
"PlannedQuantity": 10
}
deleteProductionOrders
Deletes a ProductionOrder by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteProductionOrders(101);
updateProductionOrders
Partially updates a ProductionOrder using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
payload | ProductionOrder | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateProductionOrders(101, {DueDate: "2026-08-15"});
productionOrdersCancel
Invokes the bound action Cancel on a ProductionOrder (binding type ProductionOrder).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->productionOrdersCancel(101);
Resource Capacities
listResourceCapacities
Queries the ResourceCapacities collection, returning a page of resource capacity entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListResourceCapacitiesHeaders | No | Prefer header for Service Layer paging control |
queries | ListResourceCapacitiesQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: ResourceCapacitiesCollectionResponse|error
Sample code:
production:ResourceCapacitiesCollectionResponse capacities = check b1Client->listResourceCapacities(
queries = {dollarFilter: "Code eq 'R00001'", dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourceCapacities",
"value": [
{"Id": 1, "Code": "R00001", "Date": "2026-07-13", "Capacity": 8, "Type": "rctInternal"}
]
}
createResourceCapacities
Creates a new ResourceCapacity.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ResourceCapacity | Yes | The resource capacity to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: ResourceCapacity|error
Sample code:
production:ResourceCapacity capacity = check b1Client->createResourceCapacities({
code: "R00001",
date: "2026-07-13",
capacity: 8,
'type: "rctInternal"
});
Sample response:
{
"Id": 1,
"Code": "R00001",
"Date": "2026-07-13",
"Capacity": 8,
"Type": "rctInternal"
}
getResourceCapacities
Retrieves a single ResourceCapacity by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | int:Signed32 | Yes | Key property Id (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetResourceCapacitiesQueries | No | $expand, $select |
Returns: ResourceCapacity|error
Sample code:
production:ResourceCapacity capacity = check b1Client->getResourceCapacities(1);
Sample response:
{
"Id": 1,
"Code": "R00001",
"Date": "2026-07-13",
"Capacity": 8
}
deleteResourceCapacities
Deletes a ResourceCapacity by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | int:Signed32 | Yes | Key property Id (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteResourceCapacities(1);
updateResourceCapacities
Partially updates a ResourceCapacity using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | int:Signed32 | Yes | Key property Id (Edm.Int32) |
payload | ResourceCapacity | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateResourceCapacities(1, {capacity: 10});
resourceCapacitiesServiceGetList
Calls the ResourceCapacitiesService_GetList function import to get the full list of resource capacity parameter sets.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Additional request headers |
Returns: inline_response_200|error
Sample code:
production:inline_response_200 result = check b1Client->resourceCapacitiesServiceGetList();
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourceCapacitiesService_GetList",
"value": [
{"Code": "R00001", "Date": "2026-07-13", "Capacity": 8}
]
}
resourceCapacitiesServiceGetListWithFilter
Calls the ResourceCapacitiesService_GetListWithFilter function import to get a filtered list of resource capacity parameter sets.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ResourceCapacitiesService_GetListWithFilter_body | Yes | Filter parameters wrapping a ResourceCapacityWithFilterParams |
headers | map<string|string[]> | No | Additional request headers |
Returns: inline_response_200_1|error
Sample code:
production:inline_response_200_1 result = check b1Client->resourceCapacitiesServiceGetListWithFilter({
resourceCapacityWithFilterParams: {code: "R00001", 'type: "rctInternal", date: "2026-07-13"}
});
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourceCapacitiesService_GetListWithFilter",
"value": [
{"Code": "R00001", "Date": "2026-07-13", "Capacity": 8}
]
}
Resource Groups
listResourceGroups
Queries the ResourceGroups collection, returning a page of resource group entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListResourceGroupsHeaders | No | Prefer header for Service Layer paging control |
queries | ListResourceGroupsQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: ResourceGroupsCollectionResponse|error
Sample code:
production:ResourceGroupsCollectionResponse groups = check b1Client->listResourceGroups(
queries = {dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourceGroups",
"value": [
{"Code": 1, "Name": "Machines", "Type": "rtMachine"}
]
}
createResourceGroups
Creates a new ResourceGroup.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ResourceGroup | Yes | The resource group to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: ResourceGroup|error
Sample code:
production:ResourceGroup group = check b1Client->createResourceGroups({
name: "Machines",
'type: "rtMachine"
});
Sample response:
{
"Code": 1,
"Name": "Machines",
"Type": "rtMachine"
}
getResourceGroups
Retrieves a single ResourceGroup by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetResourceGroupsQueries | No | $expand, $select |
Returns: ResourceGroup|error
Sample code:
production:ResourceGroup group = check b1Client->getResourceGroups(1);
Sample response:
{
"Code": 1,
"Name": "Machines",
"Type": "rtMachine"
}
deleteResourceGroups
Deletes a ResourceGroup by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteResourceGroups(1);
updateResourceGroups
Partially updates a ResourceGroup using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
payload | ResourceGroup | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateResourceGroups(1, {name: "Heavy Machines"});
resourceGroupsServiceGetList
Calls the ResourceGroupsService_GetList function import to get the full list of resource group parameter sets.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Additional request headers |
Returns: inline_response_200_2|error
Sample code:
production:inline_response_200_2 result = check b1Client->resourceGroupsServiceGetList();
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourceGroupsService_GetList",
"value": [
{"Code": 1, "Name": "Machines"}
]
}
Resource Properties
listResourceProperties
Queries the ResourceProperties collection, returning a page of resource property entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListResourcePropertiesHeaders | No | Prefer header for Service Layer paging control |
queries | ListResourcePropertiesQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: ResourcePropertiesCollectionResponse|error
Sample code:
production:ResourcePropertiesCollectionResponse properties = check b1Client->listResourceProperties(
queries = {dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourceProperties",
"value": [
{"Code": 1, "Name": "Requires Certification"}
]
}
createResourceProperties
Creates a new ResourceProperty.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | ResourceProperty | Yes | The resource property to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: ResourceProperty|error
Sample code:
production:ResourceProperty prop = check b1Client->createResourceProperties({
name: "Requires Certification"
});
Sample response:
{
"Code": 1,
"Name": "Requires Certification"
}
getResourceProperties
Retrieves a single ResourceProperty by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetResourcePropertiesQueries | No | $expand, $select |
Returns: ResourceProperty|error
Sample code:
production:ResourceProperty prop = check b1Client->getResourceProperties(1);
Sample response:
{
"Code": 1,
"Name": "Requires Certification"
}
deleteResourceProperties
Deletes a ResourceProperty by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteResourceProperties(1);
updateResourceProperties
Partially updates a ResourceProperty using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
payload | ResourceProperty | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateResourceProperties(1, {name: "Certification Required"});
resourcePropertiesServiceGetList
Calls the ResourcePropertiesService_GetList function import to get the full list of resource property parameter sets.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Additional request headers |
Returns: inline_response_200_3|error
Sample code:
production:inline_response_200_3 result = check b1Client->resourcePropertiesServiceGetList();
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourcePropertiesService_GetList",
"value": [
{"Code": 1, "Name": "Requires Certification"}
]
}
Resources
listResources
Queries the Resources collection, returning a page of resource entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListResourcesHeaders | No | Prefer header for Service Layer paging control |
queries | ListResourcesQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: ResourcesCollectionResponse|error
Sample code:
production:ResourcesCollectionResponse resources = check b1Client->listResources(
queries = {dollarFilter: "Type eq 'rtMachine'", dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#Resources",
"value": [
{"Code": "R00001", "Name": "CNC Machine 1", "Type": "rtMachine"}
]
}
createResources
Creates a new Resource.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Resource | Yes | The resource to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: Resource|error
Sample code:
production:Resource resource = check b1Client->createResources({
Code: "R00001",
Name: "CNC Machine 1",
Type: "rtMachine"
});
Sample response:
{
"Code": "R00001",
"Name": "CNC Machine 1",
"Type": "rtMachine"
}
getResources
Retrieves a single Resource by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property Code (Edm.String) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetResourcesQueries | No | $expand, $select |
Returns: Resource|error
Sample code:
production:Resource resource = check b1Client->getResources("R00001");
Sample response:
{
"Code": "R00001",
"Name": "CNC Machine 1",
"Type": "rtMachine"
}
deleteResources
Deletes a Resource by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property Code (Edm.String) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteResources("R00001");
updateResources
Partially updates a Resource using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property Code (Edm.String) |
payload | Resource | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateResources("R00001", {Name: "CNC Machine 1 (Refurbished)"});
resourcesCreateLinkedItem
Invokes the bound action CreateLinkedItem on a Resource (binding type Resource), creating the linked inventory item for the resource.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Key property Code (Edm.String) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->resourcesCreateLinkedItem("R00001");
resourcesServiceGetList
Calls the ResourcesService_GetList function import to get the full list of resource parameter sets.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Additional request headers |
Returns: inline_response_200_4|error
Sample code:
production:inline_response_200_4 result = check b1Client->resourcesServiceGetList();
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#ResourcesService_GetList",
"value": [
{"Code": "R00001"}
]
}
Route Stages
listRouteStages
Queries the RouteStages collection, returning a page of route stage entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListRouteStagesHeaders | No | Prefer header for Service Layer paging control |
queries | ListRouteStagesQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: RouteStagesCollectionResponse|error
Sample code:
production:RouteStagesCollectionResponse stages = check b1Client->listRouteStages(
queries = {dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#RouteStages",
"value": [
{"InternalNumber": 1, "Code": "S1", "Description": "Cutting"}
]
}
createRouteStages
Creates a new RouteStage.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | RouteStage | Yes | The route stage to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: RouteStage|error
Sample code:
production:RouteStage stage = check b1Client->createRouteStages({
code: "S1",
description: "Cutting"
});
Sample response:
{
"InternalNumber": 1,
"Code": "S1",
"Description": "Cutting"
}
getRouteStages
Retrieves a single RouteStage by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
internalNumber | int:Signed32 | Yes | Key property InternalNumber (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetRouteStagesQueries | No | $expand, $select |
Returns: RouteStage|error
Sample code:
production:RouteStage stage = check b1Client->getRouteStages(1);
Sample response:
{
"InternalNumber": 1,
"Code": "S1",
"Description": "Cutting"
}
deleteRouteStages
Deletes a RouteStage by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
internalNumber | int:Signed32 | Yes | Key property InternalNumber (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteRouteStages(1);
updateRouteStages
Partially updates a RouteStage using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
internalNumber | int:Signed32 | Yes | Key property InternalNumber (Edm.Int32) |
payload | RouteStage | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateRouteStages(1, {description: "Cutting (updated)"});
routeStagesServiceGetList
Calls the RouteStagesService_GetList function import to get the full list of route stage parameter sets.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Additional request headers |
Returns: inline_response_200_5|error
Sample code:
production:inline_response_200_5 result = check b1Client->routeStagesServiceGetList();
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#RouteStagesService_GetList",
"value": [
{"InternalNumber": 1, "Code": "S1", "Description": "Cutting"}
]
}
Routing Date Calculation
routingDateCalculationServiceCalculate
Calls the RoutingDateCalculationService_Calculate function import to compute a resulting date/proportion for a routing stage over a given resource and date range.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | RoutingDateCalculationService_Calculate_body | Yes | Wraps a RoutingDateCalculationInput with the resource code, capacity sum, and date range |
headers | map<string|string[]> | No | Additional request headers |
Returns: RoutingDateCalculationOutput|error
Sample code:
production:RoutingDateCalculationOutput result = check b1Client->routingDateCalculationServiceCalculate({
routingDateCalculationInput: {
resourceCode: "R00001",
capacitySum: 16,
calculateFromDate: "2026-07-13",
calculateUntilDate: "2026-07-20",
resourceAlloc: "raStartDateForwards"
}
});
Sample response:
{
"Proportion": 0.5,
"ResultDate": "2026-07-15"
}
Sales Forecasts
listSalesForecast
Queries the SalesForecast collection, returning a page of MRP sales forecast entities.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListSalesForecastHeaders | No | Prefer header for Service Layer paging control |
queries | ListSalesForecastQueries | No | $skip, $top, $filter, $orderby, $expand, $inlinecount, $select |
Returns: SalesForecastCollectionResponse|error
Sample code:
production:SalesForecastCollectionResponse forecasts = check b1Client->listSalesForecast(
queries = {dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://host:50000/b1s/v1/$metadata#SalesForecast",
"value": [
{"Numerator": 1, "ForecastCode": "FC2026", "ForecastName": "2026 Forecast", "View": "fvtMonthly"}
]
}
createSalesForecast
Creates a new SalesForecast.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | SalesForecast | Yes | The sales forecast to create |
headers | map<string|string[]> | No | Additional request headers |
Returns: SalesForecast|error
Sample code:
production:SalesForecast forecast = check b1Client->createSalesForecast({
ForecastCode: "FC2026",
ForecastName: "2026 Forecast",
ForecastStartDate: "2026-01-01",
ForecastEndDate: "2026-12-31",
View: "fvtMonthly",
SalesForecastLines: [{ItemNo: "B00001", Warehouse: "01", Quantity: 100, ForecastedDay: "2026-08-01"}]
});
Sample response:
{
"Numerator": 1,
"ForecastCode": "FC2026",
"ForecastName": "2026 Forecast",
"View": "fvtMonthly"
}
getSalesForecast
Retrieves a single SalesForecast by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
numerator | int:Signed32 | Yes | Key property Numerator (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
queries | GetSalesForecastQueries | No | $expand, $select |
Returns: SalesForecast|error
Sample code:
production:SalesForecast forecast = check b1Client->getSalesForecast(1);
Sample response:
{
"Numerator": 1,
"ForecastCode": "FC2026",
"ForecastName": "2026 Forecast",
"View": "fvtMonthly"
}
deleteSalesForecast
Deletes a SalesForecast by its key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
numerator | int:Signed32 | Yes | Key property Numerator (Edm.Int32) |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->deleteSalesForecast(1);
updateSalesForecast
Partially updates a SalesForecast using PATCH/MERGE semantics.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
numerator | int:Signed32 | Yes | Key property Numerator (Edm.Int32) |
payload | SalesForecast | Yes | Fields to update |
headers | map<string|string[]> | No | Additional request headers |
Returns: error?
Sample code:
check b1Client->updateSalesForecast(1, {ForecastName: "2026 Forecast (Revised)"});
Session
logout
Ends the active SAP Business One Service Layer session.
Parameters:
None
Returns: error?
Sample code:
check b1Client->logout();