Actions
The ballerinax/sap.businessone.businesspartners package exposes the following clients:
Available clients:
| Client | Purpose |
|---|---|
Client | Manages SAP Business One business partner master data — customers, vendors, leads, contacts, and their related setup entities — via the Service Layer OData API. |
Client
The Client provides access to all business partner master data and related setup entities exposed by the SAP Business One Service Layer OData API — business partners, contacts, groups, properties, relationships, payment terms types, priorities, VAT exemptions, industries, territories, address services, and opening balances.
Configuration
sap.businessone:SessionConfig (required session credentials, passed as the first argument to new)
| Field | Type | Default | Description |
|---|---|---|---|
companyDb | string | Required | The company database (schema) to connect to |
username | string | Required | SAP Business One user code |
password | string | Required | SAP Business One user password |
ConnectionConfig (optional HTTP client configuration, passed as the second argument to new)
| Field | Type | Default | Description |
|---|---|---|---|
httpVersion | http:HttpVersion | http:HTTP_2_0 | The HTTP version understood by the client |
http1Settings | http:ClientHttp1Settings | {} | Configurations related to HTTP/1.x protocol |
http2Settings | http:ClientHttp2Settings | {} | Configurations related to HTTP/2 protocol |
timeout | decimal | 30 | The maximum time to wait (in seconds) for a response before closing the connection |
forwarded | string | "disable" | The choice of setting forwarded/x-forwarded header |
followRedirects | http:FollowRedirects | - | Configurations associated with Redirection |
poolConfig | http:PoolConfiguration | - | Configurations associated with request pooling |
cache | http:CacheConfig | {} | HTTP caching related configurations |
compression | http:Compression | http:COMPRESSION_AUTO | Specifies the way of handling compression (accept-encoding) header |
circuitBreaker | http:CircuitBreakerConfig | - | Configurations associated with the behaviour of the Circuit Breaker |
retryConfig | http:RetryConfig | - | Configurations associated with retrying |
cookieConfig | http:CookieConfig | - | Configurations associated with cookies |
responseLimits | http:ResponseLimitConfigs | {} | Configurations associated with inbound response size limits |
secureSocket | http:ClientSecureSocket | - | SSL/TLS-related options |
proxy | http:ProxyConfig | - | Proxy server related options |
socketConfig | http:ClientSocketConfig | {} | Provides settings related to client socket configuration |
validation | boolean | true | Enables the inbound payload validation functionality provided by the constraint package |
laxDataBinding | boolean | true | Enables relaxed data binding on the client side |
Initializing the client
import ballerinax/sap.businessone;
import ballerinax/sap.businessone.businesspartners;
businesspartners:Client bpClient = check new (
{companyDb: "SBODemoUS", username: "manager", password: "<password>"},
{secureSocket: {enable: false}},
"https://localhost:50000/b1s/v1"
);
Operations
Business Partners
listBusinessPartners
Queries the BusinessPartners collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListBusinessPartnersHeaders | No | Headers to be sent with the request (e.g. Prefer for server paging) |
queries | ListBusinessPartnersQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: BusinessPartnersCollectionResponse|error
Sample code:
businesspartners:BusinessPartnersCollectionResponse result = check bpClient->listBusinessPartners(
queries = {dollarSelect: "CardCode,CardName,CardType", dollarTop: 20}
);
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BusinessPartners",
"value": [
{"CardCode": "C20000", "CardName": "Example Customer Ltd", "CardType": "cCustomer"}
],
"odata.nextLink": "BusinessPartners?$skip=20"
}
createBusinessPartners
Creates a new BusinessPartner.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BusinessPartner | Yes | The business partner to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BusinessPartner|error
Sample code:
businesspartners:BusinessPartner created = check bpClient->createBusinessPartners({
CardCode: "C20000",
CardName: "Example Customer Ltd",
CardType: "cCustomer",
GroupCode: 100,
Currency: "USD"
});
Sample response:
{
"CardCode": "C20000",
"CardName": "Example Customer Ltd",
"CardType": "cCustomer",
"GroupCode": 100,
"Currency": "USD",
"Valid": "tYES"
}
getBusinessPartners
Gets a single BusinessPartner by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
cardCode | string | Yes | Key property CardCode (Edm.String) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetBusinessPartnersQueries | No | $expand and $select query options |
Returns: BusinessPartner|error
Sample code:
businesspartners:BusinessPartner bp = check bpClient->getBusinessPartners("C20000",
queries = {dollarSelect: "CardCode,CardName,City,Country"}
);
Sample response:
{
"CardCode": "C20000",
"CardName": "Example Customer Ltd",
"City": "Boston",
"Country": "US"
}
deleteBusinessPartners
Deletes a BusinessPartner.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
cardCode | string | Yes | Key property CardCode (Edm.String) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteBusinessPartners("C20000");
updateBusinessPartners
Partially updates a BusinessPartner (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
cardCode | string | Yes | Key property CardCode (Edm.String) |
payload | BusinessPartner | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateBusinessPartners("C20000", {Phone1: "+1-555-0199"});
businessPartnersServiceCreateOpenBalance
Creates an opening balance for one or more business partners.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BusinessPartnersService_CreateOpenBalance_body | Yes | Opening balance account and business partner debit/credit lines |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->businessPartnersServiceCreateOpenBalance({
openningBalanceAccount: {openBalanceAccount: "_SYS00000000001", date: "2026-01-01"},
bPCodes: [{code: "C20000", debit: 1000.00d}]
});
businessPartnersServiceInitData
Returns a template BusinessPartner populated with server-side default values, to be used as the basis for a new record.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BusinessPartner|error
Sample code:
businesspartners:BusinessPartner template = check bpClient->businessPartnersServiceInitData();
Sample response:
{
"CardType": "cCustomer",
"VatLiable": "vLiable",
"Valid": "tYES",
"Currency": "##"
}
Contacts
listContacts
Queries the Contacts collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListContactsHeaders | No | Headers to be sent with the request |
queries | ListContactsQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: ContactsCollectionResponse|error
Sample code:
businesspartners:ContactsCollectionResponse result = check bpClient->listContacts(
queries = {dollarFilter: "CardCode eq 'C20000'"}
);
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#Contacts",
"value": [
{"CardCode": "C20000", "ContactCode": 1, "Activity": "cn_Note", "Details": "Follow-up call"}
]
}
createContacts
Creates a new Contact entry (a logged activity/contact note against a business partner).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Contact | Yes | The contact entry to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: Contact|error
Sample code:
businesspartners:Contact created = check bpClient->createContacts({
CardCode: "C20000",
Activity: "cn_Note",
ContactDate: "2026-07-10",
Details: "Follow-up call regarding open invoice"
});
Sample response:
{
"CardCode": "C20000",
"ContactCode": 5,
"Activity": "cn_Note",
"ContactDate": "2026-07-10",
"Details": "Follow-up call regarding open invoice"
}
getContacts
Gets a single Contact by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
contactCode | int:Signed32 | Yes | Key property ContactCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetContactsQueries | No | $expand and $select query options |
Returns: Contact|error
Sample code:
businesspartners:Contact contact = check bpClient->getContacts(5);
Sample response:
{
"CardCode": "C20000",
"ContactCode": 5,
"Activity": "cn_Note",
"Details": "Follow-up call regarding open invoice"
}
deleteContacts
Deletes a Contact.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
contactCode | int:Signed32 | Yes | Key property ContactCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteContacts(5);
updateContacts
Partially updates a Contact (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
contactCode | int:Signed32 | Yes | Key property ContactCode (Edm.Int32) |
payload | Contact | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateContacts(5, {Closed: "tYES"});
Business Partner Groups
listBusinessPartnerGroups
Queries the BusinessPartnerGroups collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListBusinessPartnerGroupsHeaders | No | Headers to be sent with the request |
queries | ListBusinessPartnerGroupsQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: BusinessPartnerGroupsCollectionResponse|error
Sample code:
businesspartners:BusinessPartnerGroupsCollectionResponse result = check bpClient->listBusinessPartnerGroups();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BusinessPartnerGroups",
"value": [
{"Code": 100, "Name": "Customers - Domestic", "Type": "bpgt_CustomersGroup"}
]
}
createBusinessPartnerGroups
Creates a new BusinessPartnerGroup.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BusinessPartnerGroup | Yes | The group to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BusinessPartnerGroup|error
Sample code:
businesspartners:BusinessPartnerGroup created = check bpClient->createBusinessPartnerGroups({
Name: "Customers - Export",
Type: "bpgt_CustomersGroup"
});
Sample response:
{"Code": 101, "Name": "Customers - Export", "Type": "bpgt_CustomersGroup"}
getBusinessPartnerGroups
Gets a single BusinessPartnerGroup by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetBusinessPartnerGroupsQueries | No | $expand and $select query options |
Returns: BusinessPartnerGroup|error
Sample code:
businesspartners:BusinessPartnerGroup group = check bpClient->getBusinessPartnerGroups(100);
Sample response:
{"Code": 100, "Name": "Customers - Domestic", "Type": "bpgt_CustomersGroup"}
deleteBusinessPartnerGroups
Deletes a BusinessPartnerGroup.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteBusinessPartnerGroups(101);
updateBusinessPartnerGroups
Partially updates a BusinessPartnerGroup (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code | int:Signed32 | Yes | Key property Code (Edm.Int32) |
payload | BusinessPartnerGroup | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateBusinessPartnerGroups(101, {Name: "Customers - International"});
Business Partner Properties
listBusinessPartnerProperties
Queries the BusinessPartnerProperties collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListBusinessPartnerPropertiesHeaders | No | Headers to be sent with the request |
queries | ListBusinessPartnerPropertiesQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: BusinessPartnerPropertiesCollectionResponse|error
Sample code:
businesspartners:BusinessPartnerPropertiesCollectionResponse result = check bpClient->listBusinessPartnerProperties();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BusinessPartnerProperties",
"value": [
{"PropertyCode": 1, "PropertyName": "VIP Customer"}
]
}
createBusinessPartnerProperties
Creates a new BusinessPartnerProperty.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BusinessPartnerProperty | Yes | The property to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BusinessPartnerProperty|error
Sample code:
businesspartners:BusinessPartnerProperty created = check bpClient->createBusinessPartnerProperties({
PropertyName: "Preferred Vendor"
});
Sample response:
{"PropertyCode": 2, "PropertyName": "Preferred Vendor"}
getBusinessPartnerProperties
Gets a single BusinessPartnerProperty by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
propertyCode | int:Signed32 | Yes | Key property PropertyCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetBusinessPartnerPropertiesQueries | No | $expand and $select query options |
Returns: BusinessPartnerProperty|error
Sample code:
businesspartners:BusinessPartnerProperty prop = check bpClient->getBusinessPartnerProperties(1);
Sample response:
{"PropertyCode": 1, "PropertyName": "VIP Customer"}
deleteBusinessPartnerProperties
Deletes a BusinessPartnerProperty.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
propertyCode | int:Signed32 | Yes | Key property PropertyCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteBusinessPartnerProperties(2);
updateBusinessPartnerProperties
Partially updates a BusinessPartnerProperty (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
propertyCode | int:Signed32 | Yes | Key property PropertyCode (Edm.Int32) |
payload | BusinessPartnerProperty | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateBusinessPartnerProperties(2, {PropertyName: "Preferred Supplier"});
businessPartnerPropertiesServiceGetBusinessPartnerPropertyList
Returns the list of business partner property name/code pairs configured in the company.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: inline_response_200_1|error
Sample code:
businesspartners:inline_response_200_1 result = check bpClient->businessPartnerPropertiesServiceGetBusinessPartnerPropertyList();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BusinessPartnerPropertiesService_GetBusinessPartnerPropertyList",
"value": [
{"PropertyName": "VIP Customer", "PropertyCode": 1}
]
}
Payment Terms Types
listPaymentTermsTypes
Queries the PaymentTermsTypes collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListPaymentTermsTypesHeaders | No | Headers to be sent with the request |
queries | ListPaymentTermsTypesQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: PaymentTermsTypesCollectionResponse|error
Sample code:
businesspartners:PaymentTermsTypesCollectionResponse result = check bpClient->listPaymentTermsTypes();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#PaymentTermsTypes",
"value": [
{"GroupNumber": 3, "PaymentTermsGroupName": "Net 30", "NumberOfAdditionalDays": 30}
]
}
createPaymentTermsTypes
Creates a new PaymentTermsType.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | PaymentTermsType | Yes | The payment terms type to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: PaymentTermsType|error
Sample code:
businesspartners:PaymentTermsType created = check bpClient->createPaymentTermsTypes({
PaymentTermsGroupName: "Net 60",
NumberOfAdditionalDays: 60
});
Sample response:
{"GroupNumber": 4, "PaymentTermsGroupName": "Net 60", "NumberOfAdditionalDays": 60}
getPaymentTermsTypes
Gets a single PaymentTermsType by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
groupNumber | int:Signed32 | Yes | Key property GroupNumber (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetPaymentTermsTypesQueries | No | $expand and $select query options |
Returns: PaymentTermsType|error
Sample code:
businesspartners:PaymentTermsType terms = check bpClient->getPaymentTermsTypes(3);
Sample response:
{"GroupNumber": 3, "PaymentTermsGroupName": "Net 30", "NumberOfAdditionalDays": 30}
deletePaymentTermsTypes
Deletes a PaymentTermsType.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
groupNumber | int:Signed32 | Yes | Key property GroupNumber (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deletePaymentTermsTypes(4);
updatePaymentTermsTypes
Partially updates a PaymentTermsType (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
groupNumber | int:Signed32 | Yes | Key property GroupNumber (Edm.Int32) |
payload | PaymentTermsType | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updatePaymentTermsTypes(4, {GeneralDiscount: 5});
paymentTermsTypesClose
Invokes the bound action Close on a PaymentTermsType.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
groupNumber | int:Signed32 | Yes | Key property GroupNumber (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->paymentTermsTypesClose(4);
paymentTermsTypesServiceUpdateWithBPs
Updates a payment terms type and propagates the change to all business partners assigned to it.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | PaymentTermsTypesService_UpdateWithBPs_body | Yes | The payment terms type to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->paymentTermsTypesServiceUpdateWithBPs({
paymentTermsType: {GroupNumber: 3, PaymentTermsGroupName: "Net 30", NumberOfAdditionalDays: 30}
});
Priorities
listBPPriorities
Queries the BPPriorities collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListBPPrioritiesHeaders | No | Headers to be sent with the request |
queries | ListBPPrioritiesQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: BPPrioritiesCollectionResponse|error
Sample code:
businesspartners:BPPrioritiesCollectionResponse result = check bpClient->listBPPriorities();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BPPriorities",
"value": [
{"Priority": 1, "PriorityDescription": "High"}
]
}
createBPPriorities
Creates a new BPPriority.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BPPriority | Yes | The priority to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BPPriority|error
Sample code:
businesspartners:BPPriority created = check bpClient->createBPPriorities({PriorityDescription: "Low"});
Sample response:
{"Priority": 2, "PriorityDescription": "Low"}
getBPPriorities
Gets a single BPPriority by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
priority | int:Signed32 | Yes | Key property Priority (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetBPPrioritiesQueries | No | $expand and $select query options |
Returns: BPPriority|error
Sample code:
businesspartners:BPPriority priority = check bpClient->getBPPriorities(1);
Sample response:
{"Priority": 1, "PriorityDescription": "High"}
deleteBPPriorities
Deletes a BPPriority.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
priority | int:Signed32 | Yes | Key property Priority (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteBPPriorities(2);
updateBPPriorities
Partially updates a BPPriority (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
priority | int:Signed32 | Yes | Key property Priority (Edm.Int32) |
payload | BPPriority | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateBPPriorities(2, {PriorityDescription: "Low priority"});
VAT Exemptions
listBPVatExemptions
Queries the BPVatExemptions collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListBPVatExemptionsHeaders | No | Headers to be sent with the request |
queries | ListBPVatExemptionsQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: BPVatExemptionsCollectionResponse|error
Sample code:
businesspartners:BPVatExemptionsCollectionResponse result = check bpClient->listBPVatExemptions();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BPVatExemptions",
"value": [
{"AbsoluteEntry": 1, "Remarks": "Exempt for export sales", "BPCode": "C20000"}
]
}
createBPVatExemptions
Creates a new BPVatExemptions entry.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BPVatExemptions | Yes | The VAT exemption to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BPVatExemptions|error
Sample code:
businesspartners:BPVatExemptions created = check bpClient->createBPVatExemptions({
bPCode: "C20000",
remarks: "Exempt for export sales"
});
Sample response:
{"AbsoluteEntry": 2, "BPCode": "C20000", "Remarks": "Exempt for export sales"}
getBPVatExemptions
Gets a single BPVatExemptions entry by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetBPVatExemptionsQueries | No | $expand and $select query options |
Returns: BPVatExemptions|error
Sample code:
businesspartners:BPVatExemptions exemption = check bpClient->getBPVatExemptions(1);
Sample response:
{"AbsoluteEntry": 1, "BPCode": "C20000", "Remarks": "Exempt for export sales"}
deleteBPVatExemptions
Deletes a BPVatExemptions entry.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteBPVatExemptions(2);
updateBPVatExemptions
Partially updates a BPVatExemptions entry (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
absoluteEntry | int:Signed32 | Yes | Key property AbsoluteEntry (Edm.Int32) |
payload | BPVatExemptions | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateBPVatExemptions(2, {remarks: "Updated exemption reason"});
bPVatExemptionsServiceGetList
Returns the list of configured VAT exemption absolute entries and their associated business partner codes.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: inline_response_200|error
Sample code:
businesspartners:inline_response_200 result = check bpClient->bPVatExemptionsServiceGetList();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BPVatExemptionsService_GetList",
"value": [
{"AbsoluteEntry": 1, "BPCode": "C20000"}
]
}
Industries
listIndustries
Queries the Industries collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListIndustriesHeaders | No | Headers to be sent with the request |
queries | ListIndustriesQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: IndustriesCollectionResponse|error
Sample code:
businesspartners:IndustriesCollectionResponse result = check bpClient->listIndustries();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#Industries",
"value": [
{"IndustryCode": 1, "IndustryName": "Manufacturing", "IndustryDescription": "Manufacturing sector"}
]
}
createIndustries
Creates a new Industry.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Industry | Yes | The industry to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: Industry|error
Sample code:
businesspartners:Industry created = check bpClient->createIndustries({
IndustryName: "Retail",
IndustryDescription: "Retail sector"
});
Sample response:
{"IndustryCode": 2, "IndustryName": "Retail", "IndustryDescription": "Retail sector"}
getIndustries
Gets a single Industry by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
industryCode | int:Signed32 | Yes | Key property IndustryCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetIndustriesQueries | No | $expand and $select query options |
Returns: Industry|error
Sample code:
businesspartners:Industry industry = check bpClient->getIndustries(1);
Sample response:
{"IndustryCode": 1, "IndustryName": "Manufacturing", "IndustryDescription": "Manufacturing sector"}
deleteIndustries
Deletes an Industry.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
industryCode | int:Signed32 | Yes | Key property IndustryCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteIndustries(2);
updateIndustries
Partially updates an Industry (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
industryCode | int:Signed32 | Yes | Key property IndustryCode (Edm.Int32) |
payload | Industry | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateIndustries(2, {IndustryDescription: "General retail sector"});
Territories
listTerritories
Queries the Territories collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListTerritoriesHeaders | No | Headers to be sent with the request |
queries | ListTerritoriesQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: TerritoriesCollectionResponse|error
Sample code:
businesspartners:TerritoriesCollectionResponse result = check bpClient->listTerritories();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#Territories",
"value": [
{"TerritoryID": 1, "Description": "Northeast", "Inactive": "tNO"}
]
}
createTerritories
Creates a new Territory.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Territory | Yes | The territory to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: Territory|error
Sample code:
businesspartners:Territory created = check bpClient->createTerritories({Description: "Southwest"});
Sample response:
{"TerritoryID": 2, "Description": "Southwest", "Inactive": "tNO"}
getTerritories
Gets a single Territory by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
territoryID | int:Signed32 | Yes | Key property TerritoryID (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetTerritoriesQueries | No | $expand and $select query options |
Returns: Territory|error
Sample code:
businesspartners:Territory territory = check bpClient->getTerritories(1);
Sample response:
{"TerritoryID": 1, "Description": "Northeast", "Inactive": "tNO"}
deleteTerritories
Deletes a Territory.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
territoryID | int:Signed32 | Yes | Key property TerritoryID (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteTerritories(2);
updateTerritories
Partially updates a Territory (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
territoryID | int:Signed32 | Yes | Key property TerritoryID (Edm.Int32) |
payload | Territory | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateTerritories(2, {Inactive: "tYES"});
Relationships
listRelationships
Queries the Relationships collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListRelationshipsHeaders | No | Headers to be sent with the request |
queries | ListRelationshipsQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: RelationshipsCollectionResponse|error
Sample code:
businesspartners:RelationshipsCollectionResponse result = check bpClient->listRelationships();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#Relationships",
"value": [
{"RelationshipCode": 1, "RelationshipDescription": "Parent Company"}
]
}
createRelationships
Creates a new Relationship.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | Relationship | Yes | The relationship to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: Relationship|error
Sample code:
businesspartners:Relationship created = check bpClient->createRelationships({RelationshipDescription: "Subsidiary"});
Sample response:
{"RelationshipCode": 2, "RelationshipDescription": "Subsidiary"}
getRelationships
Gets a single Relationship by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
relationshipCode | int:Signed32 | Yes | Key property RelationshipCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetRelationshipsQueries | No | $expand and $select query options |
Returns: Relationship|error
Sample code:
businesspartners:Relationship relationship = check bpClient->getRelationships(1);
Sample response:
{"RelationshipCode": 1, "RelationshipDescription": "Parent Company"}
deleteRelationships
Deletes a Relationship.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
relationshipCode | int:Signed32 | Yes | Key property RelationshipCode (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteRelationships(2);
updateRelationships
Partially updates a Relationship (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
relationshipCode | int:Signed32 | Yes | Key property RelationshipCode (Edm.Int32) |
payload | Relationship | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateRelationships(2, {RelationshipDescription: "Wholly-owned subsidiary"});
Fiscal Registry IDs
listBPFiscalRegistryID
Queries the BPFiscalRegistryID collection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
headers | ListBPFiscalRegistryIDHeaders | No | Headers to be sent with the request |
queries | ListBPFiscalRegistryIDQueries | No | OData query options ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) |
Returns: BPFiscalRegistryIDCollectionResponse|error
Sample code:
businesspartners:BPFiscalRegistryIDCollectionResponse result = check bpClient->listBPFiscalRegistryID();
Sample response:
{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#BPFiscalRegistryID",
"value": [
{"Numerator": 1, "CNAECode": "6201-5", "Description": "Software development services"}
]
}
createBPFiscalRegistryID
Creates a new BPFiscalRegistryID.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BPFiscalRegistryID | Yes | The fiscal registry ID to create |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: BPFiscalRegistryID|error
Sample code:
businesspartners:BPFiscalRegistryID created = check bpClient->createBPFiscalRegistryID({
CNAECode: "4711-3",
Description: "Retail trade"
});
Sample response:
{"Numerator": 2, "CNAECode": "4711-3", "Description": "Retail trade"}
getBPFiscalRegistryID
Gets a single BPFiscalRegistryID by key.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
numerator | int:Signed32 | Yes | Key property Numerator (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
queries | GetBPFiscalRegistryIDQueries | No | $expand and $select query options |
Returns: BPFiscalRegistryID|error
Sample code:
businesspartners:BPFiscalRegistryID registry = check bpClient->getBPFiscalRegistryID(1);
Sample response:
{"Numerator": 1, "CNAECode": "6201-5", "Description": "Software development services"}
deleteBPFiscalRegistryID
Deletes a BPFiscalRegistryID.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
numerator | int:Signed32 | Yes | Key property Numerator (Edm.Int32) |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->deleteBPFiscalRegistryID(2);
updateBPFiscalRegistryID
Partially updates a BPFiscalRegistryID (PATCH/MERGE semantics).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
numerator | int:Signed32 | Yes | Key property Numerator (Edm.Int32) |
payload | BPFiscalRegistryID | Yes | Fields to update |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->updateBPFiscalRegistryID(2, {Description: "General retail trade"});
Opening Balances
bPOpeningBalanceServiceCreateOpenBalance
Creates an opening balance entry directly against one or more business partner codes.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BPOpeningBalanceService_CreateOpenBalance_body | Yes | Opening balance account and business partner debit/credit lines |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: error?
Sample code:
check bpClient->bPOpeningBalanceServiceCreateOpenBalance({
openningBalanceAccount: {openBalanceAccount: "_SYS00000000001", date: "2026-01-01"},
bPCodes: [{code: "C20000", debit: 1000.00d}]
});
Address Services
addressServiceGetAddressFormat
Resolves the address format definition for a given format code/name.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | AddressService_GetAddressFormat_body | Yes | The address format lookup parameters |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: AddressFormat|error
Sample code:
businesspartners:AddressFormat format = check bpClient->addressServiceGetAddressFormat({
addressFormatParams: {code: 1, name: "US Address Format"}
});
Sample response:
{"Code": 1, "Name": "US Address Format", "Format": "%Street%, %City%, %State% %ZipCode%"}
addressServiceGetFullAddress
Resolves the fully formatted, single-line address for a given set of address components.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | AddressService_GetFullAddress_body | Yes | The address components to resolve |
headers | map<string|string[]> | No | Headers to be sent with the request |
Returns: AddressReturnParams|error
Sample code:
businesspartners:AddressReturnParams fullAddress = check bpClient->addressServiceGetFullAddress({
addressParams: {Street: "Main St", StreetNo: "123", City: "Boston", State: "MA", ZipCode: "02110", Country: "US"}
});
Sample response:
{"FullAddress": "123 Main St, Boston, MA 02110"}
Session
logout
Ends the active SAP Business One Service Layer session.
Parameters:
None
Returns: error?
Sample code:
check bpClient->logout();