contact:create

Add a new contact into the Brightpearl system.

Parameters

See the request below for the full set of parameters that you can pass when creating a contact. If you pass a company name that already exists on the system, then the contact will be created as an individual within that organisation.

Detecting duplicate contacts

There are 2 parameters to which you can add the optional "unique=1" attribute. This will check the Brightpearl database for matches, and only if none found will the contact be created. If a duplicate is found, the contact will not be inserted and the response will return a fail.

contact_email_address
contact_code

Request

<?xml version="1.0" encoding="utf-8"?> 
<request method="contact.create">
<auth token="xxxxxxxx" user="user@test.com" pass="xxxxxxxx" />
 <firstname>James</firstname >
<lastname>Dean</lastname >  
<company_name>The Very Excellent Emporium and Bistro</company_name>
<code>vexceljd</code>
<salutation>Dr.</salutation>
<email_address unique="1">james@dean.com</email_address>
<email_address_2></email_address_2>
<email_address_3></email_address_3>
<updated>0000-00-00 00:00:00</updated> Upon first create this is NOW() - not needed as param
<telephone>0845 003 8935</telephone>
<telephone_2></telephone_2>
<mobile>07778 125456</mobile>
<fax>0845 003 8935</fax>
<skype></skype>
<status_id>4</status_id>
<owner_id>39816</owner_id> #Brightpearl contact ID
<address_line_1>Mr Tasty's</address_line_1>
<address_line_2>Sugarpuff Lane</address_line_2>
<postcode>SV9 2BS</postcode>
<city>Sweetville</city>
<state_text>Berkshire</state_text>
<country_iso>GB</country_iso>
</request>

Response

The ID of the contact just created will be returned.

<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>OK</status>
<message>Contact created</message>
<datetimeutc>2009-10-29T09:06:42Z</datetimeutc>
<requesttime>0.23490</requesttime>
<contact>
<contact_id>20485</contact_id>
</contact>
</response>