POST Create customer
The Create Customer API will let you create a new customer into your Toursys platform.
[ENDPOINT]/ToursysConnectionApi/api/customer/create
To know what [ENDPOINT] to use, check our documentation regarding endpoints.
Headers
X-API-KEY generatedToken
Parameters:
customer_type - (String, Required) | Customer's categorization. The customer types are registered in a table in the Toursys platform, if a customer type is sent, and is not registered in Toursys it will be created within the system automatically, and you will be able to filter by this information.
customer_code - (String, Required) | Customer's unique reference code
customer_legal_name - (String, Required) | Customer's legal name
customer_commecial_name - (String, Required) | Customer's commercial name
customer_id_type - (String, Required) | Id type code, you can check on the id type codes here. If the id type code you send is not correct, then an error will be shown and the customer will not be created.
customer_id_number - (String, Required) | Id number base on the "customer_id_type" information
customer_internal_comments - (String, Optional) | Comments only the Toursys users will be able to see
customer_lenguage - (String, Required) | Language code that represents the language the customer communicates with you or speaks. You can check on the managed languages on here
customer_currency - (String, Required) | Customer's main currency, (Currency ISO code)
customer_prepayment_days - (Int, Optional) | Payment date will be the start date of the reservation - prepayment days. If prepayment days are 0 and credit days are 0, this is a cash customer.
customer_credit_days - (Int, Optional) | Payment date will be the end date of the reservation + credit days. If credit days are 0 and prepayment days are 0, this is a cash customer.
customer_margin - (Int, Optional) | Margin for this customer, if there is no margin provided Toursys will automatically fetch the margin from the company's minimum margin field
customer_location - (String, Required) | Country, city or place where this customer resides. The locations are registered in a table in the Toursys platform, if a location is sent, and it is not registered in Toursys it will be created within the system automatically, and you will be able to filter by this information.
customer_office_address - (String, Required) | Specific address for the customer's office
customer_business_address - (String, Optional) | Specific address for the customer's business
customer_email - (String, Required) | Customer's communication email
customer_phone - (String, Optional) | Customer's phone number
customer_website - (String, Optional) | Customer's website URL
customer_contacts - (List, Required) | List of customer contacts, you must provide at least 1 contact to be able to create the customer
contact_code - (String, Required) | Code to identify the contact
contact_first_name - (String, Required) | First name of the contact
contact_last_name - (String, Required) | Last name of the contact
contact_gender - (Boolean, Required) | Gender of the contact | (0 = Male, 1 = Female)
contact_email - (String, Required) | Contact email
contact_phone - (String, Required) | Contact phone or cellphone
Example Request
curl --location -g --request POST '[ENDPOINT]/ToursysConnectionApi/api/customer/create' \
--header 'X-API-KEY: generatedToken' \
--header 'Content-Type: application/json' \
--data '{
"customer_type": "Travel Agency",
"customer_code": "Acmetravel",
"customer_legal_name": "Acmetravel SA",
"customer_commecial_name": "Acmetravel",
"customer_id_type": "CED",
"customer_id_number": "000000000",
"customer_internal_comments": "VIP Client",
"customer_lenguage": "es",
"customer_currency": "USD",
"customer_prepayment_days": 0,
"customer_credit_days": 5,
"customer_margin": 0,
"customer_location": "USA",
"customer_office_address": "USA, Florida",
"customer_business_address": "USA, Florida",
"customer_email": "info@acmetravel.com",
"customer_phone": "+1 (213) 984-1313",
"customer_website":"acmetravel.com",
"customer_contacts": [
{
"contact_code": "John Smith",
"contact_first_name": "John",
"contact_last_name": "Smith",
"contact_gender": "0",
"contact_email": "john.smith@acmetravel.com",
"contact_phone": "+1 (213) 984-1313",
"contact_type": "Sales"
}
]
}'
Error codes:
BAD_GATEWAY - 500
001 - A customer with the code provided already exists in Toursys. Each customer code must be unique.
002 - The following fields are required, please check they all have data: customer code, customer legal name, customer commercial name, customer type, customer language, customer location, customer office address, and customer email.
003 - You must provide at least 1 contact for the customer.
004 - Invalid customer ID type code. Please provide a valid one.
005 - There is no customer with that identification code in Toursys.