Customers

Add a customer

The following features allow us to manage some customer data The first function add a customer

add_customer(token, lcode, data)

data being a directory with the following fields:

Key Description
company Optional
first_name Required
last_name Required
email Optional (as for normal reservations)
phone Optional (as for normal reservations)
zip Optional (as for normal reservations)
birthday Optional (as for normal reservations)
birthmonth Optional (as for normal reservations)
birthyear Optional (as for normal reservations)
city Optional (as for normal reservations)
street Optional (as for normal reservations)
birthcity Optional (as for normal reservations)
birthcountry Optional (as for normal reservations)
citizenship Optional (as for normal reservations)
paper Optional
papern Optional
papercity Optional
papercountry Optional
staystreet Optional
staycity Optional
staycountry Optional
role Optional
gen_doc_type Optional (as for normal reservations)
gen_doc_number Optional (as for normal reservations)
gen_doc_day Optional (as for normal reservations)
gen_doc_month Optional (as for normal reservations)
gen_doc_year Optional (as for normal reservations)
istat_free Optional
istat_city Optional
istat_country Optional
vj_doc Optional (as for normal reservations)
vj_doc_type Optional (as for normal reservations)
vj_doc_date_day Optional (as for normal reservations)
vj_doc_date_month Optional (as for normal reservations)
vj_doc_date_year Optional (as for normal reservations)
salutation Optional (as for normal reservations)
freecitytax Optional

The field mandatory, first name and last name, while others are just optional

Get customers

With the following function we obtain a list of customers with data from a dictionary

fetch_customer(token, lcode, data)

The data dictionary has to have a combination of the following parameters or all of them:

  • ccode: customer id
  • first_name and last_name
  • vj_doc and vj_doc_type (Being the DNI or passport and the document type)

The document type is classified as:

meaning value
DNI ‘D’
PASSPORT ‘P’
DRIVING_LICENCE ‘C’
IDENTITY_CARD ‘I’
SPANISH_RESIDENCE_PERMIT ‘N’
UE_RESIDENCE_PERMIT ‘X’

Example of data:

  • {‘first_name’: ‘Luca’, ‘last_name’: ‘Jordan’}
  • {‘ccode’: ‘561d3c216c0197280cc6bc76’}
  • {‘vj_doc_type’: ‘P’, ‘vj_doc’: ‘O-123456X’}

Update a customer

If we want to update the customer data we’ll just use the following function

update_customer(token, lcode, ccode, data)

data is a dictionary with the data we want to change. These data are the same that in the function add_customer. ccode is the customer identification code