Customer service

Methods associated with customers.

AddRelation(customerId, firstName, lastName, birthdate, gender, LoginInfo)

This method is used to add a relation to a specific customer. The relation is a child related to the customer. The method return a repsonse object.

Parameter Type Max length Description Example Comment
CustomerId string 9 char The customer id 12345679  
firstName string 35 char The relations surname Test  
lastName string 35 char The relations lastname    
birthdate string   The birthdate of the relation 20070514  
gender Enum   The relation is either a boy or a girl Boy Enums.Gender.Boy
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

CancelPeriodItem(customerId, period, LoginInfo)

The method is used to cancel/decline the specific period’s item.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
period string 6 char The period the customer wants to end 200504  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

CancelPeriodItemByCode(customerId, period, reasonCode, LoginInfo)

This method is and extension of CancelPeriodItem The method is used to cancel/decline the specific period’s item based on a reason code.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
period string 6 char The period the customer wants to end 200504  
reasonCode string 2 char The value of a no-thanks reason 01 Reason codes can be found using NameValueService CancelPeriodItemReasonCode
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

DeleteCustomerUserAccount(customerId, userId, LoginInfo)

This method deletes a user account by using a specified user id and customer id.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 123456789  
userId string 75 char UserId   Length is individual to each Pulsen client Usually only 4 characters long
LoginInfo object   See section LoginInfo    
Return value Comment
A CustomerUser object See section CustomerUser

DeleteEmailAddress(emailAddress, LoginInfo)

This method deletes an email address. This method is primarily used to remove an email address when opting out of an email newsletter etc., and when other customer details like the customer ID is unavailable.

Parameter Type Max length Description Example
emailAddress string 75 char The customer email address customer@company.com
LoginInfo object   See section LoginInfo  
Return value Comment
A Response object See section Response

DeleteRelation(customerId, LoginInfo)

The method is used to delete a relation to a specific customer. The relation is a child related to the customer. The method returns a repsonse object.

Parameter Type Max length Description Example Comment
CustomerId string 9 char The customer id 12345679  
firstName string 35 char The relations surname Test  
lastName string 35 char The relations lastname    
birthdate string   The birthdate of the relation 20070514  
gender Enum   The relation is either a boy or a girl Boy Enums.Gender.Boy
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

EndCustomerRelation(customerId, exitCode, period, LoginInfo)

The method is used to end a commitment under a specific period. The exit code i specific to each client. Please contact the client to get a list of valid exit codes. The method returns a repsonse object.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
forceEnd bool?   Set to true if the relation should be ended even though the customer hasn’t fulfilled their obligation   If set to false and the customer hasn’t fulfilled their obligation this method will return as a failure with error code 96 and a relevant message.
exitCode string 3 char The exit code 600 Each client has there own exit codes.
period string 6 char The period the customer wants to end 200504  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

GetConsents(LoginInfo)

This method is used to get all active consents for a specific sales channel.

Parameter Type Description
LoginInfo object See section LoginInfo
Return value Comment
A list of Consents See section ConsentValue

GetCustomerAlternativeClubItems(customerid, period, LoginInfo)

This method is used to get all alternative club items for specific customer and period.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
period string 6 char The period where you want your alt. items from 200504  
LoginInfo object   See section LoginInfo    
Return value Comment
AlternativeClubItem See section AlternativeClubItem

GetCustomerBonus(customerId, LoginInfo)

This method is used to get information about the customer’s bonuses. I.e. next bonus level, current bonus. The method also retrieves information about the customer’s engagements i.e. web entry. GetCustomerBonus() is a wrapper method for Stroede Ralton’s and retrieves the data from Stroede Ralton’s web service.

Parameter Type Max length Description Example Comment
CustomerId string 9 char The customer id 12345679  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

GetCustomerCrm(customerId, LoginInfo)

This method is used to get information about the customer’s crm information. I.e. CrmId from Voyado, Agillic. If no CrmId is registered the field will return an empty field.

Parameter Type Max length Description Example Comment
CustomerId string 9 char The customer id 12345679  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section CustomerCrmInfo

GetCustomerByCustomerId(customerId, LoginInfo)

This method retrieves information about the customer using a specified customer ID.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 123124  
LoginInfo object   See section LoginInfo    
Return value Comment
A Customer object See section Customer

GetCustomerByCustomerIdWithClubInfo(customerId, isClub, LoginInfo)

