Skip to main content

Actions

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

Available clients:

ClientPurpose
ClientManage SAP Business One CRM entities — activities, campaigns, target groups, and sales opportunities — through the Service Layer OData API.

Client

The Client provides operations to create, read, update, and delete SAP Business One CRM entities — activities, campaigns, target groups, sales opportunities, and their related setup/lookup entities — through the Service Layer OData API, plus a set of bound functions and function imports for specialized queries.

Configuration

Session configuration (businessone:SessionConfig, passed as the first constructor argument)

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

ConnectionConfig (passed as the second constructor argument)

FieldTypeDefaultDescription
httpVersionhttp:HttpVersionhttp:HTTP_2_0The HTTP version understood by the client
http1Settingshttp:ClientHttp1Settings{}Configurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2Settings{}Configurations 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:FollowRedirects-Configurations associated with Redirection
poolConfighttp:PoolConfiguration-Configurations associated with request pooling
cachehttp:CacheConfig{}HTTP caching related configurations
compressionhttp:Compressionhttp:COMPRESSION_AUTOSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfig-Configurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfig-Configurations associated with retrying
cookieConfighttp:CookieConfig-Configurations associated with cookies
responseLimitshttp:ResponseLimitConfigs{}Configurations associated with inbound response size limits
secureSockethttp:ClientSecureSocket-SSL/TLS-related options
proxyhttp:ProxyConfig-Proxy server related options
socketConfighttp:ClientSocketConfig{}Provides 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

The serviceUrl (default "https://localhost:50000/b1s/v1") is passed as the third constructor argument.

Initializing the client

import ballerinax/sap.businessone.crm;

configurable string serviceUrl = ?;
configurable string companyDb = ?;
configurable string username = ?;
configurable string password = ?;

crm:Client b1Client = check new (
{companyDb, username, password},
{},
serviceUrl
);

Operations

Activities

listActivities

Query the Activities collection.

Parameters:

NameTypeRequiredDescription
headersListActivitiesHeadersNoHeaders to be sent with the request (Prefer for Service Layer paging control)
queriesListActivitiesQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: ActivitiesCollectionResponse|error

Sample code:

crm:ActivitiesCollectionResponse result = check b1Client->listActivities(queries = {
dollarFilter: "Activity eq 'cn_Note'",
dollarTop: 20
});

Sample response:

{
"odata.metadata": "$metadata#Activities",
"value": [
{
"ActivityCode": 1023,
"Activity": "cn_Note",
"ActivityDate": "2026-07-10",
"Details": "Logged from the Ballerina sap.businessone.crm connector",
"Notes": "Connectivity test note",
"Closed": "tNO"
}
]
}
createActivities

Create a new Activity.

Parameters:

NameTypeRequiredDescription
payloadActivityYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: Activity|error

Sample code:

crm:Activity created = check b1Client->createActivities({
Activity: "cn_Note",
ActivityDate: "2026-07-10",
Details: "Logged from the Ballerina sap.businessone.crm connector",
Notes: "Connectivity test note — safe to delete."
});

Sample response:

{
"ActivityCode": 1023,
"Activity": "cn_Note",
"ActivityDate": "2026-07-10",
"Details": "Logged from the Ballerina sap.businessone.crm connector",
"Notes": "Connectivity test note — safe to delete.",
"Closed": "tNO"
}
getActivities

Get a single Activity by key.

Parameters:

NameTypeRequiredDescription
activityCodeint:Signed32YesKey property 'ActivityCode' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetActivitiesQueriesNoQueries to be sent with the request ($expand, $select)

Returns: Activity|error

Sample code:

crm:Activity fetched = check b1Client->getActivities(1023, queries = {
dollarSelect: "ActivityCode,Activity,ActivityDate,Details,Notes"
});

Sample response:

{
"ActivityCode": 1023,
"Activity": "cn_Note",
"ActivityDate": "2026-07-10",
"Details": "Logged from the Ballerina sap.businessone.crm connector",
"Notes": "Connectivity test note — safe to delete."
}
deleteActivities

Delete a Activity.

Parameters:

NameTypeRequiredDescription
activityCodeint:Signed32YesKey property 'ActivityCode' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteActivities(1023);
updateActivities

