Table of contents
Searching for Customers
The following table provides the URI and method that can be used to search for customer in Crittah.
Search Fields
Field | Value type | Mandatory | Description | Example |
---|
CompanyName | string | | Company name of customer. Partial matches will return results. | Megga Corp |
CompanyNo | string |
| Company number of customer. Partial matches will return results. | ABN65482555 |
Phone | string |
| Phone number of the contact. Partial matches will return results. | 987649874 |
Mobile | string | | Mobile phone number of the contact. Partial matches will return results. | 041658246 |
Fax | string |
| Fax number of the contact. Partial matches will return results. | 6546548665 |
City | string | | City of the contact. Partial matches will return results. | Sydney |
CustomerRef | string |
| The unique reference of the customer allocated by Crittah customer is created | 6548335 |
PostalCode | string |
| 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
Data fields
Field | Value type | Mandatory | Description | Example |
---|
IDCustomer | string |
|
| Unique identifier of the customer. The CustomerID is used for updating or deleting an existing customer. | 7090fad1-c4da-4488-9ceb-55ee9847edcc |
CustomerRef | string |
|
| Human readable unique identifier of the customer | 2586681 |
ExternalRef | string |
|
| 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 |
IDSite | string |
|
| Unique ID for the site the customer belongs to | 20058233-7388-418b-9193-6b57e28604f9 |
Site | string |
|
| Site Name that customer belongs to | SYD |
Types | Types 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" } ] |
IDTypes | Array strings |
|
| Used when adding or updating the record | "IDTypes": [ "c0fd94f3-2ddd-4eea-bc24-40189480d10f", "eb6bef8f-6f03-49dd-80a4-83a220f6ddc3"] |
IDStatus | string |
|
| IDStatus of customer | 926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa |
Status | string |
|
| Indicates the status of the customer. | Pending |
IDParent | string |
|
| ID of the parent customer. This is used when linking many customer to a single head office customer. | 926a4185-6cb3-4a2a-a8ec-1fadc1cf4caa |
CompanyName | string |
|
| Name of the customer. | Megga Corp Pty Ltd |
CompanyNo | string |
|
| Legal registered company number | 28787 876 8876 |
Phone | string |
|
| Customers phone | (02) 9506 3560 |
Mobile | string |
|
| Customers Mobile | 0412 544 654 |
Fax | string |
|
| Customers Fax | (02) 9567 680 |
Council | string |
|
| Local council customer resides in. | Parramatta |
WebSite | string |
|
| Account owner that the customer belongs to. This is a user in Crittah. User list information can be retrieved users from the Helper REST API | 926a4185-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
|