NAV
http

Introduction

Welcome to the Magpie API, which provides programmatic access to the Magpie platform.

Authentication

Provide X-Api-Key header:

GET /api HTTP/1.1
Host: magpie.travel
Accept: application/json
X-Api-Key: 58c068808359e091c310054e43c3c27a

or api_key query parameter:

GET /api?api_key=58c068808359e091c310054e43c3c27a HTTP/1.1
Host: magpie.travel
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json

{ "documentation": "https://docs.magpie.travel" }

Magpie API requires the X-Api-Key header containing your API key to be included for all requests:

X-Api-Key: <Your API Key>

Alternatively, the API key can be provided via the api_key query parameter:

https://magpie.travel/api?api_key=<Your API Key>

If an API key was not given or it doesn't belong to an existing account, a 401 Unauthorized response status is returned.

You can find the API key for your Magpie account here.

Products

The Product resource consists of the following fields:

Attribute Type Description
id string The unique identifier of the product
version_id string The unique identifier of this version of the product
name string The name of the product
internal_id string The user-defined internal ID of the product
account object Contains ID and name of the company account that owns the product
start_date date The date when the product starts operating (optional)
end_date date The date when the product stops operating (optional)
summary string Short summary of the product
description string Main description of the product
long_description string Longer description of the product (if necessary)
highlights[] array Key selling features of the product
included[] array Features included in the product
excluded[] array Features NOT incuded in the product
additional_info string Any additional information for the product
health_items[] array List of Covid measures taken by Operator
health_info string Additional Covid information
before_arrival string Important information people need to know before arrival
before_booking string Important information people need to know before booking
booking_cutoff string Cut-off period where bookings are no longer allowed quantity unit and type
validity string Period of time the product is valid for. quantity unit and type
cancellation_policy string Cancellation type for bookings
cancellation_period string Cancellation period quantity and unit
cancellation_info string Additional cancellation information
voucher_info string Information to display on customer voucher
terms_and_conditions string Product terms & conditions
location string Location of the product
starts_notes string Information about starting location
starts_type string Starting point and pick-up
addresses[] array Various addresses
addresses[].type string Possible values are: Starts, Ends, or Redemption
addresses[].latitude decimal Latitude
addresses[].longitude decimal Longitude
addresses[].address1 string Street address 1
addresses[].address2 string Street address 2
addresses[].city string City or Town
addresses[].state string State, Province or Region
addresses[].country string Country code
addresses[].postal_code string Postcode or zipcode
addresses[].directions string Directions to this address
addresses[].notes string Additional notes
duration_type string Type of Duration of the product. Fixed or Flexible
duration_from decimal Value of Fixed Duration or Value of Flexible Duration'From'
duration_unit string Unit of Duration. Days, Hours, or Minutes
duration_to decimal Value of Flexible 'To' Duration
category string The product category
currency string Currency used for the product
language string Language used to describe this product
timezone string Time zone in which the product is operated
redemption_type string Tickets help at office, or Voucher scanned / collected
freesell string Freesell or On-Request
commentaries array Commentary options for the guest
commentaries.format string Commentary Type: Audio, Guide or Written
commentaries.language string Commentary language
guide_type string Tour Guide, Host, Greeter, Instructor or Driver
trip_difficulty string Easy, Moderate or Challenging
emerg_phone_prefix string Emergency Phone Number - prefix
emerg_phone_number string Emergency Phone Number for guests
accessibility string Choose accessibility options
multi-day boolean Multi-day product (includes at least 1 overnight)
accommodation_inc boolean Is accommidation included in the price
private boolean Product is private to only those in a single booking
confirmation_req boolean Customer is required to confirm before travel
max_pax integer Maximum guests per booking
min_pax integer Minimum guests per booking
max_group_size integer Maximum group size on the product
age_restriction_type string Age restrictions for guests
age_restriction_value integer Age in years
height_restriction_type string Height restrictions: Minimum or Maximum
height_restriction_value integer Height restriction value
height_restriction_unit string Height Unit: cm or inches
weight_restriction_type string Weight restrictions: Minimum or Maximum
weight_restriction_value integer Weight restriction value
weight_restriction_unit string Weight Unit: Kg or Lbs
dress_code string Dress code requirements for guests
license_required string Licenses or certifications required by guests
health_restrictions string Health restrictions for guests
other_requirements string Other guest requirements
items_required string Items gursts are required to bring
required_info string Custom information required at the time of booking
food_included string Food included in the product
drinks_included string Drink(s) included in the product
image_url array List of image url
image_ttd_url array List of image TTD url
retail_rates_adult decimal Retail rate of adult
retail_rates_youth decimal Retail rate of youth
retail_rates_child decimal Retail rate of child
retail_rates_infant decimal Retail rate of infant
retail_rates_senior decimal Retail rate of senior
retail_rates_adult_ttd decimal Retail rate of adult TTD
retail_rates_youth_ttd decimal Retail rate of youth TTD
retail_rates_child_ttd decimal Retail rate of child TTD
retail_rates_infant_ttd decimal Retail rate of infant TTD
retail_rates_senior_ttd decimal Retail rate of senior TTD
option_name_ttd string Option name of TTD
option_description_ttd string Option description of TTD

