Package: checkmate-api
CheckMateA Python wrapper for the CheckMate REST APIInstallationInstall:pip install checkmate-apioreasy_install checkmate-apiUsageimportcheckmateclient=checkmate.CheckMate(api_key='YOUR_KEY_HERE')Note:: You can also pass in a different API url if needed using theapi_basekeyword argument.client=checkmate.CheckMate(api_key='YOUR_KEY_HERE',api_base='API_URL_HERE')Refer to thedocumentationfor the final word on what’s required/optional for each call.Search for a propertyYou can query the API for a property. All of the fields referenced in the query are required.client.properties.search({'name':'Hotel Kabuki','phone':'14159223200','address':{'street':'1625 Post St','city':'San Francisco','region':'CA','postal_code':'94115','country_code':'US'}})List reservationsYou can query the API for all your reservations or the reservations for a specific property.# paginated list of all reservationsclient.reservations.list()# fetching a different page of reservationsclient.reservations.list({'page':2})# reservations with a specific confirmation numberclient.reservations.list({'confirmation_num':'12349asdf'})# reservations for property with id 13434543client.reservations.list({'property_id':13434543})# exclude property data from the responseclient.reservations.list({'exclude_properties':'true'})Show reservationYou can request a specific reservation from the Checkmate API.# reservation with id 123452client.reservations.show(123452)Create reservationYou can create a reservation in Checkmate using either an existing property id, or by creating a new property within the request.# reservation under property 93client.reservations.create({'external_id':'someid123','confirmation_number':'sdlfkjweo324','first_name':'Jane','last_name':'Smith','email':'jane@smith.io','start_on':'2016-12-20','end_on':'2016-12-24','property_id':93})# creating a new propertyclient.reservations.create({'external_id':'someid123','confirmation_number':'sdlfkjweo324','first_name':'Jane','last_name':'Smith','email':'jane@smith.io','start_on':'2016-12-20','end_on':'2016-12-24','property':{'name':'New Hotel','address':{'street':'123 Leaf Lane','city':'Brooklyn','region':'NY','postal_code':'11201','country_code':'US'}}})Update reservationYou can update an existing reservation in Checkmate using a reservation_id.# reservation id 12345client.reservations.update(12345,{'loyalty_number':'abs2332'})Delete reservationYou can delete an existing reservation in Checkmate using a reservation_id.# reservation id 12345client.reservations.destroy(12345)Bulk create reservationsEach reservation follows the same format as a single reservation (an optional webhook can be added at the end).client.reservations.bulk_create([{'external_id':'fdoo','confirmation_number':'','first_name':'Frank','last_name':'Smith','email':'frank@example.com','start_on':'2015-12-20','end_on':'2015-12-24','property_id':123},{'external_id':'hfg34','confirmation_number':'gjhhffgh456','first_name':'John','last_name':'Doe','email':'johndoe@example.com','start_on':'2015-11-20','end_on':'2015-11-24','property_id':123}],'https://example.com/callback')TestingInstallnose testing framework:pip install noseInstall themockmocking and testing library:pip install mockYou can run tests by running the following command:nosetestsLintingInstallflake8:pip install flake8You can run the linter by runningflake8 checkmatein the root directory.