This method retrieves information about the customer using a specified customer ID and can also display club information if the isClub property is set to true and the company is using club functionality.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 123124  
isClub bool?   Set to true to get club information about the customer   Only concerns companies using club functionality
LoginInfo object   See section LoginInfo    
Return value Comment
A Customer object See section Customer

GetCustomerByEmail(emailAddress, LoginInfo)

This method retrieves information about the customer using a specified customer email address.

Note: In some cases, there can be multiple customer accounts with the same email address, for instance when a customer has forgotten the login information and adds a new account. This method always returns the most recently updated customer account.

Parameter Type Max length Description Example Comment
emailAddress string 75 char The customers email address customer@company.com  
LoginInfo object   See section LoginInfo    
Return value Comment
A Customer object See section Customer

GetCustomerBySSN(SSN, LoginInfo)

This method retrieves information about the customer using a specified customer ID.

Parameter Type Max length Description Example Comment
SSN string 13 char The customers social security number or birth date. XXXXXXXXXX-XXXX Must follow standard format depending on country
LoginInfo object   See section LoginInfo    
Return value Comment
A Customer object See section Customer

GetCustomerBySSNAndCountry(SSN, country, LoginInfo)

This method retrieves information about the customer using a specified Social Security Number and country. Method is primarily used when the country must be specified, e.g. when the sales channel represents the EU. Sales channels are usually specific to a country. The SSN must be unique to the customer, so method is only applicable in countries where this is available. If the function is activated customers can be retrieved through Decidas. Please see the WsPCL Decidas documentation for more information

Parameter Type Max length Description Example Comment
SSN string 13 char The customers social security number or birth date. XXXXXXXXXX-XXXX Must follow standard format depending on country
country Enum.Country   The country Country.Sweden Not all countries are applicable Please refer to other documentation provided by client.
LoginInfo object   See section LoginInfo    
Return value Comment
A Customer object See section Customer

GetCustomerClubInfo(customerId, LoginInfo)

This method is used to get the club information on a customer. This could be used instead of fetching all available customer information if you intent to only display club related information.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 123456789 Has to be an existing customer
LoginInfo object   See section LoginInfo    
Return value Comment
A Club object See section Club

GetCustomerConsents(customerId, LoginInfo)

This method is used to get all active consents on a customer.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 123456789 Has to be an existing customer
LoginInfo object   See section LoginInfo    
Return value Comment
A ListWrapper of CustomerConsent See section CustomerConsent

GetCustomerFromExternalPartner(ssn, country, partner, LoginInfo)

This method is used to get customer information (mainly delivery/invoice address) from an external partner. Currently WsPCL only supports Decidas but more partners might be added later. Please see the documentation for WsPCL Decidas for more detailed information.

Parameter Type Max length Description Example Comment
SSN string 13 char The customers social security number or birth date. XXXXXXXXXX-XXXX Must follow standard format depending on country
country Enum   The country Sweden Not all countries are applicable Please refer to other documentation provided by client.
partner Enum   The external partner ExternalPartner.Decidas  
LoginInfo object   See section LoginInfo    
Return value Comment
A Customer object See section Customer

GetCustomerLedger(invoiceNr, LoginInfo)

This method is used to get information about a ledger which will also show which customer the ledger is connected to.

Parameter Type Max length Description Example Comment
invoiceNr string 10 char The id of the invoice 0123456789  
LoginInfo object   See section LoginInfo    
Return value Comment
A Ledger object See section Leger

GetCustomerObligation(customerId, LoginInfo)

This method is used to get information about a specific customer’s obligation.

Parameter Type Max length Description Example
customerId string 9 char The id of the customer 123456789
LoginInfo object   See section LoginInfo  
Return value Comment
A CustomerObligation object See section CustomerObligation

Note: Method is obsolete (2018-05-25) GetCustomerUser(userId, LoginInfo)

This method gets Harmoney user information.

Parameter Type Max length Description Example Comment
userId string 75 char The user id 12313443 Length is individual to each Pulsen client Usually only 4 characters long
LoginInfo object   See section LoginInfo    
Return value Comment
A of CustomerUser object See section CustomerUser

GetCustomerUsersByCustomerId(CustomerId, LoginInfo)

This method returns a list containing Harmoney users by using a specified customer id.

Parameter Type Max length Description Example Comment
CustomerId string 9 char The customer id 12345679  
LoginInfo object   See section LoginInfo    
Return value Comment
A ListWrapper of CustomerUser objects See section CustomerUser

GetCustomerUserByEmail(emailAddress, LoginInfo)

