Skip to main content

Creating a booking for a resource

How to book a resource from your website or a third-party app: parameters, rules to know, response and errors (direct booking APIs, being phased out).

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 name

  • customer_address: the customer's address

  • customer_postal_code: the customer's postal code

  • customer_city: the customer's city

  • customer_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-mail

  • customer_mobile: the customer's mobile phone

  • customer_fiscal_code: the customer's fiscal code

  • customer_tax_code: the customer's VAT number (if applicable)

  • customer_unique_code: unique code for electronic invoicing

  • customer_pec: certified e-mail (PEC) for electronic invoicing

  • customer_tags: tags to give the new customer, separated by commas

  • vector_name: the boat's name

  • vector_length: the boat's length in metres

  • vector_width: the boat's width in metres

  • contract_type_id: ID of the contract type to create

  • pricelist_contract_type_id: ID of the price list to use

  • contract_duration_id: ID of the contract duration

  • contract_date_start: arrival date

  • contract_date_end: departure date

  • contract_tags: tags to give the contract, separated by commas

  • contract_use_gross_amount: 1 to use gross amounts

  • resource_id: ID of the berth to occupy: it is the id that Checking a resource's availability returned to you

  • policy: policy for calculating the price (resources or vectors)

  • 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 refused

  • invoice_type_id: ID of the type of invoice/tax document to generate

  • email1_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-mail

  • email2_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-mail

  • email2_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_fullname and customer_email are 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_country in lowercase (it). With any other value the unique code becomes XXXXXXX and the province is limited to 2 letters.

  • If you do not send customer_unique_code it is 0000000.

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.


Did this answer your question?