POST Create customer
The Update Customer API will let you update an existing customer into your Toursys platform.
[ENDPOINT]/ToursysConnectionApi/api/customer/update
To know what [ENDPOINT] to use, check our documentation regarding endpoints.
Headers
X-API-KEY generatedToken
Parameters:
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_internal_comments - (String, Optional) | Comments only the Toursys users will be able to see
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_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, Optional) | List of customer contacts
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_code": "Acmetravel",
"customer_legal_name": "Acmetravel SA",
"customer_commecial_name": "Acmetravel",
"customer_internal_comments": "VIP Client",
"customer_prepayment_days": 0,
"customer_credit_days": 5,
"customer_margin": 10,
"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.