This method gets Harmoney user information by using a specified email address

Parameter Type Max length Description Example
emailAddress string 75 char The customer email address customer@company.com
LoginInfo object   See section LoginInfo  
Return value Comment
A of CustomerUser object See section CustomerUser

GetCustomerUsersByEmail(emailAddress, LoginInfo)

This method returns a list of Harmoney users by using a specified email address. The method uses a listwrapper to present the response(see section ListWrapper for more information)

Parameter Type Max length Description Example
emailAddress string 75 char The customer email address customer@company.com
LoginInfo object   See section LoginInfo  
Return value Comment
A ListWrapper of CustomerUser objects See section CustomerUser

GetDecidasCreditCheck(ssn, country, amount, isCompany, LoginInfo)

Performs a credit check via the Decidas service. After credit check the returning object can be attached to the customer by setting the Customer.CreditCheck property. When saving the order this property will be taken into account.

This is an add-on function, and more detailed documentation is available. Contact your sales contact at Pulsen to find out more about this function.

Parameter Type Max length Description Example Comment
ssn string 13 char The customers social security number or birth date. XXXXXXXXXX-XXXX Must follow standard format depending on country
country string 2 char The country for to perform the credit check SV Country is an ISO 3166-1 alpha-2 value
amount integer   An integer for the amount to be authorized 1499  
isCompany bool     true or false  
LoginInfo object   See section LoginInfo    
Return value Comment
A CreditCheckDecidas object See section CreditCheckDecidas

GetFuturePeriods(customerId, LoginInfo)

This method is used to get a customer’s future periods. Some of the information can then be used to decline a certain period for a customer using SaveCustomer

Parameter Type Max length Description Example Comment
customerId string 10 char The customer’s Id 1234567890 Has to be an existing customer
LoginInfo object   See section LoginInfo    
Return value Comment
A List of PeriodProperties See section PeriodProperties

GetPastPeriods(customerId, LoginInfo)

This method is used to get a customer’s past periods.

Parameter Type Max length Description Example Comment
customerId string 10 char The customer’s Id 1234567890 Has to be an existing customer
LoginInfo object   See section LoginInfo    
Return value Comment
A List of PeriodProperties See section PeriodProperties

GetRelationsByCustomerId(customerId, LoginInfo)

This method is used to get information about the customer’s relations. The method returns a list of relations. The return type is a listwrapper of relations.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
LoginInfo object   See section LoginInfo    
Return value Comment
A ListWrapper object See section ListWrapper for more information

ValidateCustomer(customer, LoginInfo)

This method validates a Customer object. Use the method to e.g. check whether a customer is blocked, postal code is incorrect or if the customer may be a duplicate. The method does not save any information in Harmoney, use the SaveCustomer method for this

Note: If the validated customer is a new customer it will not receive a valid customer ID until SaveCustomer is called.

Parameter Type Max length Description Example
customer object   See section Customer  
LoginInfo object   See section LoginInfo  
Return value Comment
A validated Customer object See section Customer

SaveCustomer(customerId, period, LoginInfo)

This method creates a new customer account or updates an existing customer.

Parameter Type Max length Description Example
customer object   See section Customer  
LoginInfo object   See section LoginInfo  
Return value Comment
A validated Customer object See section Customer

SaveCustomerAlternativeClubItems(customerid, period, alternativeItemList, LoginInfo)

Saves the provided alternativeItemList (club functionality) to Harmoney.

To identify each alternative item (key) following is mandatory:

  • customerId
  • period
  • AlternativeItem.Id
  • AlternativeItem.DistributionId

Following AlternativeItem attribute could be updated when a correct keys is provided:

  • AlternativeItem.Selected
  • AlternativeItem.Attribute1
  • AlternativeItem.Quantity

It is not possible to:

  • update other values when a deselection is applied
  • update a deselected item in harmoney

Note: To deselect, the data in harmoney must be selected, othwerwise not success response will be returned.

To get available alternative items see method GetCustomerAlternativeClubItems

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
period string 6 char The period where you want your alt. items from 200504  
alternativeItemList List   A list of alternative club items See section AlternativeItem    
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

Note: Method is obsolete (2018-05-25) SaveCustomerUserAccount(customerId, userId, userPassword, accountType, loginInfo)

This method creates a user account linked to the specified customer number

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 123456789  
userId string 75 char UserId   Length is individual to each Pulsen client Usually only 4 characters long
userPassword string 20 char     UserPassword
accountType Enum       Default value Enums.AccountType.Regular
LoginInfo object   See section LoginInfo    
Return value Comment
A ListWrapper of CustomerUser objects See section CustomerUser