Partially update a Activity (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
activityCodeint:Signed32YesKey property 'ActivityCode' (Edm.Int32)
payloadActivityYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateActivities(1023, {Notes: "Updated notes"});
activitiesServiceDeleteSingleInstanceFromSeries

Delete single instance from series.

Parameters:

NameTypeRequiredDescription
payloadActivitiesService_DeleteSingleInstanceFromSeries_bodyYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->activitiesServiceDeleteSingleInstanceFromSeries({
ActivityInstanceParams: {activityCode: 1023, instanceDate: "2026-07-15"}
});
activitiesServiceGetActivityList

Get activity list.

Parameters:

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

Returns: inline_response_200|error

Sample code:

crm:inline_response_200 result = check b1Client->activitiesServiceGetActivityList();

Sample response:

{
"odata.metadata": "$metadata#ActivityParams",
"value": [
{"activityCode": 1023, "activity": "cn_Note", "cardCode": "C20000"}
]
}
activitiesServiceGetListByAttendUser

Get list by attend user.

Parameters:

NameTypeRequiredDescription
payloadActivitiesService_GetListByAttendUser_bodyYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: inline_response_200_1|error

Sample code:

crm:inline_response_200_1 result = check b1Client->activitiesServiceGetListByAttendUser({
Activity: {ActivityCode: 1023}
});

Sample response:

{
"odata.metadata": "$metadata#ActivityParams",
"value": [
{"activityCode": 1023, "handledBy": 12}
]
}
activitiesServiceGetSingleInstanceFromSeries

Get single instance from series.

Parameters:

NameTypeRequiredDescription
payloadActivitiesService_GetSingleInstanceFromSeries_bodyYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: Activity|error

Sample code:

crm:Activity instance = check b1Client->activitiesServiceGetSingleInstanceFromSeries({
ActivityInstanceParams: {activityCode: 1023, instanceDate: "2026-07-15"}
});

Sample response:

{
"ActivityCode": 1023,
"Activity": "cn_Meeting",
"ActivityDate": "2026-07-15"
}
activitiesServiceGetTopNActivityInstances

Get top N activity instances.

Parameters:

NameTypeRequiredDescription
payloadActivitiesService_GetTopNActivityInstances_bodyYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: inline_response_200_2|error

Sample code:

crm:inline_response_200_2 result = check b1Client->activitiesServiceGetTopNActivityInstances({
ActivityInstancesListParams: {startDate: "2026-07-01", instanceCount: 5}
});

Sample response:

{
"odata.metadata": "$metadata#ActivityInstanceParams",
"value": [
{"activityCode": 1023, "instanceDate": "2026-07-15"}
]
}
activitiesServiceInitData

Init data.

Parameters:

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

Returns: Activity|error

Sample code:

crm:Activity template = check b1Client->activitiesServiceInitData();

Sample response:

{
"ActivityCode": 0,
"Activity": "cn_Note",
"Closed": "tNO"
}
activitiesServiceUpdateSingleInstanceInSeries

Update single instance in series.

Parameters:

NameTypeRequiredDescription
payloadActivitiesService_UpdateSingleInstanceInSeries_bodyYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: ActivityParams|error

Sample code:

crm:ActivityParams result = check b1Client->activitiesServiceUpdateSingleInstanceInSeries({});

Sample response:

{
"activityCode": 1023,
"startDate": "2026-07-15",
"notes": "Rescheduled instance"
}

Activity Locations

listActivityLocations

Query the ActivityLocations collection.

Parameters:

NameTypeRequiredDescription
headersListActivityLocationsHeadersNoHeaders to be sent with the request
queriesListActivityLocationsQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: ActivityLocationsCollectionResponse|error

Sample code:

crm:ActivityLocationsCollectionResponse result = check b1Client->listActivityLocations();

Sample response:

{
"odata.metadata": "$metadata#ActivityLocations",
"value": [
{"Code": 3, "Name": "Head Office - Conference Room"}
]
}
createActivityLocations

Create a new ActivityLocation.

Parameters:

NameTypeRequiredDescription
payloadActivityLocationYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: ActivityLocation|error

Sample code:

crm:ActivityLocation created = check b1Client->createActivityLocations({Name: "Head Office - Conference Room"});

Sample response:

{"Code": 3, "Name": "Head Office - Conference Room"}
getActivityLocations

Get a single ActivityLocation by key.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetActivityLocationsQueriesNoQueries to be sent with the request ($expand, $select)

Returns: ActivityLocation|error

Sample code:

crm:ActivityLocation location = check b1Client->getActivityLocations(3);

Sample response:

{"Code": 3, "Name": "Head Office - Conference Room"}
deleteActivityLocations

Delete a ActivityLocation.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteActivityLocations(3);
updateActivityLocations

Partially update a ActivityLocation (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
payloadActivityLocationYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateActivityLocations(3, {Name: "Main Office - Room A"});

Activity Recipient Lists

listActivityRecipientLists

Query the ActivityRecipientLists collection.

Parameters:

NameTypeRequiredDescription
headersListActivityRecipientListsHeadersNoHeaders to be sent with the request
queriesListActivityRecipientListsQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: ActivityRecipientListsCollectionResponse|error

Sample code:

crm:ActivityRecipientListsCollectionResponse result = check b1Client->listActivityRecipientLists();

Sample response:

{
"odata.metadata": "$metadata#ActivityRecipientLists",
"value": [
{"Code": 5, "Name": "Sales Team", "Active": "tYES", "IsMultiple": "tYES"}
]
}
createActivityRecipientLists

Create a new ActivityRecipientList.

Parameters:

NameTypeRequiredDescription
payloadActivityRecipientListYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: ActivityRecipientList|error

Sample code:

crm:ActivityRecipientList created = check b1Client->createActivityRecipientLists({Name: "Sales Team", Active: "tYES"});

Sample response:

{"Code": 5, "Name": "Sales Team", "Active": "tYES", "IsMultiple": "tYES"}
getActivityRecipientLists

Get a single ActivityRecipientList by key.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetActivityRecipientListsQueriesNoQueries to be sent with the request ($expand, $select)

Returns: ActivityRecipientList|error

Sample code:

crm:ActivityRecipientList list = check b1Client->getActivityRecipientLists(5);

Sample response:

{"Code": 5, "Name": "Sales Team", "Active": "tYES", "IsMultiple": "tYES"}
deleteActivityRecipientLists

Delete a ActivityRecipientList.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteActivityRecipientLists(5);
updateActivityRecipientLists

Partially update a ActivityRecipientList (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
payloadActivityRecipientListYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateActivityRecipientLists(5, {Active: "tNO"});
activityRecipientListsServiceGetList

Get list.

Parameters:

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

Returns: inline_response_200_3|error

Sample code:

crm:inline_response_200_3 result = check b1Client->activityRecipientListsServiceGetList();

Sample response:

{
"odata.metadata": "$metadata#ActivityRecipientListParams",
"value": [
{"code": 5, "name": "Sales Team", "active": "tYES"}
]
}

Activity Statuses

listActivityStatuses

Query the ActivityStatuses collection.

Parameters:

NameTypeRequiredDescription
headersListActivityStatusesHeadersNoHeaders to be sent with the request
queriesListActivityStatusesQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: ActivityStatusesCollectionResponse|error

Sample code:

crm:ActivityStatusesCollectionResponse result = check b1Client->listActivityStatuses();

Sample response:

{
"odata.metadata": "$metadata#ActivityStatuses",
"value": [
{"StatusId": 2, "StatusName": "Open", "StatusDescription": "Open activity"}
]
}
createActivityStatuses

Create a new ActivityStatus.

Parameters:

NameTypeRequiredDescription
payloadActivityStatusYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: ActivityStatus|error

Sample code:

crm:ActivityStatus created = check b1Client->createActivityStatuses({StatusName: "Open", StatusDescription: "Open activity"});

Sample response:

{"StatusId": 2, "StatusName": "Open", "StatusDescription": "Open activity"}
getActivityStatuses

Get a single ActivityStatus by key.

Parameters:

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

Returns: ActivityStatus|error

Sample code:

crm:ActivityStatus status = check b1Client->getActivityStatuses(2);

Sample response:

{"StatusId": 2, "StatusName": "Open", "StatusDescription": "Open activity"}
deleteActivityStatuses

Delete a ActivityStatus.

Parameters:

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

Returns: error?

Sample code:

check b1Client->deleteActivityStatuses(2);
updateActivityStatuses

Partially update a ActivityStatus (PATCH/MERGE semantics).

Parameters:

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

Returns: error?

Sample code:

check b1Client->updateActivityStatuses(2, {StatusName: "In Progress"});

Activity Subjects & Types

activitySubjectServiceGetActivitySubjectList

Get activity subject list.

Parameters:

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

Returns: inline_response_200_4|error

Sample code:

crm:inline_response_200_4 result = check b1Client->activitySubjectServiceGetActivitySubjectList();

Sample response:

{
"odata.metadata": "$metadata#ActivitySubjectParams",
"value": [
{"code": 10, "description": "Follow-up call"}
]
}
activitySubjectServiceGetListByTypeCode

Get list by type code.

Parameters:

NameTypeRequiredDescription
payloadActivitySubjectService_GetListByTypeCode_bodyYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: inline_response_200_5|error

Sample code:

crm:inline_response_200_5 result = check b1Client->activitySubjectServiceGetListByTypeCode({
ActivitySubject: {code: 10}
});

Sample response:

{
"odata.metadata": "$metadata#ActivitySubjectParams",
"value": [
{"code": 10, "description": "Follow-up call"}
]
}
listActivitySubjects

Query the ActivitySubjects collection.

Parameters:

NameTypeRequiredDescription
headersListActivitySubjectsHeadersNoHeaders to be sent with the request
queriesListActivitySubjectsQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: ActivitySubjectsCollectionResponse|error

Sample code:

crm:ActivitySubjectsCollectionResponse result = check b1Client->listActivitySubjects();

Sample response:

{
"odata.metadata": "$metadata#ActivitySubjects",
"value": [
{"Code": 10, "Description": "Follow-up call", "IsActive": "tYES", "ActivityType": 1}
]
}
createActivitySubjects

Create a new ActivitySubject.

Parameters:

NameTypeRequiredDescription
payloadActivitySubjectYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: ActivitySubject|error

Sample code:

crm:ActivitySubject created = check b1Client->createActivitySubjects({Description: "Follow-up call", IsActive: "tYES", ActivityType: 1});

Sample response:

{"Code": 10, "Description": "Follow-up call", "IsActive": "tYES", "ActivityType": 1}
getActivitySubjects

Get a single ActivitySubject by key.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetActivitySubjectsQueriesNoQueries to be sent with the request ($expand, $select)

Returns: ActivitySubject|error

Sample code:

crm:ActivitySubject subject = check b1Client->getActivitySubjects(10);

Sample response:

{"Code": 10, "Description": "Follow-up call", "IsActive": "tYES", "ActivityType": 1}
deleteActivitySubjects

Delete a ActivitySubject.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteActivitySubjects(10);
updateActivitySubjects

Partially update a ActivitySubject (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
payloadActivitySubjectYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateActivitySubjects(10, {IsActive: "tNO"});
listActivityTypes

Query the ActivityTypes collection.

Parameters:

NameTypeRequiredDescription
headersListActivityTypesHeadersNoHeaders to be sent with the request
queriesListActivityTypesQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: ActivityTypesCollectionResponse|error

Sample code:

crm:ActivityTypesCollectionResponse result = check b1Client->listActivityTypes();

Sample response:

{
"odata.metadata": "$metadata#ActivityTypes",
"value": [
{"Code": 1, "Name": "Phone Call"}
]
}
createActivityTypes

Create a new ActivityType.

Parameters:

NameTypeRequiredDescription
payloadActivityTypeYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: ActivityType|error

Sample code:

crm:ActivityType created = check b1Client->createActivityTypes({Name: "Phone Call"});

Sample response:

{"Code": 1, "Name": "Phone Call"}
getActivityTypes

Get a single ActivityType by key.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetActivityTypesQueriesNoQueries to be sent with the request ($expand, $select)

Returns: ActivityType|error

Sample code:

crm:ActivityType activityType = check b1Client->getActivityTypes(1);

Sample response:

{"Code": 1, "Name": "Phone Call"}
deleteActivityTypes

Delete a ActivityType.

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteActivityTypes(1);
updateActivityTypes

Partially update a ActivityType (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
codeint:Signed32YesKey property 'Code' (Edm.Int32)
payloadActivityTypeYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateActivityTypes(1, {Name: "Call"});

Campaigns & Campaign Response Types

listCampaignResponseType

Query the CampaignResponseType collection.

Parameters:

NameTypeRequiredDescription
headersListCampaignResponseTypeHeadersNoHeaders to be sent with the request
queriesListCampaignResponseTypeQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: CampaignResponseTypeCollectionResponse|error

Sample code:

crm:CampaignResponseTypeCollectionResponse result = check b1Client->listCampaignResponseType();

Sample response:

{
"odata.metadata": "$metadata#CampaignResponseType",
"value": [
{"ResponseType": "RT01", "ResponseTypeDescription": "Interested", "IsActive": "tYES"}
]
}
createCampaignResponseType

Create a new CampaignResponseType.

Parameters:

NameTypeRequiredDescription
payloadCampaignResponseTypeYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: CampaignResponseType|error

Sample code:

crm:CampaignResponseType created = check b1Client->createCampaignResponseType({
ResponseType: "RT01",
ResponseTypeDescription: "Interested",
IsActive: "tYES"
});

Sample response:

{"ResponseType": "RT01", "ResponseTypeDescription": "Interested", "IsActive": "tYES"}
getCampaignResponseType

Get a single CampaignResponseType by key.

Parameters:

NameTypeRequiredDescription
responseTypestringYesKey property 'ResponseType' (Edm.String)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetCampaignResponseTypeQueriesNoQueries to be sent with the request ($expand, $select)

Returns: CampaignResponseType|error

Sample code:

crm:CampaignResponseType responseType = check b1Client->getCampaignResponseType("RT01");

Sample response:

{"ResponseType": "RT01", "ResponseTypeDescription": "Interested", "IsActive": "tYES"}
deleteCampaignResponseType

Delete a CampaignResponseType.

Parameters:

NameTypeRequiredDescription
responseTypestringYesKey property 'ResponseType' (Edm.String)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteCampaignResponseType("RT01");
updateCampaignResponseType

Partially update a CampaignResponseType (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
responseTypestringYesKey property 'ResponseType' (Edm.String)
payloadCampaignResponseTypeYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateCampaignResponseType("RT01", {IsActive: "tNO"});
campaignResponseTypeServiceGetResponseTypeList

Get response type list.

Parameters:

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

Returns: inline_response_200_6|error

Sample code:

crm:inline_response_200_6 result = check b1Client->campaignResponseTypeServiceGetResponseTypeList();

Sample response:

{
"odata.metadata": "$metadata#CampaignResponseTypeParams",
"value": [
{"responseType": "RT01", "responseTypeDescription": "Interested"}
]
}
listCampaigns

Query the Campaigns collection.

Parameters:

NameTypeRequiredDescription
headersListCampaignsHeadersNoHeaders to be sent with the request
queriesListCampaignsQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: CampaignsCollectionResponse|error

Sample code:

crm:CampaignsCollectionResponse result = check b1Client->listCampaigns(queries = {
dollarFilter: "Status eq 'csOpen'"
});

Sample response:

{
"odata.metadata": "$metadata#Campaigns",
"value": [
{
"CampaignNumber": 15,
"CampaignName": "Summer Promotion",
"CampaignType": "ctEmail",
"Status": "csOpen",
"StartDate": "2026-06-01",
"FinishDate": "2026-08-31"
}
]
}
createCampaigns

Create a new Campaign.

Parameters:

NameTypeRequiredDescription
payloadCampaignYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: Campaign|error

Sample code:

crm:Campaign created = check b1Client->createCampaigns({
CampaignName: "Summer Promotion",
CampaignType: "ctEmail",
StartDate: "2026-06-01",
FinishDate: "2026-08-31"
});

Sample response:

{
"CampaignNumber": 15,
"CampaignName": "Summer Promotion",
"CampaignType": "ctEmail",
"Status": "csOpen",
"StartDate": "2026-06-01",
"FinishDate": "2026-08-31"
}
getCampaigns

Get a single Campaign by key.

Parameters:

NameTypeRequiredDescription
campaignNumberint:Signed32YesKey property 'CampaignNumber' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetCampaignsQueriesNoQueries to be sent with the request ($expand, $select)

Returns: Campaign|error

Sample code:

crm:Campaign campaign = check b1Client->getCampaigns(15);

Sample response:

{
"CampaignNumber": 15,
"CampaignName": "Summer Promotion",
"CampaignType": "ctEmail",
"Status": "csOpen"
}
deleteCampaigns

Delete a Campaign.

Parameters:

NameTypeRequiredDescription
campaignNumberint:Signed32YesKey property 'CampaignNumber' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteCampaigns(15);
updateCampaigns

Partially update a Campaign (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
campaignNumberint:Signed32YesKey property 'CampaignNumber' (Edm.Int32)
payloadCampaignYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateCampaigns(15, {Remarks: "Extended by two weeks"});
campaignsCancel

Bound action 'Cancel' on Campaigns (binding type Campaign).

Parameters:

NameTypeRequiredDescription
campaignNumberint:Signed32YesKey property 'CampaignNumber' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->campaignsCancel(15);
campaignsServiceGetList

Get list.

Parameters:

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

Returns: inline_response_200_7|error

Sample code:

crm:inline_response_200_7 result = check b1Client->campaignsServiceGetList();

Sample response:

{
"odata.metadata": "$metadata#CampaignParams",
"value": [
{"campaignNumber": 15, "campaignName": "Summer Promotion"}
]
}

Partners Setups

listPartnersSetups

Query the PartnersSetups collection.

Parameters:

NameTypeRequiredDescription
headersListPartnersSetupsHeadersNoHeaders to be sent with the request
queriesListPartnersSetupsQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: PartnersSetupsCollectionResponse|error

Sample code:

crm:PartnersSetupsCollectionResponse result = check b1Client->listPartnersSetups();

Sample response:

{
"odata.metadata": "$metadata#PartnersSetups",
"value": [
{"PartnerID": 4, "Name": "Reseller", "DefaultRelationship": 1, "RelatedBP": "C20000"}
]
}
createPartnersSetups

Create a new PartnersSetup.

Parameters:

NameTypeRequiredDescription
payloadPartnersSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: PartnersSetup|error

Sample code:

crm:PartnersSetup created = check b1Client->createPartnersSetups({Name: "Reseller", RelatedBP: "C20000"});

Sample response:

{"PartnerID": 4, "Name": "Reseller", "DefaultRelationship": 1, "RelatedBP": "C20000"}
getPartnersSetups

Get a single PartnersSetup by key.

Parameters:

NameTypeRequiredDescription
partnerIDint:Signed32YesKey property 'PartnerID' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetPartnersSetupsQueriesNoQueries to be sent with the request ($expand, $select)

Returns: PartnersSetup|error

Sample code:

crm:PartnersSetup setup = check b1Client->getPartnersSetups(4);

Sample response:

{"PartnerID": 4, "Name": "Reseller", "DefaultRelationship": 1, "RelatedBP": "C20000"}
deletePartnersSetups

Delete a PartnersSetup.

Parameters:

NameTypeRequiredDescription
partnerIDint:Signed32YesKey property 'PartnerID' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deletePartnersSetups(4);
updatePartnersSetups

Partially update a PartnersSetup (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
partnerIDint:Signed32YesKey property 'PartnerID' (Edm.Int32)
payloadPartnersSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updatePartnersSetups(4, {Details: "Updated partner details"});
partnersSetupsServiceGetList

Get list.

Parameters:

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

Returns: inline_response_200_8|error

Sample code:

crm:inline_response_200_8 result = check b1Client->partnersSetupsServiceGetList();

Sample response:

{
"odata.metadata": "$metadata#PartnersSetupParams",
"value": [
{"partnerID": 4, "name": "Reseller"}
]
}

Sales Opportunities

listSalesOpportunities

Query the SalesOpportunities collection.

Parameters:

NameTypeRequiredDescription
headersListSalesOpportunitiesHeadersNoHeaders to be sent with the request
queriesListSalesOpportunitiesQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: SalesOpportunitiesCollectionResponse|error

Sample code:

crm:SalesOpportunitiesCollectionResponse result = check b1Client->listSalesOpportunities(queries = {
dollarFilter: "Status eq 'sos_Open'",
dollarTop: 20
});

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunities",
"value": [
{
"SequentialNo": 305,
"CardCode": "C20000",
"OpportunityName": "New ERP Deal",
"Status": "sos_Open",
"StartDate": "2026-07-01",
"PredictedClosingDate": "2026-09-30",
"MaxLocalTotal": 50000
}
]
}
createSalesOpportunities

Create a new SalesOpportunities.

Parameters:

NameTypeRequiredDescription
payloadSalesOpportunitiesYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: SalesOpportunities|error

Sample code:

crm:SalesOpportunities created = check b1Client->createSalesOpportunities({
CardCode: "C20000",
OpportunityName: "New ERP Deal",
StartDate: "2026-07-01",
PredictedClosingDate: "2026-09-30"
});

Sample response:

{
"SequentialNo": 305,
"CardCode": "C20000",
"OpportunityName": "New ERP Deal",
"Status": "sos_Open",
"StartDate": "2026-07-01",
"PredictedClosingDate": "2026-09-30"
}
getSalesOpportunities

Get a single SalesOpportunities by key.

Parameters:

NameTypeRequiredDescription
sequentialNoint:Signed32YesKey property 'SequentialNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetSalesOpportunitiesQueriesNoQueries to be sent with the request ($expand, $select)

Returns: SalesOpportunities|error

Sample code:

crm:SalesOpportunities opportunity = check b1Client->getSalesOpportunities(305);

Sample response:

{
"SequentialNo": 305,
"CardCode": "C20000",
"OpportunityName": "New ERP Deal",
"Status": "sos_Open"
}
deleteSalesOpportunities

Delete a SalesOpportunities.

Parameters:

NameTypeRequiredDescription
sequentialNoint:Signed32YesKey property 'SequentialNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteSalesOpportunities(305);
updateSalesOpportunities

Partially update a SalesOpportunities (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
sequentialNoint:Signed32YesKey property 'SequentialNo' (Edm.Int32)
payloadSalesOpportunitiesYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateSalesOpportunities(305, {Remarks: "Customer requested a revised quote"});
salesOpportunitiesClose

Bound action 'Close' on SalesOpportunities (binding type SalesOpportunities).

Parameters:

NameTypeRequiredDescription
sequentialNoint:Signed32YesKey property 'SequentialNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->salesOpportunitiesClose(305);

Sales Opportunity Competitor / Interest / Reason / Source Setups

listSalesOpportunityCompetitorsSetup

Query the SalesOpportunityCompetitorsSetup collection.

Parameters:

NameTypeRequiredDescription
headersListSalesOpportunityCompetitorsSetupHeadersNoHeaders to be sent with the request
queriesListSalesOpportunityCompetitorsSetupQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: SalesOpportunityCompetitorsSetupCollectionResponse|error

Sample code:

crm:SalesOpportunityCompetitorsSetupCollectionResponse result = check b1Client->listSalesOpportunityCompetitorsSetup();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunityCompetitorsSetup",
"value": [
{"SequenceNo": 1, "Name": "Acme Corp", "ThreatLevel": "tlMedium"}
]
}
createSalesOpportunityCompetitorsSetup

Create a new SalesOpportunityCompetitorSetup.

Parameters:

NameTypeRequiredDescription
payloadSalesOpportunityCompetitorSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: SalesOpportunityCompetitorSetup|error

Sample code:

crm:SalesOpportunityCompetitorSetup created = check b1Client->createSalesOpportunityCompetitorsSetup({Name: "Acme Corp", ThreatLevel: "tlMedium"});

Sample response:

{"SequenceNo": 1, "Name": "Acme Corp", "ThreatLevel": "tlMedium"}
getSalesOpportunityCompetitorsSetup

Get a single SalesOpportunityCompetitorSetup by key.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetSalesOpportunityCompetitorsSetupQueriesNoQueries to be sent with the request ($expand, $select)

Returns: SalesOpportunityCompetitorSetup|error

Sample code:

crm:SalesOpportunityCompetitorSetup competitor = check b1Client->getSalesOpportunityCompetitorsSetup(1);

Sample response:

{"SequenceNo": 1, "Name": "Acme Corp", "ThreatLevel": "tlMedium"}
deleteSalesOpportunityCompetitorsSetup

Delete a SalesOpportunityCompetitorSetup.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteSalesOpportunityCompetitorsSetup(1);
updateSalesOpportunityCompetitorsSetup

Partially update a SalesOpportunityCompetitorSetup (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
payloadSalesOpportunityCompetitorSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateSalesOpportunityCompetitorsSetup(1, {ThreatLevel: "tlHigh"});
salesOpportunityCompetitorsSetupServiceGetSalesOpportunityCompetitorSetupList

Get sales opportunity competitor setup list.

Parameters:

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

Returns: inline_response_200_9|error

Sample code:

crm:inline_response_200_9 result = check b1Client->salesOpportunityCompetitorsSetupServiceGetSalesOpportunityCompetitorSetupList();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunityCompetitorSetupParams",
"value": [
{"sequenceNo": 1, "name": "Acme Corp", "threatLevel": "tlMedium"}
]
}
listSalesOpportunityInterestsSetup

Query the SalesOpportunityInterestsSetup collection.

Parameters:

NameTypeRequiredDescription
headersListSalesOpportunityInterestsSetupHeadersNoHeaders to be sent with the request
queriesListSalesOpportunityInterestsSetupQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: SalesOpportunityInterestsSetupCollectionResponse|error

Sample code:

crm:SalesOpportunityInterestsSetupCollectionResponse result = check b1Client->listSalesOpportunityInterestsSetup();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunityInterestsSetup",
"value": [
{"SequenceNo": 1, "Description": "Cloud Migration"}
]
}
createSalesOpportunityInterestsSetup

Create a new SalesOpportunityInterestSetup.

Parameters:

NameTypeRequiredDescription
payloadSalesOpportunityInterestSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: SalesOpportunityInterestSetup|error

Sample code:

crm:SalesOpportunityInterestSetup created = check b1Client->createSalesOpportunityInterestsSetup({Description: "Cloud Migration"});

Sample response:

{"SequenceNo": 1, "Description": "Cloud Migration"}
getSalesOpportunityInterestsSetup

Get a single SalesOpportunityInterestSetup by key.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetSalesOpportunityInterestsSetupQueriesNoQueries to be sent with the request ($expand, $select)

Returns: SalesOpportunityInterestSetup|error

Sample code:

crm:SalesOpportunityInterestSetup interest = check b1Client->getSalesOpportunityInterestsSetup(1);

Sample response:

{"SequenceNo": 1, "Description": "Cloud Migration"}
deleteSalesOpportunityInterestsSetup

Delete a SalesOpportunityInterestSetup.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteSalesOpportunityInterestsSetup(1);
updateSalesOpportunityInterestsSetup

Partially update a SalesOpportunityInterestSetup (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
payloadSalesOpportunityInterestSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateSalesOpportunityInterestsSetup(1, {Description: "Cloud & AI Migration"});
salesOpportunityInterestsSetupServiceGetSalesOpportunityInterestSetupList

Get sales opportunity interest setup list.

Parameters:

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

Returns: inline_response_200_10|error

Sample code:

crm:inline_response_200_10 result = check b1Client->salesOpportunityInterestsSetupServiceGetSalesOpportunityInterestSetupList();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunityInterestSetupParams",
"value": [
{"sequenceNo": 1, "description": "Cloud Migration"}
]
}
listSalesOpportunityReasonsSetup

Query the SalesOpportunityReasonsSetup collection.

Parameters:

NameTypeRequiredDescription
headersListSalesOpportunityReasonsSetupHeadersNoHeaders to be sent with the request
queriesListSalesOpportunityReasonsSetupQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: SalesOpportunityReasonsSetupCollectionResponse|error

Sample code:

crm:SalesOpportunityReasonsSetupCollectionResponse result = check b1Client->listSalesOpportunityReasonsSetup();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunityReasonsSetup",
"value": [
{"SequenceNo": 1, "Description": "Better pricing"}
]
}
createSalesOpportunityReasonsSetup

Create a new SalesOpportunityReasonSetup.

Parameters:

NameTypeRequiredDescription
payloadSalesOpportunityReasonSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: SalesOpportunityReasonSetup|error

Sample code:

crm:SalesOpportunityReasonSetup created = check b1Client->createSalesOpportunityReasonsSetup({Description: "Better pricing"});

Sample response:

{"SequenceNo": 1, "Description": "Better pricing"}
getSalesOpportunityReasonsSetup

Get a single SalesOpportunityReasonSetup by key.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetSalesOpportunityReasonsSetupQueriesNoQueries to be sent with the request ($expand, $select)

Returns: SalesOpportunityReasonSetup|error

Sample code:

crm:SalesOpportunityReasonSetup reason = check b1Client->getSalesOpportunityReasonsSetup(1);

Sample response:

{"SequenceNo": 1, "Description": "Better pricing"}
deleteSalesOpportunityReasonsSetup

Delete a SalesOpportunityReasonSetup.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteSalesOpportunityReasonsSetup(1);
updateSalesOpportunityReasonsSetup

Partially update a SalesOpportunityReasonSetup (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
payloadSalesOpportunityReasonSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateSalesOpportunityReasonsSetup(1, {Description: "Better pricing and support"});
salesOpportunityReasonsSetupServiceGetSalesOpportunityReasonSetupList

Get sales opportunity reason setup list.

Parameters:

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

Returns: inline_response_200_11|error

Sample code:

crm:inline_response_200_11 result = check b1Client->salesOpportunityReasonsSetupServiceGetSalesOpportunityReasonSetupList();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunityReasonSetupParams",
"value": [
{"sequenceNo": 1, "description": "Better pricing"}
]
}
listSalesOpportunitySourcesSetup

Query the SalesOpportunitySourcesSetup collection.

Parameters:

NameTypeRequiredDescription
headersListSalesOpportunitySourcesSetupHeadersNoHeaders to be sent with the request
queriesListSalesOpportunitySourcesSetupQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: SalesOpportunitySourcesSetupCollectionResponse|error

Sample code:

crm:SalesOpportunitySourcesSetupCollectionResponse result = check b1Client->listSalesOpportunitySourcesSetup();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunitySourcesSetup",
"value": [
{"SequenceNo": 1, "Description": "Trade Show"}
]
}
createSalesOpportunitySourcesSetup

Create a new SalesOpportunitySourceSetup.

Parameters:

NameTypeRequiredDescription
payloadSalesOpportunitySourceSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: SalesOpportunitySourceSetup|error

Sample code:

crm:SalesOpportunitySourceSetup created = check b1Client->createSalesOpportunitySourcesSetup({Description: "Trade Show"});

Sample response:

{"SequenceNo": 1, "Description": "Trade Show"}
getSalesOpportunitySourcesSetup

Get a single SalesOpportunitySourceSetup by key.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetSalesOpportunitySourcesSetupQueriesNoQueries to be sent with the request ($expand, $select)

Returns: SalesOpportunitySourceSetup|error

Sample code:

crm:SalesOpportunitySourceSetup source = check b1Client->getSalesOpportunitySourcesSetup(1);

Sample response:

{"SequenceNo": 1, "Description": "Trade Show"}
deleteSalesOpportunitySourcesSetup

Delete a SalesOpportunitySourceSetup.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteSalesOpportunitySourcesSetup(1);
updateSalesOpportunitySourcesSetup

Partially update a SalesOpportunitySourceSetup (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
payloadSalesOpportunitySourceSetupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateSalesOpportunitySourcesSetup(1, {Description: "Trade Show 2026"});
salesOpportunitySourcesSetupServiceGetSalesOpportunitySourceSetupList

Get sales opportunity source setup list.

Parameters:

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

Returns: inline_response_200_12|error

Sample code:

crm:inline_response_200_12 result = check b1Client->salesOpportunitySourcesSetupServiceGetSalesOpportunitySourceSetupList();

Sample response:

{
"odata.metadata": "$metadata#SalesOpportunitySourceSetupParams",
"value": [
{"sequenceNo": 1, "description": "Trade Show"}
]
}

Sales Stages

listSalesStages

Query the SalesStages collection.

Parameters:

NameTypeRequiredDescription
headersListSalesStagesHeadersNoHeaders to be sent with the request
queriesListSalesStagesQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: SalesStagesCollectionResponse|error

Sample code:

crm:SalesStagesCollectionResponse result = check b1Client->listSalesStages();

Sample response:

{
"odata.metadata": "$metadata#SalesStages",
"value": [
{"SequenceNo": 1, "Name": "Qualification", "ClosingPercentage": 10, "IsSales": "tYES"}
]
}
createSalesStages

Create a new SalesStage.

Parameters:

NameTypeRequiredDescription
payloadSalesStageYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: SalesStage|error

Sample code:

crm:SalesStage created = check b1Client->createSalesStages({Name: "Qualification", ClosingPercentage: 10, IsSales: "tYES"});

Sample response:

{"SequenceNo": 1, "Name": "Qualification", "ClosingPercentage": 10, "IsSales": "tYES"}
getSalesStages

Get a single SalesStage by key.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetSalesStagesQueriesNoQueries to be sent with the request ($expand, $select)

Returns: SalesStage|error

Sample code:

crm:SalesStage stage = check b1Client->getSalesStages(1);

Sample response:

{"SequenceNo": 1, "Name": "Qualification", "ClosingPercentage": 10, "IsSales": "tYES"}
deleteSalesStages

Delete a SalesStage.

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteSalesStages(1);
updateSalesStages

Partially update a SalesStage (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
sequenceNoint:Signed32YesKey property 'SequenceNo' (Edm.Int32)
payloadSalesStageYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateSalesStages(1, {ClosingPercentage: 15});

Target Groups

listTargetGroups

Query the TargetGroups collection.

Parameters:

NameTypeRequiredDescription
headersListTargetGroupsHeadersNoHeaders to be sent with the request
queriesListTargetGroupsQueriesNoOData query parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select)

Returns: TargetGroupsCollectionResponse|error

Sample code:

crm:TargetGroupsCollectionResponse result = check b1Client->listTargetGroups();

Sample response:

{
"odata.metadata": "$metadata#TargetGroups",
"value": [
{"TargetGroupCode": "TG-001", "TargetGroupName": "Enterprise Prospects", "TargetGroupType": "tgtCustomer"}
]
}
createTargetGroups

Create a new TargetGroup.

Parameters:

NameTypeRequiredDescription
payloadTargetGroupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: TargetGroup|error

Sample code:

crm:TargetGroup created = check b1Client->createTargetGroups({
TargetGroupCode: "TG-001",
TargetGroupName: "Enterprise Prospects",
TargetGroupType: "tgtCustomer"
});

Sample response:

{"TargetGroupCode": "TG-001", "TargetGroupName": "Enterprise Prospects", "TargetGroupType": "tgtCustomer"}
getTargetGroups

Get a single TargetGroup by key.

Parameters:

NameTypeRequiredDescription
targetGroupCodestringYesKey property 'TargetGroupCode' (Edm.String)
headersmap|string|string[]||NoHeaders to be sent with the request
queriesGetTargetGroupsQueriesNoQueries to be sent with the request ($expand, $select)

Returns: TargetGroup|error

Sample code:

crm:TargetGroup targetGroup = check b1Client->getTargetGroups("TG-001");

Sample response:

{"TargetGroupCode": "TG-001", "TargetGroupName": "Enterprise Prospects", "TargetGroupType": "tgtCustomer"}
deleteTargetGroups

Delete a TargetGroup.

Parameters:

NameTypeRequiredDescription
targetGroupCodestringYesKey property 'TargetGroupCode' (Edm.String)
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->deleteTargetGroups("TG-001");
updateTargetGroups

Partially update a TargetGroup (PATCH/MERGE semantics).

Parameters:

NameTypeRequiredDescription
targetGroupCodestringYesKey property 'TargetGroupCode' (Edm.String)
payloadTargetGroupYesRequest payload
headersmap|string|string[]||NoHeaders to be sent with the request

Returns: error?

Sample code:

check b1Client->updateTargetGroups("TG-001", {TargetGroupName: "Key Enterprise Prospects"});
targetGroupsServiceGetList

Get list.

Parameters:

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

Returns: inline_response_200_13|error

Sample code:

crm:inline_response_200_13 result = check b1Client->targetGroupsServiceGetList();

Sample response:

{
"odata.metadata": "$metadata#TargetGroupParams",
"value": [
{"targetGroupCode": "TG-001", "targetGroupName": "Enterprise Prospects"}
]
}

Session

logout

Ends the active SAP Business One Service Layer session.

Parameters:

None

Returns: error?

Sample code:

check b1Client->logout();