Get All Products

GET /api/products HTTP/1.1
Host: magpie.travel
Accept: application/json
X-Api-Key: 58c068808359e091c310054e43c3c27a
HTTP/1.1 200 OK
Content-Type: application/json

{
  "categories": [ ... ]
    "Air, Balloon & Helicopter Tours",
    "Attractions / Museums",
    ...
  ],
  "locations": [
    "1206 Front St, Sacramento, CA",
    "13755 Fiji Way, Marina del Rey, CA 90292",
    "207 Queens Quay W, Toronto, ON M5J 1A7, Canada",
    ...
  ],
  "limit_value": 100,
  "total_pages": 10,
  "current_page": 1,
  "next_page": 2,
  "prev_page": null,
  "products": [
    {
      "id": "3bba0442-7f76-4af2-8f90-a962a36833e8",
      "name": "Activity Private Xmas Markets & Alsace Villages",
      "internal_id": "55MJ4Q",
      "account": { "ID": "ABC123", "name": "Ophorus Tours in France" },
      "system_providers": [],
      "location": "Strasbourg",
      "category": "Tours & Sightseeing",
      "duration": "7 hours",
      "currency": "EUR",
      "language": "en",
      "timezone": "Europe/Paris",
      "highlights": [
        "Visit the famous markets of Colmar, knowledgeably guided by one of our local team.",
        "Visit Christmas markets in local villages along the Alsace Wine Route. ",
        ...
      ],
      "summary": "<div>Let us guide you through the most beautiful Alsatian villages and discover the wonders on Christmas markets in Alsace. Your suited private driver will drive you the whole day to places you want to explore. The tour is 100% tailor made and you can either visit the villages or experience a wine tasting in a typical winery.</div>",
      "description": "",
      "commentaries": [ "English: Guide", "French: Guide" ],
      "included": [
        "Visit Christmas markets in Colmar.",
        "English-speaking private driver & guide.",
        ...
      ],
      "excluded": [
        "Personal insurance and expenses.",
        "Meals & drinks.",
        ...
      ],
      "before_booking": [
        "Tour requires minimum 2 passengers (adults) to operate.",
        "Tour is operated in English, other languages on request.",
        ...
      ],
      "before_arrival": [
        "Tour involves some walking, comfortable walking shoes are recommended.",
        "Notify tour operator your Strasbourg hotel information as soon as receive confirmation. "
        ...
      ],
      "additional_info": "<div>Christmas market tour for 2 guests or a total of 8 guests, same party, in the private minivan. <br>Tour runs from 9:30am to 4:30pm, every day.<br>November 30th through December 23rd, 2019</div>",
      "restrictions": [ "Dresscode: Wear Warm Layered Clothing And Good Walking Shoes.", ... ],
      "start_date": null,
      "end_date": null,
      "booking_cutoff": [ 7, "days" ],
      "booking_min_pax": 2,
      "booking_max_pax": 8,
      "valid_for": "7 hours Only on date on reservation",
      "opening_hours": { "Sunday": "Closed", "Monday": "Open", "Tuesday": "Open", ... },
      "availability_notes": [ ],
      "addresses": [{ "location_type": "Starts", "directions": null, "notes": "Pick-up from your centrally located Strasbourg hotel.", "coordinates": "", "full_street_address": "Strasbourg, Alsace, FR" }],
      "cancellation_policy": "custom",
      "cancellation_cutoff": "7 days",
      "cancellation_notes": "Operator strictly adheres to its cancellation policy and will make no exceptions to the policy. If Guest chooses to cancel his or her reservation, ...",
      "terms_and_conditions": "Protection of personal data\r\n\r\nNCDK – OPHORUS attaches great importance to respecting the right to privacy. The policy on the protection of individuals ...",
      "voucher_info": "Notify tour operator your Strasbourg hotel information as soon as receive confirmation. ",
      "faqs": [],
      "confirmation_necessary": false,
      "redemption_type": "voucher | Evoucher"
      "covid_info": "Strict safety measures are taken"
    },
    ...
  ]
}

