Skip to main content

Actions

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

Available clients:

ClientPurpose
ClientCreate, query, update, and process SAP Business One service module objects — service calls, contracts, contract templates, customer equipment cards, and the solutions knowledge base — over the session-authenticated Service Layer (OData V3).

Client

The Client provides access to every service module object exposed by the SAP Business One Service Layer — service calls, service contracts, contract templates, customer equipment cards, the knowledge base, queues, and service call reference data (origins, problem types & sub-types, statuses, and call 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.service;

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

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

Operations

Service Calls

listServiceCalls

Query the ServiceCalls collection.

Parameters:

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

Returns: ServiceCallsCollectionResponse&#124;error

Sample code:

ServiceCallsCollectionResponse response = check client->listServiceCalls(
queries = {dollarFilter: "Status eq 1", dollarTop: 20, dollarOrderby: "ServiceCallID desc"}
);

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCalls",
"value": [
{
"ServiceCallID": 501,
"Subject": "Printer not powering on",
"CustomerCode": "C00001",
"CustomerName": "ACME Corp",
"ItemCode": "A00001",
"Status": 1,
"Priority": "scp_High",
"CallType": 3,
"ProblemType": 5,
"Description": "Device does not power on after outage",
"CreationDate": "2026-07-01",
"Queue": "SUPPORT"
}
],
"odata.nextLink": "ServiceCalls?$skip=20"
}
createServiceCalls

Create a new ServiceCall.

Parameters:

NameTypeRequiredDescription
payloadServiceCallYesThe service call to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCall&#124;error

Sample code:

ServiceCall created = check client->createServiceCalls({
Subject: "Printer not powering on",
CustomerCode: "C00001",
ItemCode: "A00001",
Priority: "scp_High",
CallType: 3,
ProblemType: 5,
Description: "Device does not power on after outage"
});

Sample response:

{
"ServiceCallID": 501,
"Subject": "Printer not powering on",
"CustomerCode": "C00001",
"ItemCode": "A00001",
"Status": 1,
"Priority": "scp_High",
"CallType": 3,
"ProblemType": 5,
"Description": "Device does not power on after outage",
"CreationDate": "2026-07-01"
}
getServiceCalls

Get a single ServiceCall by key.

Parameters:

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

Returns: ServiceCall&#124;error

Sample code:

ServiceCall call = check client->getServiceCalls(501);

Sample response:

{
"ServiceCallID": 501,
"Subject": "Printer not powering on",
"CustomerCode": "C00001",
"CustomerName": "ACME Corp",
"Status": 1,
"Priority": "scp_High",
"CallType": 3,
"ProblemType": 5,
"Description": "Device does not power on after outage",
"CreationDate": "2026-07-01",
"Queue": "SUPPORT"
}
deleteServiceCalls

Delete a ServiceCall.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCalls(501);
updateServiceCalls

Partially update a ServiceCall (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCalls(501, {Resolution: "Replaced power supply unit", Status: 2});
serviceCallsClose

Bound action 'Close' on ServiceCalls (binding type ServiceCall).

Parameters:

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

Returns: error?

Sample code:

check client->serviceCallsClose(501);

Service Contracts

listServiceContracts

Query the ServiceContracts collection.

Parameters:

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

Returns: ServiceContractsCollectionResponse&#124;error

Sample code:

ServiceContractsCollectionResponse response = check client->listServiceContracts(
queries = {dollarFilter: "Status eq 'scs_Approved'", dollarTop: 20}
);

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceContracts",
"value": [
{
"ContractID": 301,
"CustomerCode": "C00001",
"CustomerName": "ACME Corp",
"Status": "scs_Approved",
"ContractTemplate": "GOLD",
"ContractType": "ct_Customer",
"StartDate": "2026-01-01",
"EndDate": "2026-12-31",
"ResolutionTime": 4,
"ResolutionUnit": "rsu_Hours",
"Description": "Gold-tier annual support contract"
}
]
}
createServiceContracts

