In case of selling cancellation insurance, it’s required to implement a data transfer between software used by Gritchen and software used by our customers or resellers.
Our requirements
In order to simplify subscriptions management, claims management linked to this subscriptions and customer billing, we need to receive informations bellow :
- new subscriptions
- subscriptions modifications
- deleted bookings done by the reseller (that cancel the premium due by the reseller)
- in this case, insured people won’t bee insured anymore
Transmitted subscriptions must be related to confirmed bookings. (booking in state « quotation », « waiting approvol » will be send when they are confirmed)
Submission method
Informations will be sent by webservice. This webservice is simply an XML or JSON flow in the body of an http request.
This webservice will be protected by a user / password common for all the resellers of the software.
Reseller This webservice will be protected by a user / password common for all the resellers of the software.
The specific reseller (who made the booking) will by authenticated in XML / JSON data. (the reseller is the entity billed by Gritchen)
Webservice URL : https://gap.gritchen.fr/partenaire/api/VOTRE_IDENTIFIANT/v1/[souscription|document]
or in developpment :
https://demo.gap.gritchen.fr/partenaire/api/VOTRE_IDENTIFIANT/v1/[souscription|document]
PHP example :
<?php $data='XML OR JSON STRING'; $base_url='https://gap.gritchen.fr/partenaire/api/VOTRE_IDENTIFIANT/v1/souscription'; $username='WEBSERVICE USER'; $password='WEBSERVICE PASSWORD'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $base_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain')); $result=curl_exec($ch); $curl_info=curl_getinfo($ch); /** HTTP ERROR */ if($curl_info['http_code']!=200){ } else{ } ?>
Submission or subscription update data flow
Webservice : /souscription
All fields can be protect by CDATA
Date format : 2014-12-23 (YYYY-MM-DD)
Amount format : 1024.36
XML Version
<?xml version="1.0"?>
Version JSON
{ "gap_souscription": { "souscriptions": [ { "client": { "code": "reseller Gritchen code", "mot_de_passe": "reseller Gritchen password" }, "produit": [ { "code": "product code provided by Gritchen *" } ], "assurance_numero": "Booking number (must be unique) *", "assurance_nb_pax": "Number of persons *", "assurance_souscription_date": "Booking date (YYYY-MM-DD) *", "assurance_debut_date": "Arrival date (YYYY-MM-DD) *", "assurance_fin_date": "Departure date (YYYY-MM-DD) *", "assurance_montant_sejour": "Insured amount (1000.65) *", "assurance_montant": "Insurance amount", "assurance_nom": "Insured name *", "assurance_prenom": "Insured firstname *", "assurance_email": "Insured email *", "assurance_beneficiaires": [ { "nom": "Name *", "prenom": "Firstname *" }, { "nom": "Name2 *", "prenom": "Firstname2 *" } ], "assurance_adresse": "Insured adresse", "assurance_cp": "Insured zip code", "assurance_ville": "Insured city", "assurance_pays": "Insured country", "destination_nom": "Hotel name *", "destination_adresse": "Hotel adresse", "destination_cp": "Hotel zip code *", "destination_ville": "Hotel city *", "destination_pays": "Hotel country *", "communication_langue": "insured language code *" } ] } }
Fields description :
Field |
Description |
Mandatory |
Format |
---|---|---|---|
client > code |
reseller code provided by Gritchen |
yes |
7 caracters |
client > mot de passe |
reseller password provided by Gritchen |
yes |
16caracters |
produit > code |
product code provided by Gritchen |
yes |
|
assurance_nb_pax |
number of persons in the booking |
yes |
Min 1 |
assurance_numero |
your file number. Allows to follow booking updates. (shared key between Gritchen software and reseller software) and made insurance list easy to check. |
yes |
|
assurance_souscription_date |
booking date |
yes |
yyyy-mm-dd |
assurance_debut_date |
arrival date, begining of stay |
yes |
yyyy-mm-dd |
assurance_fin_date |
departure date, end of stay |
yes |
yyyy-mm-dd |
assurance_montant_sejour |
insured amount. same amount used to calculate the insurance amount paid by the customer |
yes |
XXXX.XX |
assurance_montant |
insurance amount paid by the customer |
XXXX.XX | |
assurance_nom |
Insured name |
yes |
|
assurance_prenom |
Insured firstname |
yes |
|
assurance_email |
Insured email. Allow us to send certificate of insurance and a copy of general terms of insurance |
yes |
|
assurance_beneficiaires > beneficiaire |
list of beneficiaries (including main insured name). Number of tags « beneficiaire » must be equal to the « assurance_nb_pax » tag value |
||
destination_nom |
nom de l’établissement où a eu lieu la réservation (ou du propriétaire du bien) hotel name where is the booking (or owner of the rent) |
yes |
|
destination_adresse |
Booking adresse |
||
destination_cp |
Booking zip code |
yes |
|
destination_ville |
Booking city |
yes |
|
destination_pays |
Booking country |
yes |
|
communication_langue |
Language of the insured |
Country code on 2 caracters |
In response to this request, we provide :
XML version
<?xml version="1.0" encoding="utf-8"?> <gap_souscription> <souscriptions> <souscription> <client>reseller code provided by Gritchen</client> <assurance_numero>Your booking number *</assurance_numero> <produit_code>product code</produit_code> <sinistre_declaration_numero>Number to file a claim on safebooking app or www.declare.fr</sinistre_declaration_numero> <etat>OK / DEL / KO</etat> <documents> <cga><![CDATA[encoded base64 pdf of the General terms of insurance]]></cga> <attestation><![CDATA[encoded base64 pdf of the certificate of insurance]]></attestation> </documents> </souscription> </souscriptions> </gap_souscription>
JSON version
{ "gap_souscription": { "souscriptions": [ { "client": "reseller code provided by Gritchen", "assurance_numero": "Your booking number *", "sinistre_declaration_numero":"Number to file a claim on safebooking app or www.declare.fr", "etat": "OK / DEL / KO", "documents": { "cga" : "encoded base64 pdf of the General terms of insurance", "attestation" : "encoded base64 pdf of the certificate of insurance" } } ] } }
Etat tag is :
- OK : subscription insert with success
- DEL :subscription delete (in case of a delete request)
- KO : an error occured
Documents tag contain :
- cga : A pdf file encoded in base64 format with all the General terms of insurance
- attestation : A pdf file encoded in base64 format withthe certificate of insurance
If you don’t need pdf documents, you can add the following tag in your request :
<documents> <attestation>0</attestation> <cga>0</cga> </documents>
or in json
documents: { attestation: 0, cga: 0 }
sinistre_declaration_numero tag let the insured person to file a claim directly on our Safebooking app or https://www.declare.fr website without rewriting his informations. This number is also indicate on the certificate of insurance.
Get documents webservice (certification of insurance and General terms of insurance)
Webservice : /document
Date format : 2014-12-23 (YYYY-MM-DD)
XML version
<?xml version="1.0" encoding="utf-8"?> <gap_souscription> <souscriptions> <souscription> <client> <code>reseller code provided by Gritchen</code> <mot_de_passe>reseller password provided by Gritchen</mot_de_passe> </client> <assurance_numero>Your booking number *</assurance_numero> <documents> <cga>1 / 0</cga> <attestation>1 / 0</attestation> </documents> </souscription> </souscriptions> </gap_souscription>
JSON version
{ "gap_souscription": { "souscriptions": [ { "client": { "code": "reseller code provided by Gritchen", "mot_de_passe": "reseller password provided by Gritchen" }, "assurance_numero": "Your booking number *", "documents": { "attestation":"1 / 0", "cga":"1 / 0" } } ] } }
All requested documents will be returned in the following form :
XML version
<?xml version="1.0" encoding="utf-8"?> <gap_souscription> <souscriptions> <souscription> <client>reseller code provided by Gritchen</client> <assurance_numero>Your booking number</assurance_numero> <documents> <cga><![CDATA[encoded base64 pdf of the General terms of insurance]]></cga> <attestation><![CDATA[encoded base64 pdf of the certificate of insurance]]></attestation> </documents> </souscription> </souscriptions> </gap_souscription>
Version JSON
{ "gap_souscription": { "souscriptions": [ { "client": "reseller code provided by Gritchen", "assurance_numero": "Your booking number", "documents": { "cga": "encoded base64 pdf of the General terms of insurance", "attestation": "encoded base64 pdf of the certificate of insurance" } } ] } }
Deleting an insurance
Webservice : /souscription
Version XML
<?xml version="1.0" encoding="utf-8"?> <gap_souscription> <souscriptions> <souscription delete="1"> <client> <code>reseller code provided by Gritchen</code> <mot_de_passe>reseller password provided by Gritchen</mot_de_passe> </client> <assurance_numero>Your booking number *</assurance_numero> </souscription> </souscriptions> </gap_souscription>
Version JSON
{ "gap_souscription": { "souscriptions": [ { "client": { "code": "reseller code provided by Gritchen", "mot_de_passe": "reseller password provided by Gritchen" }, "assurance_numero": "Your booking number *", "@attributs": { "delete":1 } } ] } }
Watring : all insurances deleted must be done after a manual deleting made by the hotel (handling error, date change…) and not after a cancellation of the insured. Any insurance deleted means that no anybody is insured anymore.
Reseller information in case of a cancellation request
In case of claim with Safebooking app (or with www.declare.fr), we can provide for each reseller an url to inform him with datas of the cancellation.
XML version
<?xml version="1.0" encoding="utf-8"?> <gap_souscription> <souscriptions> <souscription canceled="1"> <client> <code>reseller code provided by Gritchen</code> <mot_de_passe>reseller password provided by Gritchen</mot_de_passe> </client> <assurance_numero>Booking number</assurance_numero> <assurance_debut_date>Arrival date (YYYY-MM-DD) *</assurance_debut_date> <assurance_fin_date>Departure date (YYYY-MM-DD) *</assurance_fin_date> <assurance_nom>Insured name *</assurance_nom> <assurance_prenom>Insurance first name *</assurance_prenom> <sinistre_numero>Gritchen claim number</sinistre_numero> </souscription> </souscriptions> </gap_souscription>
Version JSON
{ "gap_souscription": { "souscriptions": [ { "client": { "code": "reseller code provided by Gritchen", "mot_de_passe": "reseller password provided by Gritchen" }, "assurance_numero": "Booking number", "assurance_debut_date": "Arrival date (YYYY-MM-DD) *", "assurance_fin_date": "Departure date (YYYY-MM-DD) *", "assurance_nom": "Insured name *", "assurance_prenom": "Insurance first name *", "sinistre_numero": "Gritchen claim number*", "@attributs": { "canceled":1 } } ] } }
Datas assurance_numero, assurance_debut_date, assurance_fin_date, assurance_nom, assurance_prenomare filled by the insured person in his claim.
Transmission of General terms of insurance and certificate of insurance
Lors de la réception des informations de souscription par Gritchen, nous enverrons automatiquement à l’assuré un email comprenant :
When we receive a new insurance, we will send automatically an email to the insured with :
- his certificate of insurance (pdf)
- general terms of insurance (pdf)
All informations to file a claim are write on his certificate of insurance.
A link in the email provide to the insured the ability to retrieve documents in other language.
In case of the hotel doesn’t want us to send email to his customer, we can easily disable this feature.
Sandbox data
You can use the following data to try our webservice :
- webservice url : https://demo.gap.gritchen.fr/partenaire/api/sandbox/v1/souscription
- webservice login : sandbox
- webservice password : sandbox123
- reseller code : PN-0641
- reseller password : c33F97bp507f75C4
- product code : ALG_ANNULATION
Trying to file a claim
- https://www.declare.fr/demo
Errors codes
1 : invalid xml
1.1 : sender unknown
1.2 : sender authentifcate error
2 : reseller unknown
3 : unknown product code
4 : reseller can’t sell this product
5 : invalid subscription
5.1 : unknown booking number
5.3 : unable to delete
5.4 : deletion complete
6 : subscription saved
Contact us
Sales Contact :
Benjamin Huet
bhuet@gritchen.fr
Tél. : 01 56 81 03 93
Technical contact :
Pierre BRUNEAU
pbruneau@gritchen.fr
Tél. : 02 48 27 50 85
Copyright
Safebooking® is trade ofGritchen Affinity.
Gritchen Affinity
27 rue Charles Durand
CS70139
18021 Bourges Cedex
http://www.gritchen-affinity.com