Skip to main content

Actions

The ballerinax/sap.businessone.projects package exposes the following clients:

Available clients:

ClientPurpose
ClientManage SAP Business One project management objects — financial project codes, project management projects, subprojects, configuration data, time sheets, and expense types — through the Service Layer OData API.

Client

The Client provides access to the project management objects of the SAP Business One Service Layer — financial project codes, project management projects (with their stages, activities, work orders, and open issues), subprojects, project management configuration (activities, areas, priorities, stage types, subproject types, tasks), time sheets, and expense types.

Configuration

SessionConfig

SAP Business One Service Layer session credentials, passed as the first argument to the client initializer.

FieldTypeDefaultDescription
companyDbstringRequiredThe SAP Business One company database to log in to
usernamestringRequiredThe Service Layer user name
passwordstringRequiredThe Service Layer user password

ConnectionConfig

Provides a set of configurations for controlling the behaviours when communicating with the Service Layer HTTP endpoint. Passed as the optional second argument to the client initializer.

FieldTypeDefaultDescription
httpVersionhttp:HttpVersionhttp:HTTP_2_0The HTTP version understood by the client
http1Settingshttp:ClientHttp1SettingsConfigurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2SettingsConfigurations related to HTTP/2 protocol
timeoutdecimal30The maximum time to wait (in seconds) for a response before closing the connection
forwardedstring"disable"The choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsOptionalConfigurations associated with redirection
poolConfighttp:PoolConfigurationOptionalConfigurations associated with request pooling
cachehttp:CacheConfigHTTP caching related configurations
compressionhttp:Compressionhttp:COMPRESSION_AUTOSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigOptionalConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigOptionalConfigurations associated with retrying
cookieConfighttp:CookieConfigOptionalConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigsConfigurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketOptionalSSL/TLS-related options
proxyhttp:ProxyConfigOptionalProxy server related options
socketConfighttp:ClientSocketConfigProvides settings related to client socket configuration
validationbooleantrueEnables the inbound payload validation functionality provided by the constraint package
laxDataBindingbooleantrueEnables relaxed data binding on the client side, treating nil values and absent fields as optional

The client also accepts a serviceUrl string parameter — the base URL of the target Service Layer instance — which defaults to https://localhost:50000/b1s/v1.

Initializing the client

import ballerinax/sap.businessone;
import ballerinax/sap.businessone.projects;

businessone:SessionConfig session = {
companyDb: "SBODemoUS",
username: "manager",
password: "<password>"
};

projects:Client client = check new (session, serviceUrl = "https://<host>:50000/b1s/v1");

Operations

Expense Types

listExpenseTypes

Query the ExpenseTypes collection.

Parameters:

NameTypeRequiredDescription
headersListExpenseTypesHeadersNoHeaders to be sent with the request, e.g. Prefer: odata.maxpagesize=100 to control server-side paging
queriesListExpenseTypesQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: ExpenseTypesCollectionResponse&#124;error

Sample code:

ExpenseTypesCollectionResponse response = check client->listExpenseTypes(queries = {dollarTop: 20});

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ExpenseTypes",
"value": [
{
"ExpenseType": "T001",
"ExpenseName": "Travel",
"ExpenseAccount": "_SYS00000001",
"VatGroup": "O0",
"PaidByCompany": "tYES"
}
],
"odata.nextLink": "ExpenseTypes?$skip=20"
}
createExpenseTypes

Create a new ExpenseTypeData entity in the ExpenseTypes collection.

Parameters:

NameTypeRequiredDescription
payloadExpenseTypeDataYesThe expense type to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ExpenseTypeData&#124;error

Sample code:

ExpenseTypeData created = check client->createExpenseTypes({
expenseType: "T002",
expenseName: "Accommodation",
expenseAccount: "_SYS00000002",
vatGroup: "O0",
paidByCompany: "tYES"
});

Sample response:

{
"ExpenseType": "T002",
"ExpenseName": "Accommodation",
"ExpenseAccount": "_SYS00000002",
"VatGroup": "O0",
"PaidByCompany": "tYES"
}
getExpenseTypes

Get a single ExpenseTypeData entity from the ExpenseTypes collection by key.

Parameters:

NameTypeRequiredDescription
expenseTypestringYesKey property 'ExpenseType' (Edm.String)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetExpenseTypesQueriesNoOData query options: $expand, $select