Create a new ServiceContract.

Parameters:

NameTypeRequiredDescription
payloadServiceContractYesThe service contract to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceContract&#124;error

Sample code:

ServiceContract created = check client->createServiceContracts({
CustomerCode: "C00001",
ContractTemplate: "GOLD",
ContractType: "ct_Customer",
StartDate: "2026-01-01",
EndDate: "2026-12-31",
Description: "Gold-tier annual support contract"
});

Sample response:

{
"ContractID": 301,
"CustomerCode": "C00001",
"Status": "scs_Draft",
"ContractTemplate": "GOLD",
"ContractType": "ct_Customer",
"StartDate": "2026-01-01",
"EndDate": "2026-12-31",
"Description": "Gold-tier annual support contract"
}
getServiceContracts

Get a single ServiceContract by key.

Parameters:

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

Returns: ServiceContract&#124;error

Sample code:

ServiceContract contract = check client->getServiceContracts(301);

Sample response:

{
"ContractID": 301,
"CustomerCode": "C00001",
"CustomerName": "ACME Corp",
"Status": "scs_Approved",
"ContractTemplate": "GOLD",
"ContractType": "ct_Customer",
"StartDate": "2026-01-01",
"EndDate": "2026-12-31",
"Description": "Gold-tier annual support contract"
}
deleteServiceContracts

Delete a ServiceContract.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceContracts(301);
updateServiceContracts

Partially update a ServiceContract (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceContracts(301, {Description: "Gold-tier annual support contract — renewed"});
serviceContractsCancel

Bound action 'Cancel' on ServiceContracts (binding type ServiceContract).

Parameters:

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

Returns: error?

Sample code:

check client->serviceContractsCancel(301);
serviceContractsClose

Bound action 'Close' on ServiceContracts (binding type ServiceContract).

Parameters:

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

Returns: error?

Sample code:

check client->serviceContractsClose(301);

Contract Templates

listContractTemplates

Query the ContractTemplates collection.

Parameters:

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

Returns: ContractTemplatesCollectionResponse&#124;error

Sample code:

ContractTemplatesCollectionResponse response = check client->listContractTemplates(queries = {dollarTop: 20});

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ContractTemplates",
"value": [
{
"TemplateName": "GOLD",
"TemplateIsRenewal": "tYES",
"DurationOfCoverage": 12,
"ResponseValue": 4,
"ResolutionUnit": "rsu_Hours",
"Description": "Gold-tier annual support contract template",
"ContractType": "ct_Customer",
"IncludeParts": "tYES",
"IncludeLabor": "tYES",
"IncludeTravel": "tNO"
}
]
}
createContractTemplates

Create a new ContractTemplate.

Parameters:

NameTypeRequiredDescription
payloadContractTemplateYesThe contract template to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ContractTemplate&#124;error

Sample code:

ContractTemplate created = check client->createContractTemplates({
TemplateName: "GOLD",
TemplateIsRenewal: "tYES",
DurationOfCoverage: 12,
ResponseValue: 4,
ResolutionUnit: "rsu_Hours",
ContractType: "ct_Customer",
Description: "Gold-tier annual support contract template",
IncludeParts: "tYES",
IncludeLabor: "tYES",
IncludeTravel: "tNO"
});

Sample response:

{
"TemplateName": "GOLD",
"TemplateIsRenewal": "tYES",
"DurationOfCoverage": 12,
"ResponseValue": 4,
"ResolutionUnit": "rsu_Hours",
"ContractType": "ct_Customer",
"Description": "Gold-tier annual support contract template"
}
getContractTemplates

Get a single ContractTemplate by key.

Parameters:

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

Returns: ContractTemplate&#124;error

Sample code:

ContractTemplate template = check client->getContractTemplates("GOLD");

Sample response:

