update
The update request builder allows you to change existing entities.
By default, PATCH is used to only update changed fields.
The following example first gets a business partner, changes one of its values, and then sends an update request.
const { businessPartnerApi } = businessPartnerService();
// Get a business partner
const businessPartner = await businessPartnerApi
.requestBuilder()
.getByKey('1')
.execute({ destinationName: 'myDestination' });
// Change first name
businessPartner.firstName = 'Steve';
// Send a PATCH request with `{ "FirstName" : "Steve" }`
businessPartnerApi.requestBuilder().update(businessPartner);
The code above changed the first name of the given business partner.
The payload sent to the service with PATCH includes only the first name.
Be aware that update requests will fail if their ETags don't match. Check out the ETag section for more information.