Returns: ExpenseTypeData&#124;error

Sample code:

ExpenseTypeData expense = check client->getExpenseTypes("T002");

Sample response:

{
"ExpenseType": "T002",
"ExpenseName": "Accommodation",
"ExpenseAccount": "_SYS00000002",
"VatGroup": "O0",
"PaidByCompany": "tYES"
}
deleteExpenseTypes

Delete a ExpenseTypeData entity from the ExpenseTypes collection.

Parameters:

NameTypeRequiredDescription
expenseTypestringYesKey property 'ExpenseType' (Edm.String)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteExpenseTypes("T002");
updateExpenseTypes

Partially update a ExpenseTypeData entity in the ExpenseTypes collection (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
expenseTypestringYesKey property 'ExpenseType' (Edm.String)
payloadExpenseTypeDataYesFields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateExpenseTypes("T002", {expenseName: "Accommodation & Lodging"});

Project Configuration — Activities

projectManagementConfigurationServiceAddActivities

Add activities to the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_AddActivities_bodyYesWraps a PMC_ActivityCollection array of PMCActivityData objects to add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceAddActivities({
pMCActivityCollection: [
{activityID: 10, activityType: "Site Visit", isChargeable: "tYES", laborItem: "LAB001", isAbsence: "tNO"}
]
});
projectManagementConfigurationServiceDeleteActivities

Delete activities from the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_DeleteActivities_bodyYesWraps a PMC_ActivityCollection array identifying the activities to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceDeleteActivities({
pMCActivityCollection: [{activityID: 10}]
});
projectManagementConfigurationServiceGetActivities

Get the activities defined in the project management configuration.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200&#124;error

Sample code:

inline_response_200 activities = check client->projectManagementConfigurationServiceGetActivities();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementConfigurationService_GetActivities",
"value": [
{"ActivityID": 10, "ActivityType": "Site Visit", "IsChargeable": "tYES", "LaborItem": "LAB001", "IsAbsence": "tNO"}
]
}
projectManagementConfigurationServiceUpdateActivities

Update activities in the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_UpdateActivities_bodyYesWraps a PMC_ActivityCollection array of PMCActivityData objects with the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceUpdateActivities({
pMCActivityCollection: [{activityID: 10, activityType: "Site Visit - Extended"}]
});

Project Configuration — Areas

projectManagementConfigurationServiceAddAreas

Add areas to the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_AddAreas_bodyYesWraps a PMC_AreaCollection array of PMCAreaData objects to add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceAddAreas({
pMCAreaCollection: [{areaID: 1, areaName: "Civil Works"}]
});
projectManagementConfigurationServiceDeleteAreas

Delete areas from the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_DeleteAreas_bodyYesWraps a PMC_AreaCollection array identifying the areas to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceDeleteAreas({
pMCAreaCollection: [{areaID: 1}]
});
projectManagementConfigurationServiceGetAreas

Get the areas defined in the project management configuration.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_1&#124;error

Sample code:

inline_response_200_1 areas = check client->projectManagementConfigurationServiceGetAreas();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementConfigurationService_GetAreas",
"value": [
{"AreaID": 1, "AreaName": "Civil Works"}
]
}
projectManagementConfigurationServiceUpdateAreas

Update areas in the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_UpdateAreas_bodyYesWraps a PMC_AreaCollection array of PMCAreaData objects with the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceUpdateAreas({
pMCAreaCollection: [{areaID: 1, areaName: "Civil & Structural Works"}]
});

Project Configuration — Priorities

projectManagementConfigurationServiceAddPriorities

Add priorities to the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_AddPriorities_bodyYesWraps a PMC_PriorityCollection array of PMCPriorityData objects to add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceAddPriorities({
pMCPriorityCollection: [{priorityID: 1, priorityName: "High"}]
});
projectManagementConfigurationServiceDeletePriorities

Delete priorities from the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_DeletePriorities_bodyYesWraps a PMC_PriorityCollection array identifying the priorities to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceDeletePriorities({
pMCPriorityCollection: [{priorityID: 1}]
});
projectManagementConfigurationServiceGetPriorities

Get the priorities defined in the project management configuration.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_2&#124;error

Sample code:

inline_response_200_2 priorities = check client->projectManagementConfigurationServiceGetPriorities();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementConfigurationService_GetPriorities",
"value": [
{"PriorityID": 1, "PriorityName": "High"}
]
}
projectManagementConfigurationServiceUpdatePriorities

Update priorities in the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_UpdatePriorities_bodyYesWraps a PMC_PriorityCollection array of PMCPriorityData objects with the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceUpdatePriorities({
pMCPriorityCollection: [{priorityID: 1, priorityName: "Critical"}]
});

Project Configuration — Stage Types

projectManagementConfigurationServiceAddStageTypes

Add stage types to the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_AddStageTypes_bodyYesWraps a PMC_StageTypeCollection array of PMCStageTypeData objects to add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceAddStageTypes({
pMCStageTypeCollection: [{stageID: 1, stageName: "Planning", stageDescription: "Initial planning stage"}]
});
projectManagementConfigurationServiceDeleteStageTypes

Delete stage types from the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_DeleteStageTypes_bodyYesWraps a PMC_StageTypeCollection array identifying the stage types to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceDeleteStageTypes({
pMCStageTypeCollection: [{stageID: 1}]
});
projectManagementConfigurationServiceGetStageTypes

Get the stage types defined in the project management configuration.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_3&#124;error

Sample code:

inline_response_200_3 stageTypes = check client->projectManagementConfigurationServiceGetStageTypes();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementConfigurationService_GetStageTypes",
"value": [
{"StageID": 1, "StageName": "Planning", "StageDescription": "Initial planning stage"}
]
}
projectManagementConfigurationServiceUpdateStageTypes

Update stage types in the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_UpdateStageTypes_bodyYesWraps a PMC_StageTypeCollection array of PMCStageTypeData objects with the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceUpdateStageTypes({
pMCStageTypeCollection: [{stageID: 1, stageDescription: "Initial planning and design stage"}]
});

Project Configuration — Subproject Types

projectManagementConfigurationServiceAddSubprojectTypes

Add subproject types to the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_AddSubprojectTypes_bodyYesWraps a PMC_SubprojectTypesCollection array of PMCSubprojectTypeData objects to add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceAddSubprojectTypes({
pMCSubprojectTypesCollection: [{subprojectTypeID: 1, subprojectTypeName: "Civil"}]
});
projectManagementConfigurationServiceDeleteSubprojectTypes

Delete subproject types from the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_DeleteSubprojectTypes_bodyYesWraps a PMC_SubprojectTypesCollection array identifying the subproject types to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceDeleteSubprojectTypes({
pMCSubprojectTypesCollection: [{subprojectTypeID: 1}]
});
projectManagementConfigurationServiceGetSubprojectTypes

Get the subproject types defined in the project management configuration.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_4&#124;error

Sample code:

inline_response_200_4 subprojectTypes = check client->projectManagementConfigurationServiceGetSubprojectTypes();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementConfigurationService_GetSubprojectTypes",
"value": [
{"SubprojectTypeID": 1, "SubprojectTypeName": "Civil"}
]
}
projectManagementConfigurationServiceUpdateSubprojectTypes

Update subproject types in the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_UpdateSubprojectTypes_bodyYesWraps a PMC_SubprojectTypesCollection array of PMCSubprojectTypeData objects with the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceUpdateSubprojectTypes({
pMCSubprojectTypesCollection: [{subprojectTypeID: 1, subprojectTypeName: "Civil & Structural"}]
});

Project Configuration — Tasks

projectManagementConfigurationServiceAddTasks

Add tasks to the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_AddTasks_bodyYesWraps a PMC_TaskCollection array of PMCTaskData objects to add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceAddTasks({
pMCTaskCollection: [{taskID: 1, taskName: "Site survey"}]
});
projectManagementConfigurationServiceDeleteTasks

Delete tasks from the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_DeleteTasks_bodyYesWraps a PMC_TaskCollection array identifying the tasks to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceDeleteTasks({
pMCTaskCollection: [{taskID: 1}]
});
projectManagementConfigurationServiceGetTasks

Get the tasks defined in the project management configuration.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_5&#124;error

Sample code:

inline_response_200_5 tasks = check client->projectManagementConfigurationServiceGetTasks();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementConfigurationService_GetTasks",
"value": [
{"TaskID": 1, "TaskName": "Site survey"}
]
}
projectManagementConfigurationServiceUpdateTasks

