Create

Create

Adds a customer to an account.

Request

Method
URL
POST

Headers

Name
Required
Type
Description
APIKey
Guid
A valid API key with a scope of Customers | Create

Body

Name
Required
Type
Description
ExternalID
Text
An optional unique identifier that can be supplied by the caller. This can be used to find the customer after they are created.
DisplayName
Text
The display name of the customer.
ForceUnique
Boolean
Indicates how to behave when a DisplayName is already used.
FirstName
Text
The first name of the customer.
MiddleInitial
Text
The customer's middle initial.
LastName
Text
The last name of the customer.
CompanyName
Text
The name of the company the customer works for.
AccountNumber
Text
The customer's account number.
JobNumber
Text
The customer's job number.
Active
Boolean
Indicates if the customer is active or inactive. The default is active.
SalesRep
Text
The email address of the sales rep. A user with this email address must be attached to the account and must be in the sales rep list.
Installer
Text
The email address of the installer. A user with this email address must be attached to the account and must be in the installer list.
AutoAddLists
Boolean
Indicates if list items should be automatically added to accounts if they don't exist. This applies to Terms, LeadSource, AppointmentType, Location, CustomerType, and AlternateInstaller.
Terms
Text
The customer's terms.
LeadSource
Text
The customer's lead source.
AppointmentType
Text
The customer's appointment type.
Location
Text
The customer's location (such as a store number).
DiscountGroup
Text
The customer's discount group. The discount group must already exist to be used here.
CustomerType
Text
The type of customer (such as 'retail').
AlternateInstaller
Text
The name of the customer's alternate installer.
DispatchID
Number
The  Dispatch.me  ID associated with this customer.
DispatchCurrentJobID
Number
The current  Dispatch.me  job ID associated with this interaction.
TaxExempt
Boolean
Whether the customer is tax-exempt. The default is false.
TaxExemptReason
Number
The reason why the customer is tax-exempt. See Tax Exempt Reasons below. This is required if TaxExempt is set to true.
TaxExemptDetails
Text
Additional details regarding the customer's tax-exempt status, if applicable.
BillToAddress1
Text
The first line of the customer's billing address. If any address fields are supplied, this must be one of them.
BillToAddress2
Text
The second line of the customer's billing address.
BillToCity
Text
The city of the customer's billing address. If any address fields are supplied, this must be one of them.
BillToState
Text
The state of the customer's billing address. If any address fields are supplied, this must be one of them.
BillToZip
Text
The postal code of the customer's billing address. If any address fields are supplied, this must be one of them.
BillToCountry
Text
The country of the customer's billing address.
ShippingAddresses
Object Array
One or more shipping addresses. See Address below.
EmailAddresses
Object Array
One or more email addresses. See Email Address below.
Phones
Object Array
One or more phone numbers. See Phone Number below.
Notes
Object Array
One or more notes. See Notes below.
Tags
Object Array
One or more tags. See Tag below.
Links
Object Array
One or more links. See Link below.
Attachments
Object Array
One or more attachments. See Attachments below.
TaxCodes
Object Array
One or more tax codes. See Tax Codes below.

Tax Exempt Reasons

Use an integer from the list below when the customer is tax-exempt.
Number
Description
1
Federal Government
2
State Government
3
Local Government
4
Tribal Government
5
Charitable Organization
6
Religious Organization
7
Educational Organization
8
Hospital
9
Resale
10
Direct Day Permit
11
Multiple Points of Use
12
Direct Mail
13
Agricultural Production
14
Industrial Production or Manufacturing
15
Foreign Diplomat

Address

Property
Required
Type
Description
Label
Text
A word to describe the type of address.
Address1
Text
The first line of the address.
Address2
Text
The second line of the address.
City
Text
The city of the address.
State
Text
The state of the address.
Zip
Text
The postal code of the address.
Country
Text
The country of the address.
Primary
Boolean
Indicates if this address is the primary shipping address. Only one address can be marked as the primary.
Sequence
Number
An integer that indicates the sorting sequence of the address.

Email Address

Property
Required
Type
Description
Label
Text
A word to describe the type of email address.
Address
Text
The email address.
Primary
Boolean
Indicates if this email address is the primary email address. Only one email address can be marked as the primary.
Sequence
Number
An integer that indicates the sorting sequence of the email address.

