Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of contents

Table of Contents

Searching for Customers

The following table provides the URI and method that can be used to search for customer in Crittah.

MethodResult
URIhttps://[CompanyID].crittah.com/ws/apiv2/[json or xml]/customers/search
POST

Post a JSON or XML object with search criteria.

Search Fields

FieldValue typeMandatoryDescriptionExample
CompanyNamestring


Company name of customer. Partial matches will return results.Megga Corp
CompanyNostring
Company number of customer. Partial matches will return results.ABN65482555
Phonestring
Phone number of the contact. Partial matches will return results.987649874
Mobilestring


Mobile phone number of the contact. Partial matches will return results.041658246
Faxstring
Fax number of the contact. Partial matches will return results.6546548665
Citystring


City of the contact. Partial matches will return results.Sydney
CustomerRefstring
The unique reference of the customer allocated by Crittah customer is created6548335
PostalCodestring
Post code of the customer. Partial matches will return results.

Example Search

Perform a POST to the following URL https://[companyID].crittah.com/ws/apiv2/json/customers/search

JSON

Code Block
{
	"CompanyName": "Super Corp"
}

XML

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<CustomeSearchParamsComplex xmlns="http://schemas.datacontract.org/2004/07/Spinifex.lib.objects" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<CompanyName>Super Corp</CompanyName>
</CustomeSearchParamsComplex>


Working with a single customer

MethodResult
URIhttps://[CompanyID].crittah.com/ws/apiv2/[json or xml]/customers/[customerId]
DELETEDeletes one customer
GETReturns data for one customer
POSTCreate or modify only the supplied data for one customer; returns customer data after request
PUTNot supported

Data fields

FieldValue typeMandatoryDescriptionExample
IDCustomerstring
 

Unique identifier of the customer. The CustomerID is used for updating or deleting an existing customer.7090fad1-c4da-4488-9ceb-55ee9847edcc
CustomerRefstring
 

Human readable unique identifier of the customer2586681
ExternalRefstring
 

A reference to an id used in an external system to Crittah. This can be used to link Crittah to internal systems and maintaining the relationship between the two systems.HSG29373
IDSitestring
 

Unique ID for the site the customer belongs to20058233-7388-418b-9193-6b57e28604f9
Sitestring
 

Site Name that customer belongs toSYD
TypesTypes Object
 

Array of types returned when getting a record

[ { "IDType": "c0fd94f3-2ddd-4eea-bc24-40189480d10f",

"Type": "Producer" },
{ "IDType": "eb6bef8f-6f03-49dd-80a4-83a220f6ddc3",
"Type": "VIP" } ]

IDTypesArray strings
 

Used when adding or updating the record"IDTypes": [ "c0fd94f3-2ddd-4eea-bc24-40189480d10f", "eb6bef8f-6f03-49dd-80a4-83a220f6ddc3"]
IDStatusstring
 

IDStatus of customer926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa
Statusstring
 

Indicates the status of the customer.Pending
IDParentstring
 

ID of the parent customer. This is used when linking many customer to a single head office customer.926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa
CompanyNamestring
 

Name of the customer.Megga Corp Pty Ltd
CompanyNostring
 

Legal registered company number28787 876 8876
Phonestring
 

Customers phone(02) 9506 3560
Mobilestring
 

Customers Mobile0412 544 654
Faxstring
 

Customers Fax(02) 9567 680
Councilstring
 

Local council customer resides in.Parramatta
WebSitestring
 

customers positionManager
AddressBillingAddress Object
 

Customers Billing AddressSee Address Object
AddressAddress Object
 

Customers Physical AddressSee Address Object
NotesArray of Notes Object
 

Customers notes.See Notes Object
AccountOwnerstring
 

Account owner that the customer belongs to. This is a user in Crittah. User list information can be retrieved users from the Helper REST API926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa

Examples

Get a customers details

...

Code Block
curl -X POST -d update_customer.data  \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://YourCompanyID.crittah.com/ws/apiv2/json/customers/[idcontact to update]

...


Delete a customer

Code Block
curl  -X DELETE \
-H "Content-Type: application/json"  \
-H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \
-H "Api-Username: jsmith" \
-H "API-Password: abc123" \
http://YourCompanyID.crittah.com/ws/apiv2/json/customers/fde3e1d7-5a7c-493d-b49f-dd514fa3b3af