Update tasks in the project management configuration.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementConfigurationService_UpdateTasks_bodyYesWraps a PMC_TaskCollection array of PMCTaskData objects with the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementConfigurationServiceUpdateTasks({
pMCTaskCollection: [{taskID: 1, taskName: "Detailed site survey"}]
});

Subprojects

projectManagementServiceAddSubproject

Add a subproject to a project management project.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementService_AddSubproject_bodyYesWraps a PM_SubprojectDocumentData object describing the subproject to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: PMSubprojectDocumentParams&#124;error

Sample code:

PMSubprojectDocumentParams created = check client->projectManagementServiceAddSubproject({
pMSubprojectDocumentData: {
SubprojectName: "Foundation Works",
ParentID: 1015,
ProjectID: 1015,
SubprojectType: 1,
StartDate: "2026-07-15",
DueDate: "2026-09-30"
}
});

Sample response:

{
"AbsEntry": 1042
}
projectManagementServiceDeleteSubproject

Delete a subproject from a project management project.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementService_DeleteSubproject_bodyYesWraps a PM_SubprojectDocumentParams object identifying the subproject to delete
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementServiceDeleteSubproject({
pMSubprojectDocumentParams: {absEntry: 1042}
});
projectManagementServiceGetSubproject

Get a subproject of a project management project.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementService_GetSubproject_bodyYesWraps a PM_SubprojectDocumentParams object identifying the subproject to retrieve
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: PMSubprojectDocumentData&#124;error

Sample code:

PMSubprojectDocumentData subproject = check client->projectManagementServiceGetSubproject({
pMSubprojectDocumentParams: {absEntry: 1042}
});

Sample response:

{
"AbsEntry": 1042,
"Owner": 7,
"SubprojectName": "Foundation Works",
"StartDate": "2026-07-15",
"FinishedPercent": 0,
"ParentID": 1015,
"ProjectID": 1015,
"Order": 1,
"SubprojectType": 1,
"SubprojectContribution": 100,
"SubprojectStatus": "sst_Open",
"SubprojectEndDate": "2026-09-30",
"ActualCost": 0,
"PlannedCost": 18500.00,
"SubprojectDepth": 1,
"DueDate": "2026-09-30"
}
projectManagementServiceGetSubprojectsList

Get the list of subprojects belonging to a project management project.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementService_GetSubprojectsList_bodyYesWraps a PM_SubprojectParams object identifying the parent project and whether it is itself a subproject
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_6&#124;error

Sample code:

inline_response_200_6 subprojects = check client->projectManagementServiceGetSubprojectsList({
pMSubprojectParams: {absEntry: 1015, isSubproject: "tNO"}
});

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementService_GetSubprojectsList",
"value": [
{"AbsEntry": 1042},
{"AbsEntry": 1043}
]
}
projectManagementServiceUpdateSubproject

Update a subproject of a project management project.

Parameters:

NameTypeRequiredDescription
payloadProjectManagementService_UpdateSubproject_bodyYesWraps a PM_SubprojectDocumentData object with the fields to update, including the AbsEntry of the subproject
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementServiceUpdateSubproject({
pMSubprojectDocumentData: {AbsEntry: 1042, FinishedPercent: 25.0}
});

Project Management Time Sheets

listProjectManagementTimeSheet

Query the ProjectManagementTimeSheet collection.

Parameters:

NameTypeRequiredDescription
headersListProjectManagementTimeSheetHeadersNoHeaders to be sent with the request, e.g. Prefer: odata.maxpagesize=100 to control server-side paging
queriesListProjectManagementTimeSheetQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: ProjectManagementTimeSheetCollectionResponse&#124;error

Sample code:

ProjectManagementTimeSheetCollectionResponse response = check client->listProjectManagementTimeSheet(
queries = {dollarTop: 10}
);

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagementTimeSheet",
"value": [
{
"AbsEntry": 501,
"DocNumber": 501,
"TimeSheetType": "tsh_Employee",
"UserID": 7,
"FirstName": "Alex",
"LastName": "Wong",
"DateFrom": "2026-07-06",
"DateTo": "2026-07-10",
"UserCode": "AWONG"
}
],
"odata.nextLink": "ProjectManagementTimeSheet?$skip=10"
}
createProjectManagementTimeSheet