{
"TemplateName": "GOLD",
"TemplateIsRenewal": "tYES",
"DurationOfCoverage": 12,
"ResponseValue": 4,
"ResolutionUnit": "rsu_Hours",
"ContractType": "ct_Customer",
"Description": "Gold-tier annual support contract template"
}
deleteContractTemplates

Delete a ContractTemplate.

Parameters:

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

Returns: error?

Sample code:

check client->deleteContractTemplates("GOLD");
updateContractTemplates

Partially update a ContractTemplate (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
templateNamestringYesKey property 'TemplateName' (Edm.String)
payloadContractTemplateYesFields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateContractTemplates("GOLD", {Description: "Gold-tier annual support contract template (revised)"});

Customer Equipment Cards

listCustomerEquipmentCards

Query the CustomerEquipmentCards collection.

Parameters:

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

Returns: CustomerEquipmentCardsCollectionResponse&#124;error

Sample code:

CustomerEquipmentCardsCollectionResponse response = check client->listCustomerEquipmentCards(
queries = {dollarFilter: "CustomerCode eq 'C00001'", dollarTop: 20}
);

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#CustomerEquipmentCards",
"value": [
{
"EquipmentCardNum": 205,
"CustomerCode": "C00001",
"CustomerName": "ACME Corp",
"ManufacturerSerialNum": "SN-88213",
"InternalSerialNum": "INT-004",
"ItemCode": "A00001",
"ItemDescription": "Laser Printer",
"DeliveryDate": "2025-11-10",
"ContractCode": 301,
"StatusOfSerialNumber": "sns_Active"
}
]
}
createCustomerEquipmentCards

Create a new CustomerEquipmentCard.

Parameters:

NameTypeRequiredDescription
payloadCustomerEquipmentCardYesThe customer equipment card to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CustomerEquipmentCard&#124;error

Sample code:

CustomerEquipmentCard created = check client->createCustomerEquipmentCards({
CustomerCode: "C00001",
ManufacturerSerialNum: "SN-88213",
ItemCode: "A00001",
DeliveryDate: "2025-11-10",
ContractCode: 301
});

Sample response:

{
"EquipmentCardNum": 205,
"CustomerCode": "C00001",
"ManufacturerSerialNum": "SN-88213",
"ItemCode": "A00001",
"DeliveryDate": "2025-11-10",
"ContractCode": 301
}
getCustomerEquipmentCards

Get a single CustomerEquipmentCard by key.

Parameters:

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

Returns: CustomerEquipmentCard&#124;error

Sample code:

CustomerEquipmentCard card = check client->getCustomerEquipmentCards(205);

Sample response:

{
"EquipmentCardNum": 205,
"CustomerCode": "C00001",
"CustomerName": "ACME Corp",
"ManufacturerSerialNum": "SN-88213",
"ItemCode": "A00001",
"ItemDescription": "Laser Printer",
"DeliveryDate": "2025-11-10",
"ContractCode": 301,
"StatusOfSerialNumber": "sns_Active"
}
deleteCustomerEquipmentCards

Delete a CustomerEquipmentCard.

Parameters:

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

Returns: error?

Sample code:

check client->deleteCustomerEquipmentCards(205);
updateCustomerEquipmentCards

Partially update a CustomerEquipmentCard (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateCustomerEquipmentCards(205, {StatusOfSerialNumber: "sns_Returned"});

Knowledge Base Solutions

listKnowledgeBaseSolutions

Query the KnowledgeBaseSolutions collection.

Parameters:

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

Returns: KnowledgeBaseSolutionsCollectionResponse&#124;error

Sample code:

KnowledgeBaseSolutionsCollectionResponse response = check client->listKnowledgeBaseSolutions(
queries = {dollarFilter: "ItemCode eq 'A00001'"}
);

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#KnowledgeBaseSolutions",
"value": [
{
"SolutionCode": 77,
"ItemCode": "A00001",
"Status": 1,
"Solution": "Replace the fuser unit and reset the printer.",
"Symptom": "Print jobs jam after 200 pages",
"Cause": "Worn fuser unit",
"Description": "Fuser replacement procedure"
}
]
}
createKnowledgeBaseSolutions

