POST Customers by context, contextId

Overview

Create customer on a context

Request

POST /[context]/[contextId]/Customers

Request Information

Request Parameters

Name
Type
Requirement
Description
context
String
Mandatory
Context of the request e.g Booking, Accommodation, Trips, Sightseeing etc.
contextId
Integer
Mandatory
ID of the context
title
String
Mandatory
Title of customer (Cannot override existing value)
firstName
String
Mandatory
First name of customer (Cannot override existing value)
middleName
String
Optional
Middle name of customer (Editable before a trip is confirmed, fullyPaid or onRequest)
surname
String
Mandatory
Surname of customer (Cannot override existing value)
dateOfBirth
String
Optional
Date of birth of customer (Editable before a trip is confirmed, fullyPaid or onRequest. Cannot add or update DOB of passengers who do not meet minimum/maximum age requirements for trip/trips)
homePhone
String
Optional
Home phone number of customer
mobilePhone
String
Optional
Mobile phone number of customer
emailAddress
String
Optional
Email address of customer
homeAddress
Address
Optional
Home Address of customer
passport
Passport
Optional
Passport details of customer (Editable before a trip is confirmed, fullyPaid or onRequest)
travelInsurancePolicyNumber
String
Optional
Travel Insurance Policy Number of customer
travelInsuranceCompany
String
Optional
Travel Insurance Company of customer
travelInsuranceCompanyPhone
String
Optional
Travel Insurance Company Phone Number
status
String
Optional
Status of customer 

In the context of a component (i.e Trip, Accommodation, Transfer, AdditionalService, Sightseeing), this can be:
 	•	 confirmed
		 Customer is booked on component

 	•	 tentative
		 Customer is tentatively booked on component

 	•	 onRequest
		 Customer has requested to be booked on component, but it needs to be confirmed with the supplier 

 	•	 cancelled
		 Customer has been cancelled on component
emergencyContact
Contact
Optional
Emergency contact of customer
dietaryNote
String
Optional
Dietary Note of customer
medicalNote
String
Optional
Medical Note of customer
singleSupplement
String
Optional
This is only valid in the context of a Trip 
 	•	 true
		 Book single room for customer 
 	•	 false
		 Book twin share room for customer (default)

Homeaddress

Name
Type
Requirement
Description
addressLine1
String
Optional
Address Line 1 of customer
addressLine2
String
Optional
Address Line 2 of customer
city
String
Optional
City of customer
state
String
Optional
State of customer
postcode
String
Optional
Postcode of customer
countryName
String
Optional
Country of customer (Only used in GET request)
countryCode
String
Optional
Country Code of customer (Used to set country for the address in POST and PATCH requests)

Passport

Name
Type
Requirement
Description
number
String
Mandatory
Passport number 
Any value (must have at least 1 non-whitespace character)
nationality
String
Mandatory
Passport nationality 
ISO 3166-1 Alpha-2 code (e.g. US)
placeOfIssue
String
Optional
Passport place of issue 
Any value (must have at least 1 non-whitespace character)
dateOfIssue
String
Mandatory
Passport date of issue
dateOfExpiry
String
Mandatory
Passport date of expiry

Emergencycontact

Name
Type
Requirement
Description
firstName
String
Optional
First name of contact
surname
String
Optional
Surname of contact
homePhone
String
Optional
Home phone number of contact
mobilePhone
String
Optional
Mobile phone number of contact
relationship
String
Optional
Relationship of contact

Request Example

{
  "title": "Mr",
  "firstName": "Homer",
  "middleName": "Pete",
  "surname": "Simpson",
  "dateOfBirth": "1970-01-01",
  "homePhone": "0115487956",
  "mobilePhone": "0435485548",
  "emailAddress": "homer@simpson.com",
  "homeAddress": {
    "addressLine1": "74 Brokesley Street",
    "addressLine2": "Bournemouth",
    "city": "Kingswood",
    "state": "Vic",
    "postcode": "3167",
    "countryName": "Australia",
    "countryCode": "AU"
  },
  "passport": {
    "number": "N89171298",
    "nationality": "US",
    "placeOfIssue": "US",
    "dateOfIssue": "2010-01-01",
    "dateOfExpiry": "2020-01-01"
  },
  "travelInsurancePolicyNumber": "4552",
  "travelInsuranceCompany": "Slexicover Direct",
  "travelInsuranceCompanyPhone": "0435698542",
  "status": "confirmed",
  "emergencyContact": {
    "firstName": "Jess",
    "surname": "Peter",
    "homePhone": "0115487956",
    "mobilePhone": "0435485548",
    "relationship": "Mother"
  },
  "dietaryNote": "Allergic to seafood",
  "medicalNote": "Knee replacement",
  "singleSupplement": "true"
}

Response Information

Response Properties

Name
Type
Description
id
Integer
ID of the resource
href
String
URI of the resource

Response Codes

HTTP status code
Description
200 OK
The resource was updated successfully
201 Created
The resource was created
400 Bad Request
The resource was malformed
401 Unauthorized
Missing or invalid API key
500 Internal Server Error
An unexpected error occurred on the API server
202 Accepted
The request was accepted
404 Not Found
The specified resource was not found
403 Forbidden
One or more parameters has already been set on the resource record and cannot be updated

Response Example

{
  "id": 887124,
  "href": "context/contextid/customers/887124"
}