Customer API Specification¶
Overview¶
The Customer API provides endpoints for customer management including search, creation, and trip request handling.
Base Path: /customer
Content Types:
- Request: application/json
- Response: application/json
Response Format¶
All endpoints return a TlinqApiResponse object:
Date Format: All dates are returned in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss)
Endpoints¶
POST /customer/companyLookup¶
Searches for company customers by name.
Request Body: | Field | Type | Required | Description | |-------|------|----------|-------------| | session | string | No | User session token (uses system session if not provided) | | namepart | string | Yes | Partial company name to search for |
Request Example:
Response Structure:
{
"apiStatus": { "errorCode": "OK", "errorMessage": "Success" },
"apiData": [
["Travel World LLC", 123],
["Travel Plus Tourism", 456],
["Global Travel Services", 789]
]
}
Notes: - Searches only active companies - Excludes child companies (those with parentId)
POST /customer/search¶
Searches for customers based on various criteria.
Request Body: | Field | Type | Required | Description | |-------|------|----------|-------------| | session | string | No | User session token | | method | string | No | "partial" for partial matching | | custName | string | No | Customer name filter | | email | string | No | Email filter | | mobilePhone | string | No | Mobile phone filter | | isCompany | boolean | No | Filter by company type | | active | boolean | No | Filter by active status |
Request Example:
Response Structure:
{
"apiStatus": { "errorCode": "OK", "errorMessage": "Success" },
"apiData": [
{
"customerId": 1001,
"custCode": "CUST-001",
"custName": "John Smith",
"fullName": "John Michael Smith",
"email": "john.smith@example.com",
"mobilePhone": "+971501234567",
"phone": "+97142345678",
"isCompany": false,
"isCustomer": true,
"isPartner": false,
"active": true,
"parentId": null,
"parentName": null,
"street": "123 Main Street",
"city": "Dubai",
"countryId": 784,
"countryName": "United Arab Emirates"
},
{
"customerId": 1002,
"custCode": "CUST-002",
"custName": "John Doe",
"email": "john.doe@example.com",
"mobilePhone": "+971509876543",
"isCompany": false,
"isCustomer": true,
"active": true
}
]
}
POST /customer/read¶
Reads a customer by ID.
Request Body: | Field | Type | Required | Description | |-------|------|----------|-------------| | session | string | No | User session token | | customerId | string | Yes | Customer ID to read |
Request Example:
Response Structure:
{
"apiStatus": { "errorCode": "OK", "errorMessage": "Success" },
"apiData": {
"customerId": 1001,
"custCode": "CUST-001",
"custName": "John Smith",
"fullName": "John Michael Smith",
"orgType": "individual",
"email": "john.smith@example.com",
"mobilePhone": "+971501234567",
"phone": "+97142345678",
"doNotEmail": false,
"taxNumber": null,
"website": null,
"street": "123 Main Street",
"street2": "Apartment 456",
"zip": "12345",
"city": "Dubai",
"countryId": 784,
"countryName": "United Arab Emirates",
"isCompany": false,
"isCustomer": true,
"isPartner": false,
"supplierRank": null,
"active": true,
"parentId": null,
"parentName": null,
"contacts": null,
"contactList": null,
"contactMedium": "email"
}
}
Response when not found:
POST /customer/create¶
Creates a new customer.
Request Body: | Field | Type | Required | Description | |-------|------|----------|-------------| | session | string | No | User session token | | custName | string | Yes | Customer name | | email | string | Yes | Customer email address | | mobilePhone | string | Yes | Customer mobile phone number | | phone | string | No | Landline phone | | street | string | No | Street address | | city | string | No | City | | countryId | integer | No | Country ID | | isCompany | boolean | No | Whether customer is a company |
Request Example:
{
"session": "user-session-token",
"custName": "Jane Doe",
"email": "jane.doe@example.com",
"mobilePhone": "+971501112222",
"street": "456 Business Bay",
"city": "Dubai",
"countryId": 784
}
Response Structure:
{
"apiStatus": { "errorCode": "OK", "errorMessage": "Success" },
"apiData": {
"customerId": 1003,
"custCode": "CUST-003",
"custName": "Jane Doe",
"email": "jane.doe@example.com",
"mobilePhone": "+971501112222",
"street": "456 Business Bay",
"city": "Dubai",
"countryId": 784,
"countryName": "United Arab Emirates",
"isCompany": false,
"isCustomer": true,
"active": true
}
}
POST /customer/createTripRequest¶
Creates a new trip request for inquiry/lead generation.
Request Body: | Field | Type | Required | Description | |-------|------|----------|-------------| | session | string | No | User session token | | tripRequest | object | Yes | Trip request details |
Trip Request Object: | Field | Type | Description | |-------|------|-------------| | destination | string | Desired destination | | travelDates | string | Preferred travel dates | | numTravelers | integer | Number of travelers | | budget | number | Budget amount | | requirements | string | Special requirements | | contactName | string | Contact person name | | contactEmail | string | Contact email | | contactPhone | string | Contact phone |
Request Example:
{
"session": "user-session-token",
"tripRequest": {
"destination": "Maldives",
"travelDates": "2025-08-15 to 2025-08-22",
"numTravelers": 4,
"budget": 15000.00,
"requirements": "Honeymoon package with water villa, spa treatments, and romantic dinner",
"contactName": "John Smith",
"contactEmail": "john.smith@example.com",
"contactPhone": "+971501234567"
}
}
Response Structure:
{
"apiStatus": { "errorCode": "OK", "errorMessage": "Success" },
"apiData": {
"requestId": 5001,
"destination": "Maldives",
"travelDates": "2025-08-15 to 2025-08-22",
"numTravelers": 4,
"budget": 15000.00,
"requirements": "Honeymoon package with water villa, spa treatments, and romantic dinner",
"contactName": "John Smith",
"contactEmail": "john.smith@example.com",
"contactPhone": "+971501234567",
"status": "NEW",
"createdDate": "2025-06-15T10:30:00"
}
}
Notes: - If the user is not an employee, a notification is automatically sent - Uses system session for persistence if no user session provided
Data Models¶
CCustomer¶
| Field | Type | Description |
|---|---|---|
| customerId | integer | Unique customer identifier |
| custCode | string | Customer code |
| custName | string | Customer name |
| fullName | string | Full name |
| orgType | string | Organization type |
| string | Email address | |
| mobilePhone | string | Mobile phone number |
| phone | string | Landline phone number |
| doNotEmail | boolean | Email opt-out flag |
| taxNumber | string | Tax/VAT number |
| website | string | Website URL |
| street | string | Street address line 1 |
| street2 | string | Street address line 2 |
| zip | string | Postal/ZIP code |
| city | string | City |
| countryId | integer | Country ID |
| countryName | string | Country name |
| isCompany | boolean | Whether customer is a company |
| isCustomer | boolean | Whether this is a customer record |
| isPartner | boolean | Whether this is a partner |
| supplierRank | integer | Supplier ranking |
| active | boolean | Whether customer is active |
| parentId | integer | Parent company ID (for child accounts) |
| parentName | string | Parent company name |
| contacts | array | Contact IDs array |
| contactList | array | List of contact CCustomer objects |
| contactMedium | string | Preferred contact medium |
CTripRequest¶
| Field | Type | Description |
|---|---|---|
| requestId | integer | Unique request identifier |
| destination | string | Travel destination |
| travelDates | string | Preferred dates |
| numTravelers | integer | Number of travelers |
| budget | number | Budget amount |
| requirements | string | Special requirements |
| contactName | string | Contact person name |
| contactEmail | string | Contact email |
| contactPhone | string | Contact phone |
| status | string | Request status (NEW, IN_PROGRESS, QUOTED, CLOSED) |
| createdDate | datetime | Creation timestamp |