Create a new KnowledgeBaseSolution.

Parameters:

NameTypeRequiredDescription
payloadKnowledgeBaseSolutionYesThe knowledge base solution to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: KnowledgeBaseSolution&#124;error

Sample code:

KnowledgeBaseSolution created = check client->createKnowledgeBaseSolutions({
ItemCode: "A00001",
Symptom: "Print jobs jam after 200 pages",
Cause: "Worn fuser unit",
Solution: "Replace the fuser unit and reset the printer.",
Description: "Fuser replacement procedure"
});

Sample response:

{
"SolutionCode": 77,
"ItemCode": "A00001",
"Symptom": "Print jobs jam after 200 pages",
"Cause": "Worn fuser unit",
"Solution": "Replace the fuser unit and reset the printer.",
"Description": "Fuser replacement procedure"
}
getKnowledgeBaseSolutions

Get a single KnowledgeBaseSolution by key.

Parameters:

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

Returns: KnowledgeBaseSolution&#124;error

Sample code:

KnowledgeBaseSolution solution = check client->getKnowledgeBaseSolutions(77);

Sample response:

{
"SolutionCode": 77,
"ItemCode": "A00001",
"Status": 1,
"Symptom": "Print jobs jam after 200 pages",
"Cause": "Worn fuser unit",
"Solution": "Replace the fuser unit and reset the printer.",
"Description": "Fuser replacement procedure"
}
deleteKnowledgeBaseSolutions

Delete a KnowledgeBaseSolution.

Parameters:

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

Returns: error?

Sample code:

check client->deleteKnowledgeBaseSolutions(77);
updateKnowledgeBaseSolutions

Partially update a KnowledgeBaseSolution (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateKnowledgeBaseSolutions(77, {Solution: "Replace the fuser unit, reset the printer, and run a test page."});

Queues

listQueue

Query the Queue collection.

Parameters:

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

Returns: QueueCollectionResponse&#124;error

Sample code:

QueueCollectionResponse response = check client->listQueue();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#Queue",
"value": [
{
"QueueID": "SUPPORT",
"Description": "Level 1 Support Queue",
"Inactive": "tNO",
"QueueManager": 12,
"QueueEmail": "[email protected]",
"QueueMembers": [
{"QueueID": "SUPPORT", "MemberUserID": 15}
]
}
]
}
createQueue

Create a new Queue.

Parameters:

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

Returns: Queue&#124;error

Sample code:

Queue created = check client->createQueue({
QueueID: "SUPPORT",
Description: "Level 1 Support Queue",
QueueManager: 12,
QueueEmail: "[email protected]"
});

Sample response:

{
"QueueID": "SUPPORT",
"Description": "Level 1 Support Queue",
"QueueManager": 12,
"QueueEmail": "[email protected]"
}
getQueue

Get a single Queue by key.

Parameters:

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

Returns: Queue&#124;error

Sample code:

Queue queue = check client->getQueue("SUPPORT");

Sample response:

{
"QueueID": "SUPPORT",
"Description": "Level 1 Support Queue",
"Inactive": "tNO",
"QueueManager": 12,
"QueueEmail": "[email protected]"
}
deleteQueue

Delete a Queue.

Parameters:

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

Returns: error?

Sample code:

check client->deleteQueue("SUPPORT");
updateQueue

