Skip to main content
All CollectionsCloud Commerce ProAPI
CCP - Open API: Adding/finding a Customer
CCP - Open API: Adding/finding a Customer

Using our API to add or find details for a customer in CCP

Chelsea Kelly avatar
Written by Chelsea Kelly
Updated over 3 years ago

The AddCustomer function either:-

  • returns the first matching customer

  • or creates a new customer with the data passed up

If successful it will return a customer object:-

  • populated with the values you passed in if the user was created

  • populated with some matching values if the user was found (usually via the email address)

  • Content > ID the CustomerID you need this to use the customer in other API calls, such as SubmitOrder to create an order

Tips and Recommendations when using this function

  • Do not pass in null values, if a value is optional, it is better not to send that node in the request if you don't want to set a value.

  • An existing customer will be returned if the Email passed in matches them, this is not SalesChannelID specific

  • Use caution if the customer is on other channels, only the first matching customer is returned and this would always be the first customer regardless of the channel you put in your request

  • If Country is not populated, United Kingdom is assumed.

  • The passed in Country needs to match the name we have in our DB (need page of this list to link to)

  • VATNumber can be populated as a customer is created, but this does not mark the customer as VAT Exempt - which is a property that is not exposed by the API against the customer.

Endpoints

All requests for this function need to go to the following endpoints:

LIVE: https://wcfccpservicesbase.cloudcommercepro.com/CCPApiCustomerService.svc?wsdl

Parameters

  • intBrandID required, int32 - your brand ID

  • SalesChannelID required, int32 - the target channel ID

  • CompanyName required, string - Full customer name for Retail customer, company name if Trade customer

  • TradingName required, string - Full customer name for Retail customer, company name if Trade customer

  • FirstName required, string - First name of customer

  • LastName required, string - Surname of customer

  • EmailAddress required, string - Email of customer, this is the main field that differentiates customers - if this email matches a customer already in the system then it will return the first matching customer. Email doesn't need to be valid for new customers however if you put in a fake email address this will disable email triggers set up for that customer

  • intCustomerType required, int32 - restricted input, recognised values are:-

    • 0 - uses default, customer will be set as Public (aka Retail on screen)

    • 5 - Retailer (aka Trade on customer screen)

    • 8 - Public (aka Retail on customer screen)

  • intPaymentTerms required, int32 - restricted input, recognised values are (not sure about how some of these should work):-

    • 0 - none?

    • 1 - Full Payment Before Dispatch

    • 2 - 28 Days Credit

    • 3 - 60 Days Credit

    • 4 - Full Payment With 10 Percent Early Payment Discount

    • 5 - 50% Upfront Balance in 30 Days

    • 6 - 30% Deposit Balance on Delivery

    • 7 - Direct Debit

    • 8 - 30 Days Credit

  • CreditLimit optional, string - customers credit limit, useful for when payment terms have some credit element

  • VATNumber optional, string - customer VAT number, value here does not make customer VAT Exempt.

  • Address1 required, string - first line of Billing/Admin address

  • Address2 required, string - second line of Billing/Admin address, can be blank (not null) if no value

  • Postcode required, string - postcode of Billing/Admin address

  • TownCity required, string - town/city of Billing/Admin address

  • CountyRegion optional, string - county/region of Billing/Admin address

  • Country optional, string - full country name of Billing/Admin address, no abbreviations, default is United Kingdom if not provided.

  • TelNo required, string - landline number for Billing/Admin address, can be blank (not null) as per example

  • FaxNo optional, string - fax number for Billing/Admin address

  • MobileNo optional, string - mobile number for Billing/Admin address

  • LoginID not recommended - send 0 if your code library expects a value

  • AgentID not recommended - send 0 if your code library expects a value

Example Minimal Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header />
<soapenv:Body>
<tem:AddCustomer>
<tem:request>
<tem:BrandID>12</tem:BrandID>
<tem:SecurityHash>98,114,159,142,193,251,85,184,254,121,38,92,206,180,142,179,121,224,68,1,122,17,132,158,161,85,26,91,35,133,149,245,249,30,232,38,46,136,226,91,92,75,42,87,66,254,33,14,189,56,127,61,73,130,74,177,221,164,220,185,187,148,1,78,153,81,198,54,170,115,167,130,150,131,242,183,8,208,2,110,61,185,217,246,38,108,235,177,4,231,20,218,60,104,219,37,209,139,29,195,160,80,62,44,7,234,167,220,219,228,30,82,223,173,14,73,105,67,44,211,1,16,255,181,125,179,141,103</tem:SecurityHash>
<tem:Content>
<tem:CompanyName>Company Name</tem:CompanyName>
<tem:TradingName>Trading Name</tem:TradingName>
<tem:FirstName>First</tem:FirstName>
<tem:LastName>Last</tem:LastName>
<tem:EmailAddress>email@test.com</tem:EmailAddress>
<tem:Address1>Address1</tem:Address1>
<tem:Address2>Address2</tem:Address2>
<tem:Postcode>Postcode</tem:Postcode>
<tem:TownCity>Town/City</tem:TownCity>
<tem:TelNo />
<tem:intBrandID>12</tem:intBrandID>
<tem:SalesChannelID>36</tem:SalesChannelID>
<tem:intCustomerType>8</tem:intCustomerType>
<tem:intPaymentTerms>1</tem:intPaymentTerms>
</tem:Content>
</tem:request>
</tem:AddCustomer>
</soapenv:Body>
</soapenv:Envelope>

Example of Successful Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AddCustomerResponse xmlns="http://tempuri.org/">
<AddCustomerResult>
<Success>true</Success>
<ErrorLevel>0</ErrorLevel>
<Content>
<UserName />
<Password />
<VATNumber />
<ID>96297076</ID>
<LoginID>96386560</LoginID>
<CustomerType>Public</CustomerType>
<PaymentTerms>FullPaymentBeforeDespatch</PaymentTerms>
<EUVatExempt>false</EUVatExempt>
<BrandID>12</BrandID>
<SalesChannelID>36</SalesChannelID>
<SageAccountID>CompanyN</SageAccountID>
<FirstName>First</FirstName>
<LastName>Last</LastName>
<EmailAddress>email@test.com</EmailAddress>
<CompanyName>Company Name</CompanyName>
<TradingName>Trading Name</TradingName>
<TelNo />
<FaxNo />
<MobNo />
<Address1>Address1</Address1>
<Address2>Address2</Address2>
<TownCity>Town/City</TownCity>
<CountyRegion />
<Postcode>POSTCODE</Postcode>
<Country>United Kingdom</Country>
</Content>
<Errors />
</AddCustomerResult>
</AddCustomerResponse>
</s:Body>
</s:Envelope>

Did this answer your question?