Customer API

This topic describes the customer APIs for the Integration Framework.

API

Name Description
void AddCustomersToTotalDiscountGroup(LogonInfo, RecordIdentifier, List<RecordIdentifier>)

Assign customers to a total discount group

Parameters:

  • logonInfo: Login information for the database
  • groupID: The group ID to which to assign the customers
  • customerIDs: Customer IDs to assign
void AddCustomersToLineDiscountGroup(LogonInfo, RecordIdentifier, List<RecordIdentifier>)

Assign customers to a line discount group

Parameters:

  • logonInfo: Login information for the database
  • groupID: The group ID to which to assign the customers
  • customerIDs: Customer IDs to assign
void AddItemsToLineDiscountGroup(LogonInfo, RecordIdentifier, List<RecordIdentifier>)

Assign items to a price discount group

Parameters:

  • logonInfo: Login information for the database
  • groupID: The group ID to which to assign the items
  • customerIDs: Item IDs to assign
void Delete(LogonInfo, RecordIdentifier)

Delete a customer

Parameters:

  • logonInfo: Login information for the database
  • customerID: The ID of the customer to delete
Customer Get(LogonInfo, RecordIdentifier)

Get a customer

Parameters:

  • logonInfo: Login information for the database
  • customerID: The ID of the customer to get
void Save(LogonInfo, Customer)

Save a customer. If it does not exist, it will be created.

Parameters:

  • logonInfo: Login information for the database
  • customer: The customer object to save
void SaveCustomerLineDiscount(LogonInfo, IFDiscount)

Save a line discount for a specific item, customer, item group, customer group or all

Parameters:

  • logonInfo: Login information for the database
  • discount: The discount object to save
void SaveCustomerTotalDiscount(LogonInfo, IFDiscount)

Save a line discount for a specific item, customer, item group, customer group or all

Parameters:

  • logonInfo: Login information for the database
  • discount: The discount object to save
CustomersSaveResult SaveList(LogonInfo, List<Customer>)

Save multiple customers

Parameters:

  • logonInfo: Login information for the database
  • customers: List of customer objects to save
void SavePrice(LogonInfo, IFSalesPrice)

Save a sales price for a specific item, customer, item group, customer groups or all

Parameters:

  • logonInfo: Login information for the database
  • salesPrice: Sale price information to save
void SavePriceDiscountGroup(LogonInfo, PriceDiscountGroup)

Save a price discount group

Parameters:

  • logonInfo: Login information for the database
  • group: The group info to save

 

Business objects

The following business objects are used by the customer API.

 

Examples

To update customers you must use the optimized update feature.

Updating a customer


	Customer existingCustomer = wcfCustomerService.Get(CreateLogonInfo(dataModel), "00002");
	existingCustomer.Text += "-Updated";

	((IOptimizedUpdate) existingCustomer).CloneUpdateListToTransportList();
	wcfCustomerService.Save(CreateLogonInfo(dataModel), existingCustomer);
		

In the above example, firstly we get an existing customer through the Integration Framework, update it's name then we clone the update list using the optimized update functionality. After we update all properties accordingly we save the customer through the Integration Framework.

Adding a customer discount


	IFDiscount newIFDiscount = new IFDiscount
	{
		AppliesTo = IFDiscount.DiscountAppliesTo.SpecificCustomer,
		AppliesToValue = "00002",
		FromDate = new Date(new DateTime(2017, 1, 1)),
		Amount = 3,
		Currency = "EUR",
		DiscountIsFor = IFDiscount.DiscountFor.AllItems,
		DiscountIsForValue = "",
		Quantity = 1,
		UnitID = "PCS"
	};
	wcfCustomerService.SaveCustomerLineDiscount(CreateLogonInfo(dataModel), newIFDiscount);
			

In the above example, we are adding a new line discount for a customer, that applies to all items.

When saving prices and discounts, if there is another entry with the same customer - item relations, quantity amount, from date, currency and unit ID, it will be updated, thus allowing to modify the amounts and end date. Otherwise a new entry will be created.

See also