The /api/products endpoint returns a paginated list of all active products on Magpie. The following query parameters are accepted:

Parameter Default Description
page 1 The page to fetch.
limit 100 How many products should be retrieved per page.
location none The location to retrieve products for.
account_id none The username of the company account to retrieve products for.

The HTTP response will also include:

HTTP Request

GET https://magpie.travel/api/products
GET https://magpie.travel/api/products?page=2
GET https://magpie.travel/api/products?limit=50
GET https://magpie.travel/api/products?location=San%20Francisco
GET https://magpie.travel/api/products?account=Ophorus

Update Bulk Products

PUT /api/products/bulk-update HTTP/1.1
Host: magpie.travel
Accept: application/json
X-Api-Key: 58c068808359e091c310054e43c3c27a
body: {
  products: [
    {
      id: PRODUCT_ID,
      name: UPDATED_PRODUCT_NAME,
      ...
    }
  ]
}
HTTP/1.1 200 OK
Content-Type: application/json

{
  "message": "Product updated successfully"
}

The /api/products/bulk-update endpoint update selected products on Magpie.

HTTP Request

PUT https://magpie-web-staging.herokuapp.com/api/products/bulk-update

Create Bulk Products

POST /api/products/bulk-create HTTP/1.1
Host: magpie.travel
Accept: application/json
X-Api-Key: 58c068808359e091c310054e43c3c27a
body: {
  products: [
    {
      name: UPDATED_PRODUCT_NAME,
      ...
    }
  ]
}
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": "09f33209-ece7-4166-9f5e-29a6a68da2a0",
    "account_id": "21054d26-f328-47ff-b8c2-ed1983437734",
    "code": null,
    "cancellation_notes": "Up to 24 hours before the beginning of the activity: full refund\nLess than 24 hours before the beginning of the activity or no-show: no refund",
    "created_at": "2024-08-30T09:11:03.154Z",
    "updated_at": "2024-08-30T09:11:03.248Z",
    "available_tiers": [
      "adult",
      "child"
    ],
    "tier_conditions": {},
    "weight": 900,
    "active": false,
    "currency": null,
    "freesale": false,
    "external_link": null,
    "category": null,
    "operating_type": "opening_hours",
    "url_path": null,
    "duration_type": "fixed",
    "duration_from": null,
    "duration_to": null,
    "duration_unit": null,
    "instant_confirmation": false,
    "booking_cutoff": null,
    "booking_cutoff_unit": null,
    "cancellation_cutoff": 24,
    "cancellation_cutoff_unit": "hours",
    "tier_ages": {
      "infant": {
        "from": 0,
        "to": 4
      },
      "child": {
        "from": 5,
        "to": 11
      },
      "youth": {
        "from": 12,
        "to": 17
      },
      "adult": {
        "from": 18,
        "to": 64
      },
      "senior": {
        "from": 65,
        "to": 120
      }
    },
    "limited_dates": false,
    "start_date": null,
    "end_date": null,
    "api_available": false,
    "api_mapping": null,
    "location": null,
    "min_pax": null,
    "max_pax": null,
    "has_commentary": false,
    "discarded_at": null,
    "pickup": "none",
    "private": false,
    "cancellation_policy": "standard",
    "internal_id": null,
    "percent_complete": "38.8888888888888889",
    "booking_system_id": null,
    "setup_complete": false,
    "language": "en",
    "multiday": null,
    "accommodation_included": null,
    "valid_type": null,
    "valid_for": null,
    "valid_unit": null,
    "booking_cutoff_type": null,
    "age_restrictions": {},
    "has_height_restrictions": null,
    "height_restrictions": {},
    "weight_restrictions": {},
    "health_restrictions": {},
    "dresscode_restrictions": null,
    "license_or_certification_restrictions": {},
    "additional_requirements": {},
    "item_requirements": {},
    "information_requirements": {},
    "confirmation_necessary": null,
    "redemption_type": null,
    "guide_type": null,
    "accessibility": {},
    "food_included": null,
    "beverages_included": null,
    "emergency_phone_prefix": null,
    "emergency_phone_number": null,
    "surcharges": {},
    "has_longer_description": false,
    "short_code": "HDWPQX",
    "tier_types": {},
    "rails_timezone": null,
    "timezone": null,
    "sellect_all": true,
    "external_code": {},
    "published": 1,
    "locationobj_id": null,
    "name": "test 1",
    "tier_labels": {
      "adult": "",
      "child": "",
      "youth": "",
      "infant": "",
      "senior": "",
      "student": ""
    },
    "summary": null,
    "description": null,
    "included": [],
    "excluded": [],
    "before_arrival": [],
    "before_booking": [],
    "additional_info": null,
    "highlights": [
      "asdasdasdasdas"
    ],
    "short_description": "tes1t",
    "voucher_info": null,
    "terms_and_conditions": null,
    "group_info": null,
    "special_service": null,
    "starts_notes": null,
    "max_group_size": null,
    "trip_difficulty": null,
    "videos": [],
    "contextual_keywords": null,
    "tracking_template": null,
    "custom_parameter": null,
    "health": null,
    "blocked_dates": [],
    "template": false,
    "primary_product_id": null,
    "version_type": "Primary",
    "version_name": "Primary Product",
    "version_description": null,
    "version_date_from": null,
    "version_date_to": null,
    "select_all_resellers_for_version": false,
    "health_items": [],
    "note_job_export_field": null,
    "note_job_copy_field": null,
    "linked_fields": [],
    "sharing_private": false,
    "sharing_directory": true,
    "sharing_api": true,
    "score": null,
    "listings_count": 0,
    "ignore": false,
    "ratings_average": null,
    "ratings_count": null,
    "product_name_ttd": null,
    "inventory_type": false,
    "crawl_info": {},
    "product_quality": 11,
    "ttd_brand": null,
    "partner_booking_url": null,
    "keywords": [],
    "reviews_product_page": false,
    "content_gpt": false,
    "review_widget_code": null,
    "suggestions_gpt": null,
    "conflicts_gpt": null,
    "gpt_status": null,
    "landing_page_url": null,
    "activate": false,
    "place_id_manually": null,
    "google_profile_name_manually": null,
    "option_name_ttd": {},
    "owner_of_poi": false,
    "owner_of_gbp": false,
    "product_system_providers_id": null,
    "connected_review_widget": false,
    "google_backend_connected_review_widget_id": null,
    "gpt_status_reseller": null,
    "collector": null
  }
]

The /api/products/bulk-update endpoint update selected products on Magpie.

HTTP Request

POST https://magpie-web-staging.herokuapp.com/api/products/bulk-create

Glossary

Name Description
Reseller You are the reseller, connecting via the API
Operator The operator on Magpie which you are connecting to
Product The attraction, activity or tour
Option A variant of the product, all products must have at least one option
Unit The ticket type, e.g. Adult, Child, Senior etc.
Unit Item A line item per unit within the booking