Partially update a Queue (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
queueIDstringYesKey property 'QueueID' (Edm.String)
payloadQueueYesFields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateQueue("SUPPORT", {QueueManager: 18});

Service Call Origins

listServiceCallOrigins

Query the ServiceCallOrigins collection.

Parameters:

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

Returns: ServiceCallOriginsCollectionResponse&#124;error

Sample code:

ServiceCallOriginsCollectionResponse response = check client->listServiceCallOrigins();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallOrigins",
"value": [
{"Active": "tYES", "Description": "Customer phone call", "OriginID": 2, "Name": "Phone"}
]
}
createServiceCallOrigins

Create a new ServiceCallOrigin.

Parameters:

NameTypeRequiredDescription
payloadServiceCallOriginYesThe service call origin to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCallOrigin&#124;error

Sample code:

ServiceCallOrigin created = check client->createServiceCallOrigins({
name: "Phone",
description: "Customer phone call",
active: "tYES"
});

Sample response:

{"Active": "tYES", "Description": "Customer phone call", "OriginID": 2, "Name": "Phone"}
getServiceCallOrigins

Get a single ServiceCallOrigin by key.

Parameters:

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

Returns: ServiceCallOrigin&#124;error

Sample code:

ServiceCallOrigin origin = check client->getServiceCallOrigins(2);

Sample response:

{"Active": "tYES", "Description": "Customer phone call", "OriginID": 2, "Name": "Phone"}
deleteServiceCallOrigins

Delete a ServiceCallOrigin.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCallOrigins(2);
updateServiceCallOrigins

Partially update a ServiceCallOrigin (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCallOrigins(2, {description: "Inbound customer phone call"});
serviceCallOriginsServiceGetServiceCallOriginList

Get service call origin list.

Parameters:

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

Returns: inline_response_200&#124;error

Sample code:

inline_response_200 origins = check client->serviceCallOriginsServiceGetServiceCallOriginList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallOriginsService_GetServiceCallOriginList",
"value": [
{"OriginID": 2, "Name": "Phone"}
]
}

Service Call Problem Types

listServiceCallProblemTypes

Query the ServiceCallProblemTypes collection.

Parameters:

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

Returns: ServiceCallProblemTypesCollectionResponse&#124;error

Sample code:

ServiceCallProblemTypesCollectionResponse response = check client->listServiceCallProblemTypes();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallProblemTypes",
"value": [
{"ProblemTypeID": 5, "Active": "tYES", "Description": "Hardware failure", "Name": "Hardware"}
]
}
createServiceCallProblemTypes

Create a new ServiceCallProblemType.

Parameters:

NameTypeRequiredDescription
payloadServiceCallProblemTypeYesThe service call problem type to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCallProblemType&#124;error

Sample code:

ServiceCallProblemType created = check client->createServiceCallProblemTypes({
name: "Hardware",
description: "Hardware failure",
active: "tYES"
});

Sample response:

{"ProblemTypeID": 5, "Active": "tYES", "Description": "Hardware failure", "Name": "Hardware"}
getServiceCallProblemTypes

Get a single ServiceCallProblemType by key.

Parameters:

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

Returns: ServiceCallProblemType&#124;error

Sample code:

ServiceCallProblemType problemType = check client->getServiceCallProblemTypes(5);

Sample response:

{"ProblemTypeID": 5, "Active": "tYES", "Description": "Hardware failure", "Name": "Hardware"}
deleteServiceCallProblemTypes

Delete a ServiceCallProblemType.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCallProblemTypes(5);
updateServiceCallProblemTypes

Partially update a ServiceCallProblemType (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCallProblemTypes(5, {description: "Hardware failure or malfunction"});
serviceCallProblemTypesServiceGetServiceCallProblemTypeList

Get service call problem type list.

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 problemTypes = check client->serviceCallProblemTypesServiceGetServiceCallProblemTypeList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallProblemTypesService_GetServiceCallProblemTypeList",
"value": [
{"ProblemTypeID": 5, "Name": "Hardware"}
]
}

Service Call Problem Sub-Types

listServiceCallProblemSubTypes

Query the ServiceCallProblemSubTypes collection.

Parameters:

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