Phone Number

Property
Required
Type
Description
Label
Text
A word to describe the type of phone number.
Number
Text
The phone number.
Primary
Boolean
Indicates if this phone number is the primary phone number. Only one phone number can be marked as the primary.
Sequence
Number
An integer that indicates the sorting sequence of the phone number.

Notes

Property
Required
Type
Description
Note
Text
The text of the note.
UserName
Text
The name of the user that added the note.

Link

Property
Required
Type
Description
Type
Number
A number that indicates the type of link.
  • 0 = An entity that already exists on the account, such as another customer or a sale.
  • 1 = An external URL.
Name
Text
The name of the link (when the link is a URL link).
URL
Text
The URL of the link (when the link is a URL link).
RelateType
Number
A number that indicates the type of entity the link relates to:
  • 0 = relates to
  • 1 = duplicates
  • 2 = duplicated by
  • 3 = replaces
  • 4 = replaced by
RelateTarget
Number
A number that indicates the type of entity the link relates to:
  • 0 = Customer
  • 1 = Quote/Sale
  • 2 = Purchase Order
  • 3 = Vendor
  • 4 = Site Vendor
  • 5 = Account Vendor
RelateUniqueID
GUID
The unique ID of the linked entity (when the link is an entity link).

Attachments

Property
Required
Type
Description
URL
Text
The URL to the file to be attached.
Thumbnail
Boolean
Indicates if a thumbnail of the file should be created. This is true by default.
Preview
Boolean
Indicates if a preview of the file should be created. This is true by default.

Tag

Property
Required
Type
Description
Tag
Text
The name of the tag.

Tax Codes

Property
Required
Type
Description
Code
Text
The tax code name.
Agency
Text
The tax agency.
Rate
Number
The tax rate as a decimal.
{
"ExternalID": "",
"DisplayName": "Jack Black",
"ForceUnique": false,
"FirstName": "Jack",
"MiddleInitial": "",
"LastName": "Black",
"CompanyName": "",
"AccountNumber": "",
"JobNumber": "12345",
"Active": true,
"SalesRep": "odiemckraken@solatech-darious.com",
"Installer": "",
"AutoAddLists": false,
"Terms": "",
"LeadSource": "Flyer",
"AppointmentType": "",
"Phones": [
{
"Primary": true,
"Sequence": 1,
"Label": "Home",
"Number": "123-456-7890"
},
{
"Primary": false,
"Sequence": 2,
"Label": "Work",
"Number": "800-123-4748"
}
],
"ShippingAddresses": [
{
"Primary": true,
"Sequence": 1,
"Label": "Home",
"Address1": "45 Main Street",
"Address2": "",
"City": "High Point",
"State": "NC",
"Zip": "27262",
"Country": ""
}
],

"Notes":[
{
"Note": "Must call before heading to an appointment."
},
{
"Note": "Gate code is 12345."
}
],
"EmailAddresses": [
{
"Primary": true,
"Sequence": 1,
"Label": "Personal",
"Address": "jblack@gmail.com"
}
],
"Tags": [
{
"Tag": "Big-House"
}
]
}

Remarks

The DisplayName must be unique when creating customers. If an existing customer already exists with the same DisplayName, then the behavior of the endpoint will be determined by the ForceUnique property.
If ForceUnique is true, then the API should attempt to make a unique customer by appending a number to the end of the DisplayName. For example, “Joe Smith” will be renamed to “Joe Smith (1)”. If “Joe Smith (1)” also existed, then the API will try “Joe Smith (2)”. Do this up to 5 times and then give up.
If ForceUnique is false then the API will return with a status code of 400 and a message “The customer was not created because a customer with the display name ‘Joe Smith’ already exists.”
When using the address fields such as the billing or shipping addresses, you must supply data in the Address1, City, State and Zip fields.  

Response

Headers

None

Status Code

Code
Description
200 OK
The customer was created.
400 Bad Request
The customer was not created. The reason why will be returned.
401 Unauthorized
The API key is missing, invalid, disabled, or does not have the correct scope.

Body

All details, except the measure sheets and history, are returned. Refer to the body format of the Read endpoint for an example.