Create a new PM_TimeSheetData entity in the ProjectManagementTimeSheet collection.

Parameters:

NameTypeRequiredDescription
payloadPMTimeSheetDataYesThe time sheet to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: PMTimeSheetData&#124;error

Sample code:

PMTimeSheetData created = check client->createProjectManagementTimeSheet({
TimeSheetType: "tsh_Employee",
UserID: 7,
DateFrom: "2026-07-06",
DateTo: "2026-07-10",
PM_TimeSheetLineDataCollection: [
{Date: "2026-07-06", ActivityType: 10, StartTime: "0900", EndTime: "1700", ProjectID: 1015, StageID: 1}
]
});

Sample response:

{
"AbsEntry": 502,
"DocNumber": 502,
"TimeSheetType": "tsh_Employee",
"UserID": 7,
"FirstName": "Alex",
"LastName": "Wong",
"DateFrom": "2026-07-06",
"DateTo": "2026-07-10",
"PM_TimeSheetLineDataCollection": [
{"LineID": 0, "Date": "2026-07-06", "ActivityType": 10, "StartTime": "0900", "EndTime": "1700", "ProjectID": 1015, "StageID": 1}
]
}
getProjectManagementTimeSheet

Get a single PM_TimeSheetData entity from the ProjectManagementTimeSheet collection by key.

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetProjectManagementTimeSheetQueriesNoOData query options: $expand, $select

Returns: PMTimeSheetData&#124;error

Sample code:

PMTimeSheetData sheet = check client->getProjectManagementTimeSheet(502);

Sample response:

{
"AbsEntry": 502,
"DocNumber": 502,
"TimeSheetType": "tsh_Employee",
"UserID": 7,
"FirstName": "Alex",
"LastName": "Wong",
"DateFrom": "2026-07-06",
"DateTo": "2026-07-10",
"PM_TimeSheetLineDataCollection": [
{"LineID": 0, "Date": "2026-07-06", "ActivityType": 10, "StartTime": "0900", "EndTime": "1700", "ProjectID": 1015, "StageID": 1}
]
}
deleteProjectManagementTimeSheet

Delete a PM_TimeSheetData entity from the ProjectManagementTimeSheet collection.

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteProjectManagementTimeSheet(502);
updateProjectManagementTimeSheet

Partially update a PM_TimeSheetData entity in the ProjectManagementTimeSheet collection (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32)
payloadPMTimeSheetDataYesFields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateProjectManagementTimeSheet(502, {DateTo: "2026-07-11"});

Project Management Projects

listProjectManagements

Query the ProjectManagements collection.

Parameters:

NameTypeRequiredDescription
headersListProjectManagementsHeadersNoHeaders to be sent with the request, e.g. Prefer: odata.maxpagesize=100 to control server-side paging
queriesListProjectManagementsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: ProjectManagementsCollectionResponse&#124;error

Sample code:

ProjectManagementsCollectionResponse response = check client->listProjectManagements(
queries = {dollarTop: 20, dollarFilter: "ProjectStatus eq 'pst_Started'"}
);

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectManagements",
"value": [
{
"AbsEntry": 1015,
"ProjectName": "New Warehouse Setup",
"StartDate": "2026-06-01",
"DueDate": "2026-12-31",
"ProjectType": "pt_Internal",
"ProjectStatus": "pst_Started",
"FinancialProject": "PRJ-2026-001",
"AllowSubprojects": "tYES",
"FinishedPercent": 15.0
}
],
"odata.nextLink": "ProjectManagements?$skip=20"
}
createProjectManagements

Create a new PM_ProjectDocumentData entity in the ProjectManagements collection.

Parameters:

NameTypeRequiredDescription
payloadPMProjectDocumentDataYesThe project management project to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: PMProjectDocumentData&#124;error

Sample code:

PMProjectDocumentData created = check client->createProjectManagements({
ProjectName: "New Warehouse Setup",
FinancialProject: "PRJ-2026-001",
ProjectType: "pt_Internal",
StartDate: "2026-06-01",
DueDate: "2026-12-31",
AllowSubprojects: "tYES"
});

Sample response:

