Abstract diagram of a travel API feeding packages into Drupal

Project

Travel company (Canada)

Daily Travel Package Imports on Drupal

4 min readDigidrop

A Canadian travel operator needed packages from an external API created and updated in Drupal every night. We cannot name them. The import still runs on a schedule, or from the CMS when they need it sooner.

Package data that used to be entered by hand now imports from the travel API on a nightly schedule, or on demand from the Drupal UI.

This engagement is under NDA. We cannot name the operator or show the site. They are a Canadian travel company selling packages whose details change often enough that typing them into Drupal by hand could not keep up.

Background

They needed a daily import of the latest travel packages from an external system: fetch the feed, then create or update the matching packages on a new Drupal site. The API held a large, awkward data model. The Drupal architecture on top of it added more mapping work rather than less.

What we did

We built an importer that pulls package data from the provider, maps it onto Drupal entities, and creates or updates records without duplicating trips that already exist. Because the data architecture was complex, this was a long process with many moving parts: nested package fields, associations with trips, and enough edge cases that a naive nightly dump would have overwritten editorial changes or created duplicates.

The job can run from the Drupal UI when someone needs a refresh during the day, and it is automated at midnight so the catalogue is current each morning.

Results

Staff no longer re-key packages when the feed changes. Packages come in already associated with trips, so the team can concentrate on selling as the external API updates. The site stays a Drupal site: editors still work in the CMS, the import just stops the catalogue going stale.

The travel work we can name, including screenshots, is the Travelopia and TCS World Travel article.

Working on something similar?

If any of this is relevant to a project you are planning, tell us about it and we will give you a straight answer on how we would approach it.

More work

All work