Returns: ServiceCallProblemSubTypesCollectionResponse&#124;error

Sample code:

ServiceCallProblemSubTypesCollectionResponse response = check client->listServiceCallProblemSubTypes();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallProblemSubTypes",
"value": [
{"Active": "tYES", "Description": "Won't power on", "ProblemSubTypeID": 12, "Name": "No power"}
]
}
createServiceCallProblemSubTypes

Create a new ServiceCallProblemSubType.

Parameters:

NameTypeRequiredDescription
payloadServiceCallProblemSubTypeYesThe service call problem sub-type to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCallProblemSubType&#124;error

Sample code:

ServiceCallProblemSubType created = check client->createServiceCallProblemSubTypes({
name: "No power",
description: "Won't power on",
active: "tYES"
});

Sample response:

{"Active": "tYES", "Description": "Won't power on", "ProblemSubTypeID": 12, "Name": "No power"}
getServiceCallProblemSubTypes

Get a single ServiceCallProblemSubType by key.

Parameters:

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

Returns: ServiceCallProblemSubType&#124;error

Sample code:

ServiceCallProblemSubType subType = check client->getServiceCallProblemSubTypes(12);

Sample response:

{"Active": "tYES", "Description": "Won't power on", "ProblemSubTypeID": 12, "Name": "No power"}
deleteServiceCallProblemSubTypes

Delete a ServiceCallProblemSubType.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCallProblemSubTypes(12);
updateServiceCallProblemSubTypes

Partially update a ServiceCallProblemSubType (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCallProblemSubTypes(12, {description: "Device won't power on at all"});
serviceCallProblemSubTypesServiceGetServiceCallProblemSubTypeList

Get service call problem sub type list.

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 subTypes = check client->serviceCallProblemSubTypesServiceGetServiceCallProblemSubTypeList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallProblemSubTypesService_GetServiceCallProblemSubTypeList",
"value": [
{"ProblemSubTypeID": 12, "Name": "No power"}
]
}

Service Call Solution Status

listServiceCallSolutionStatus

Query the ServiceCallSolutionStatus collection.

Parameters:

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

Returns: ServiceCallSolutionStatusCollectionResponse&#124;error

Sample code:

ServiceCallSolutionStatusCollectionResponse response = check client->listServiceCallSolutionStatus();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallSolutionStatus",
"value": [
{"Active": "tYES", "Description": "Solution published and verified", "StatusId": 3, "Name": "Published"}
]
}
createServiceCallSolutionStatus

Create a new ServiceCallSolutionStatus.

Parameters:

NameTypeRequiredDescription
payloadServiceCallSolutionStatusYesThe service call solution status to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCallSolutionStatus&#124;error

Sample code:

ServiceCallSolutionStatus created = check client->createServiceCallSolutionStatus({
name: "Published",
description: "Solution published and verified",
active: "tYES"
});

Sample response:

{"Active": "tYES", "Description": "Solution published and verified", "StatusId": 3, "Name": "Published"}
getServiceCallSolutionStatus

Get a single ServiceCallSolutionStatus by key.

Parameters:

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

Returns: ServiceCallSolutionStatus&#124;error

Sample code:

ServiceCallSolutionStatus status = check client->getServiceCallSolutionStatus(3);

Sample response:

{"Active": "tYES", "Description": "Solution published and verified", "StatusId": 3, "Name": "Published"}
deleteServiceCallSolutionStatus

Delete a ServiceCallSolutionStatus.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCallSolutionStatus(3);
updateServiceCallSolutionStatus

Partially update a ServiceCallSolutionStatus (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCallSolutionStatus(3, {description: "Solution published, verified, and archived"});
serviceCallSolutionStatusServiceGetServiceCallSolutionStatusList

Get service call solution status list.

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 statuses = check client->serviceCallSolutionStatusServiceGetServiceCallSolutionStatusList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallSolutionStatusService_GetServiceCallSolutionStatusList",
"value": [
{"StatusId": 3, "Name": "Published"}
]
}