{
"AbsEntry": 1015,
"ProjectName": "New Warehouse Setup",
"FinancialProject": "PRJ-2026-001",
"ProjectType": "pt_Internal",
"StartDate": "2026-06-01",
"DueDate": "2026-12-31",
"AllowSubprojects": "tYES",
"ProjectStatus": "pst_Started",
"FinishedPercent": 0
}
getProjectManagements

Get a single PM_ProjectDocumentData entity from the ProjectManagements collection by key.

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetProjectManagementsQueriesNoOData query options: $expand, $select

Returns: PMProjectDocumentData&#124;error

Sample code:

PMProjectDocumentData project = check client->getProjectManagements(1015, queries = {dollarExpand: "PM_StagesCollection"});

Sample response:

{
"AbsEntry": 1015,
"ProjectName": "New Warehouse Setup",
"FinancialProject": "PRJ-2026-001",
"ProjectType": "pt_Internal",
"StartDate": "2026-06-01",
"DueDate": "2026-12-31",
"AllowSubprojects": "tYES",
"ProjectStatus": "pst_Started",
"FinishedPercent": 15.0,
"PM_StagesCollection": [
{"LineID": 0, "StageID": 1, "StageType": 1, "StartDate": "2026-06-01", "Description": "Planning", "IsFinished": "tNO"}
]
}
deleteProjectManagements

Delete a PM_ProjectDocumentData entity from the ProjectManagements collection.

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteProjectManagements(1015);
updateProjectManagements

Partially update a PM_ProjectDocumentData entity in the ProjectManagements collection (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32)
payloadPMProjectDocumentDataYesFields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateProjectManagements(1015, {FinishedPercent: 25.0});
projectManagementsCancelProject

Bound action 'CancelProject' on ProjectManagements (binding type PM_ProjectDocumentData).

Parameters:

NameTypeRequiredDescription
absEntryint:Signed32YesKey property 'AbsEntry' (Edm.Int32) of the project management project to cancel
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->projectManagementsCancelProject(1015);

Projects

listProjects

Query the Projects collection.

Parameters:

NameTypeRequiredDescription
headersListProjectsHeadersNoHeaders to be sent with the request, e.g. Prefer: odata.maxpagesize=100 to control server-side paging
queriesListProjectsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: ProjectsCollectionResponse&#124;error

Sample code:

ProjectsCollectionResponse response = check client->listProjects(queries = {dollarSelect: "Code,Name,Active"});

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#Projects",
"value": [
{
"Code": "PRJ-2026-001",
"Name": "New Warehouse Setup",
"ValidFrom": "2026-06-01",
"ValidTo": "2026-12-31",
"Active": "tYES"
}
],
"odata.nextLink": "Projects?$skip=20"
}
createProjects

Create a new Project entity in the Projects collection.

Parameters:

NameTypeRequiredDescription
payloadProjectYesThe financial project code to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Project&#124;error

Sample code:

Project created = check client->createProjects({
Code: "PRJ-2026-001",
Name: "New Warehouse Setup",
ValidFrom: "2026-06-01",
ValidTo: "2026-12-31",
Active: "tYES"
});

Sample response:

{
"Code": "PRJ-2026-001",
"Name": "New Warehouse Setup",
"ValidFrom": "2026-06-01",
"ValidTo": "2026-12-31",
"Active": "tYES"
}
getProjects

Get a single Project entity from the Projects collection by key.

Parameters:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetProjectsQueriesNoOData query options: $expand, $select

Returns: Project&#124;error

Sample code:

Project project = check client->getProjects("PRJ-2026-001");

Sample response:

{
"Code": "PRJ-2026-001",
"Name": "New Warehouse Setup",
"ValidFrom": "2026-06-01",
"ValidTo": "2026-12-31",
"Active": "tYES"
}
deleteProjects

Delete a Project entity from the Projects collection.

Parameters:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteProjects("PRJ-2026-001");
updateProjects

Partially update a Project entity in the Projects collection (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
payloadProjectYesFields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateProjects("PRJ-2026-001", {ValidTo: "2027-06-30"});
projectsServiceGetProjectList

Get project list.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200_7&#124;error

Sample code:

inline_response_200_7 projects = check client->projectsServiceGetProjectList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ProjectsService_GetProjectList",
"value": [
{"Code": "PRJ-2026-001", "Name": "New Warehouse Setup"}
]
}

Session

logout

Ends the active SAP Business One Service Layer session.

Parameters:

None

Returns: error?

Sample code:

check client->logout();