Skip to main content

Retrieve booking details from GetYourGuide orders

Project description

GygReader

A tool for suppliers on the the GetYourGuide platform to retrieve booking details. Ideal to automize the processing of GetYourGuide bookings.

What it does

Unfortunatly GetYourGuide does not provide webhooks or an API for suppliers to retrieve details from bookings. This can be a problem if GetYourGuide orders need to be processed automatically or registered in your own application/backend.

However an email is sent to the supplier for each booking with the GetYourGuide booking number in the subject. Using services like Zapier or inbound email parsing of Mailgun or SendGrid a webhook can be send to an endpoint retrieving the subject of the GetYourGuide booking email. After parsing the GetYourGuide order number from the subject the GygReader can be used to retrieve the order details and further process the information. For example in Django retrieving the GetYourGuide order number from a SendGrid webhook can look like this:

def endpoint_for_webhook(request):
  subject = request.data["subject"]
  re.search('(GYG)(\d+)',subject).group(0)

How to install and use

To install run:

pip install gyg_reader

Example use:

from gyg_reader import GygReader


gygreader = GygReader("your@email.com", "your_password")
booking = gygreader.get_booking("GYG11111111")

Where GYG11111111 is a GetYourGuide booking number, which can be retrieved like in the example above from the email subject.

booking contains following dictionary:

{'customer_email': 'die@hard.com',
 'customer_name': 'John Mcclane',
 'customer_phone': '+1 202-456-1111',
 'Tour in NYC',
 'amount': '1'}

The full response containing the full booking data can be access following:

gygreader.response.json()

Requirements

  • requests
  • lxml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gyg_reader-0.1.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

gyg_reader-0.1.1-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page