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:
|
void AddCustomersToLineDiscountGroup(LogonInfo, RecordIdentifier, List<RecordIdentifier>) |
Assign customers to a line discount group Parameters:
|
void AddItemsToLineDiscountGroup(LogonInfo, RecordIdentifier, List<RecordIdentifier>) |
Assign items to a price discount group Parameters:
|
void Delete(LogonInfo, RecordIdentifier) |
Delete a customer Parameters:
|
Customer Get(LogonInfo, RecordIdentifier) |
Get a customer Parameters:
|
void Save(LogonInfo, Customer) |
Save a customer. If it does not exist, it will be created. Parameters:
|
void SaveCustomerLineDiscount(LogonInfo, IFDiscount) |
Save a line discount for a specific item, customer, item group, customer group or all Parameters:
|
void SaveCustomerTotalDiscount(LogonInfo, IFDiscount) |
Save a line discount for a specific item, customer, item group, customer group or all Parameters:
|
CustomersSaveResult SaveList(LogonInfo, List<Customer>) |
Save multiple customers Parameters:
|
void SavePrice(LogonInfo, IFSalesPrice) |
Save a sales price for a specific item, customer, item group, customer groups or all Parameters:
|
void SavePriceDiscountGroup(LogonInfo, PriceDiscountGroup) |
Save a price discount group Parameters:
|
Business objects
The following business objects are used by the customer API.

Name | Description |
---|---|
AccountNumber | The ID of the invoice customer account. |
Address | A list with the addresses of the customer. |
Blocked | Specifies if the customer is blocked, limited to invoices or not blocked. |
Currency | The default currency of the customer. |
CustomerGroupID | The group ID of the customer. |
DateOfBirth | The date of birth of the customer. |
DefaultBillingAddress | Get the default billing address or the first available address. |
DefaultShippingAddress | Get the default shipping address or the first available address. |
The email address of the customer. | |
FinalDiscountID | The final discount ID to which the customer belongs to. |
FirstName | The first name of the customer. |
Gender | The gender of the customer. |
ID | The ID of the customer. |
IdentificationNumber | The organization ID of the customer. |
LanguageCode | The language id of the customer. |
LastName | The last name of the customer. |
LineDiscountID | The line discount ID to which the customer belongs to. |
LocallySaved | Dictates if the customer is locally saved. If true, the customer can be sent to the cloud from the POS. |
MasterID | Unique identifier of the customer. |
MaxCredit | The maximum credit amount of the customer. |
MiddleName | The middle name of the customer. |
MobilePhone | The mobile phone number of the customer. |
MultiLineDiscountID | The multi line discount ID to which the customer belongs to. |
Name | Get the full name object of the customer. To set the name use the SetName(Name) method. |
NonChargableAccount | If true, customer account operations are not allowed. |
Prefix | The name prefix of the customer. |
PriceGroupID | The price group ID to which the customer belongs to. |
PricesIncludeSalesTax | Specifies if prices for this customer include sales tax. |
ReceiptEmailAddress | The receipt email address for the customer. |
ReceiptSettings | Specifies if the receipt should be printed, emailed, both or ignored. |
SearchName | A search alias of the customer. |
Suffix | The name suffix of the customer. |
TaxGroup | The tax group ID to which the customer belongs to. |
TaxOffice | The tax office ID to which the customer belongs to. |
Telephone | The phone number of the customer. |
Text | The full display name of the customer. |
Url | The url of the customer. |
UsePurchaseRequest | Set if the till should ask for a purchase request id for this customer. |
VatNum | The VAT number of this customer. |

For a customer object to be valid the ID property and at least Text, FirstName or LastName must be set.

Name | Description |
---|---|
CustomersErrorInfo | A list of objects containing the customers that failed the saving process along with the error message. |
EndTime | The time at which the saving process finished. |
StartTime | The time at which the saving process started. |
Success | True if the saving process finished successfully. |

Name | Description |
---|---|
Amount | Discount amount of the trade agreement. |
AppliesTo | Specifies if the discount applies to a specific customer, a customer group or all customers. |
AppliesToValue | The value for which the discount applies to. Ex: customer ID, customer group ID or empty if it is for all customers. |
Currency | ID of the currency code used in trade agreement. |
DiscountIsFor | Specifies if the discount is for an item, an item group or all items. |
DiscountIsForValue | The value for which the discount is for. Ex: item ID, item group ID or empty if it is for all items. |
FromDate | Start of trade agreement valid date. A blank value means the trade agreement has no start date (is always valid until the ToDate). Because Date objects can not be nullable, the value '01.01.1900' is considered blank. |
Percentage1 | First percentage discount of the trade agreement. |
Percentage2 |
Second percentage discount of the trade agreement. Percentage 2 will be calculated after the percentage 1 has been calculated. Example: the item costs € 10,00, percentage 1 is set to 10%, percentage 2 is set to 20%. The amount to be paid is calculated as follows: 10 * 0,9 = 9; 9 * 0,8 = 7,20. |
Quantity | The quantity needed to activate the trade agreement. When using total discount trade agreement this field refers to a minimum amount of purchase to activate the discount. |
ToDate | End of trade agreement valid date. A blank value means the trade agreement has no end date (is valid from the FromDate). Because Date objects can not be nullable, the value '01.01.1900' is considered blank. |
UnitID | Which unit does this trade agreement apply to. |

UnitID and Currency are mandatory.
If the discount does not apply to all customers, AppliesToValue is mandatory.
If the discount is not for all items, DiscountIsForValue is mandatory.

Name | Description |
---|---|
AppliesTo | Specifies if the price applies to a specific customer, a customer group or all customers. |
AppliesToValue | The value for which the price applies to. Ex: customer ID, customer group ID or empty if it is for all customers. |
Currency | ID of the currency code used in trade agreement. |
FromDate | Start of trade agreement valid date. A blank value means the trade agreement has no start date (is always valid until the ToDate). Because Date objects can not be nullable, the value '01.01.1900' is considered blank. |
Markup | The markup that should be added to the price. |
Price | The price of the trade agreement. |
PriceIsFor | Specifies if the price is for an item, an item group or all items. |
PriceIsForValue | The value for which the price is for. Ex: item ID, item group ID or empty if it is for all items. |
PriceWithTax | The price of the trade agreement including tax. |
Quantity | The quantity needed to activate the trade agreement. |
ToDate | End of trade agreement valid date. A blank value means the trade agreement has no end date (is valid from the FromDate). Because Date objects can not be nullable, the value '01.01.1900' is considered blank. |
UnitID | Which unit does this trade agreement apply to. |

UnitID and Currency are mandatory.
If the price does not apply to all customers, AppliesToValue is mandatory.
If the price is not for all items, PriceIsForValue is mandatory.

Name | Description |
---|---|
Module | Sets if the group consists of items or customers. |
Type | Sets the type of the discount group. |
GroupID | The ID of the group. |
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.