Service Call Statuses

listServiceCallStatus

Query the ServiceCallStatus collection.

Parameters:

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

Returns: ServiceCallStatusCollectionResponse&#124;error

Sample code:

ServiceCallStatusCollectionResponse response = check client->listServiceCallStatus();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallStatus",
"value": [
{"Active": "tYES", "Description": "Newly logged call", "StatusId": 1, "Name": "Open"}
]
}
createServiceCallStatus

Create a new ServiceCallStatus.

Parameters:

NameTypeRequiredDescription
payloadServiceCallStatusYesThe service call status to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCallStatus&#124;error

Sample code:

ServiceCallStatus created = check client->createServiceCallStatus({
name: "Open",
description: "Newly logged call",
active: "tYES"
});

Sample response:

{"Active": "tYES", "Description": "Newly logged call", "StatusId": 1, "Name": "Open"}
getServiceCallStatus

Get a single ServiceCallStatus by key.

Parameters:

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

Returns: ServiceCallStatus&#124;error

Sample code:

ServiceCallStatus status = check client->getServiceCallStatus(1);

Sample response:

{"Active": "tYES", "Description": "Newly logged call", "StatusId": 1, "Name": "Open"}
deleteServiceCallStatus

Delete a ServiceCallStatus.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCallStatus(1);
updateServiceCallStatus

Partially update a ServiceCallStatus (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCallStatus(1, {description: "Newly logged, not yet assigned"});
serviceCallStatusServiceGetServiceCallStatusList

Get service call status list.

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 statuses = check client->serviceCallStatusServiceGetServiceCallStatusList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallStatusService_GetServiceCallStatusList",
"value": [
{"StatusId": 1, "Name": "Open"}
]
}

Service Call Types

listServiceCallTypes

Query the ServiceCallTypes collection.

Parameters:

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

Returns: ServiceCallTypesCollectionResponse&#124;error

Sample code:

ServiceCallTypesCollectionResponse response = check client->listServiceCallTypes();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallTypes",
"value": [
{"Active": "tYES", "Description": "On-site hardware repair", "CallTypeID": 3, "Name": "Repair"}
]
}
createServiceCallTypes

Create a new ServiceCallType.

Parameters:

NameTypeRequiredDescription
payloadServiceCallTypeYesThe service call type to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ServiceCallType&#124;error

Sample code:

ServiceCallType created = check client->createServiceCallTypes({
name: "Repair",
description: "On-site hardware repair",
active: "tYES"
});

Sample response:

{"Active": "tYES", "Description": "On-site hardware repair", "CallTypeID": 3, "Name": "Repair"}
getServiceCallTypes

Get a single ServiceCallType by key.

Parameters:

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

Returns: ServiceCallType&#124;error

Sample code:

ServiceCallType callType = check client->getServiceCallTypes(3);

Sample response:

{"Active": "tYES", "Description": "On-site hardware repair", "CallTypeID": 3, "Name": "Repair"}
deleteServiceCallTypes

Delete a ServiceCallType.

Parameters:

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

Returns: error?

Sample code:

check client->deleteServiceCallTypes(3);
updateServiceCallTypes

Partially update a ServiceCallType (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check client->updateServiceCallTypes(3, {description: "On-site hardware repair and part replacement"});
serviceCallTypesServiceGetServiceCallTypeList

Get service call type list.

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 callTypes = check client->serviceCallTypesServiceGetServiceCallTypeList();

Sample response:

{
"odata.metadata": "https://<host>:50000/b1s/v1/$metadata#ServiceCallTypesService_GetServiceCallTypeList",
"value": [
{"CallTypeID": 3, "Name": "Repair"}
]
}

Session Management

logout

Ends the active SAP Business One Service Layer session.

Parameters:

None

Returns: error?

Sample code:

check client->logout();