SaveEmailAddress(emailAddress, LoginInfo)

This method creates a new email address or updates an existing email address. This method is primarily to save an email address when signing up for email newsletters etc., and when other customer details like the customer ID are unavailable.

Parameter Type Max length Description Example
emailAddress string 75 char The customer email address customer@company.com
LoginInfo object   See section LoginInfo  
Return value Comment
A Response object See section Response

SendCustomerMessage(customerId, printType, LoginInfo)

This method is used to send a message to the customer regarding consent. The type of message is decided by the PrintType Enum being sent in.

Parameter Type Max length Description Example
customerId string 9 char The customer Id 123456789
printType Enum   What type of message should be sent to the customer See enumeration for PrintType
LoginInfo object   See section LoginInfo  
Return value Comment
A Response object See section Response

UndoCancelPeriodItem(customerId, period, LoginInfo)

The method is used to revert a cancel (no-thanks) for a specific period’s item.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
period string 6 char The period the customer wants to end 200504  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

UpdateCustomerMembership(customerID, fromDate, toDate, LoginInfo)

This method is used to put a customer on hold between a certain date. Example is if they don’t want to be an active customer during the summer.

Parameter Type Description
customerId string The customer’s Id which is desired to update.
fromDate DateTime The starting date of a customer’s pause in membership.
toDate DateTime The ending date of a customer’s pause in membership.
LoginInfo object See section LoginInfo
Return value Comment
A Response object See section Response

UpdatePaymentMethodOnInvoice(invoice, LoginInfo)

This method is used to update the paymentmethod on an invoice.

Parameter Type Description
invoice object See section InvoiceToChange
LoginInfo object See section LoginInfo
Return value Comment
A Response object See section Response

UpdateRelation(customerId, LoginInfo)

The method is used to update an existing relation to a specific customer. The relation is a child related to the customer. The method returns a repsonse object. Mandatory fields are customerId and relationId

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
relationId string 10 char      
firstName string 35 char The relations surname Test  
lastName string 35 char The relations lastname    
birthdate string 8 char The birthdate of the relation 20070514  
gender Enum   The relation is either a boy or a girl Boy Enums.Gender.Boy
passive bool   True or false true  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

GetCustomerDefaultCreditCard(customerId, LoginInfo)

The method is used to get defaultcreditcard associated with a user. The method returns a DefaultCreditCard object. Mandatory fields are customerId and LoginInfo.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
LoginInfo object   See section LoginInfo    
Return value Comment
A DefaultCreditCard object See section DefaultCreditCard

DeleteCustomerDefaultCreditCard(customerId, LoginInfo)

The method is used to delete the defaultcreditcard associated with a user. The method returns a Response object. Mandatory fields are customerId and LoginInfo.

Parameter Type Max length Description Example Comment
customerId string 9 char The customer id 12345679  
LoginInfo object   See section LoginInfo    
Return value Comment
A Response object See section Response

SaveCustomerDefaultCreditCard(DefaultCreditCard, LoginInfo)

This method saves the defaultcreditcard associated with a user.

Parameter Type Max length Description Example
DefaultCreditCard object   See section DefaultCreditCard  
LoginInfo object   See section LoginInfo  
Return value Comment
A Response object See section Response

SaveCustomerPremiums(customerId, enrolledByCustomerId, subCampainId, PremiumType, articleList, info)

This method saves premium articles for the recruiter. It is used to assign premiums after a new customer has been created. For premium article object: only ItemId and Quantity fields are mandatory. Up to two attributes can also be used.

Parameter Type Max length Description Example
customerId string 9 char The customer id for the recruiter 123456789
enrolledByCustomerId string 9 char The id for the customer enrolled 123456789
subCampaignId string 7 char The id of the sub campaign in Harmoney SUBCAMP
premiumType Enum   The type of premium being used See section PremiumType
articleList List of articles   List of selectable premium articles See section PremiumArticle
loginInfo object   See section LoginInfo  
Return value Comment
A Response object See section Response

GetCustomerByMiscInfo(MiscInfo, LoginInfo)

This method returns the Customer associated with the provided MiscInfo type and value.

Parameter Type Max length Description Example
MiscInfo object   See section MiscInfo  
LoginInfo object   See section LoginInfo  
Return value Comment
A Customer object See section Customer