This call is part of the Direct booking APIs, which are being phased out: if you are writing a new integration, do not start here. To authenticate use the technical user and the key described on the same page.
The addresses are the production ones. To try it in the test environment, use demo.blueshell.it instead of my.blueshell.it.
To create a booking make a POST request to the following URL:
https://my.blueshell.it/booking/create.php
Parameters you can use in the POST request:
customer_fullname: the customer's full namecustomer_address: the customer's addresscustomer_postal_code: the customer's postal codecustomer_city: the customer's citycustomer_province: the customer's province (2 letters)customer_country: the customer's country code (ISO 3166‑1, 2 characters)customer_email: the customer's e-mailcustomer_mobile: the customer's mobile phonecustomer_fiscal_code: the customer's fiscal codecustomer_tax_code: the customer's VAT number (if applicable)customer_unique_code: unique code for electronic invoicingcustomer_pec: certified e-mail (PEC) for electronic invoicingcustomer_tags: tags to give the new customer, separated by commasvector_name: the boat's namevector_length: the boat's length in metresvector_width: the boat's width in metrescontract_type_id: ID of the contract type to createpricelist_contract_type_id: ID of the price list to usecontract_duration_id: ID of the contract durationcontract_date_start: arrival datecontract_date_end: departure datecontract_tags: tags to give the contract, separated by commascontract_use_gross_amount: 1 to use gross amountsresource_id: ID of the berth to occupy: it is theidthat Checking a resource's availability returned to youpolicy: policy for calculating the price (resourcesorvectors)allow_overbooking: 1 to accept the booking even if the berth is already occupied; if you do not write it, an occupied berth makes the booking be refusedinvoice_type_id: ID of the type of invoice/tax document to generateemail1_template_id: ID of the e-mail template to send with the invoice's payment request (it must be a template with scope Email for invoice)email1_invoice_template_id: ID of the print template to attach to the e-mailemail2_template_id: ID of the e-mail template to send once the invoice has been paid (it must be a template with scope Email for invoice)email2_invoice_template_id: ID of the print template to attach to the confirmation e-mailemail2_contract_template_id: ID of the contract print template to attach to the confirmation e-mail
The e-mail with the payment request is sent only if you sent invoice_type_id, email1_template_id and email1_invoice_template_id. The three email2_… are for the confirmation that is sent when the customer has paid.
Rules to know
resource_id,customer_fullnameandcustomer_emailare always needed: without the customer's name and e-mail the call creates nothing and gives no error.If a customer with the same e-mail already exists, it is used as it is: the other customer data you send are ignored.
The boat is created only if you send
vector_name; if the customer already has a boat with that name, that one is used.Write
customer_countryin lowercase (it). With any other value the unique code becomesXXXXXXXand the province is limited to 2 letters.If you do not send
customer_unique_codeit is0000000.
The response
The response has contract (the contract created), invoice and invoice_payment_link (only if you sent invoice_type_id: the link takes the customer to pay) and message. If the berth is already occupied and you did not ask for allow_overbooking, the contract is not created and message says “Overbooking not allowed”. If the marina's price list does not cover the whole period, the response is a 422 error with "error": "IncompletePriceListCoverage": nothing was written.
See also: Checking a resource's availability and Direct booking APIs.
