Product widget

Product widget

Product widget

Product widget

Product Widget API Functional Specification

Product Widget API Functional Specification

Product Widget API Functional Specification

10

10

min read

min read

10

min read

Product Search API Functional Specification

Overview

This document describes the API for Product Search that are available to integrate with content

modules on the partner site.

Product API

{
 "openapi": "3.0.1",
 "info": {
  "title": "ProductSearch",
  "version": "2021-02-17T04:44:51Z"
 },
 "servers": [
  {
   "url": "https://api.travlr.com/{basePath}",
   "variables": {
    "basePath": {
     "default": "travlrblack-prod"
    }
   }
  }
 ],
 "paths": {
  "/products": {
   "get": {
    "description": "This API returns an array of TRAVLR products based on filter and sort
properties supplied. Products are of three different types - Deals, Activities, or Accommodation.
All products, regardless of type, return the same response fields. All parameters are optional. If
no parameters are supplied it will return deals only.",
    "parameters": [
    {
     "name": "category",
     "in": "query",
     "description": "This will filter the products by category. For example - Food & Beverage.
This corresponds to the category field in the output. One or more categories filters may be
supplied. If there is more than 1 category then any products that match any of the categories
are returned. If the category is blank then all products are returned.",
     "schema": {
      "type": "string"
     }
    },
    {
     "name": "count",
     "in": "query",
     "description": "The count defines how many products should be returned. The default
value is 5. If the Id paramater is used then the count will always be 1.",
     "schema": {
      "type": "string"
     }
    },
    {
     "name": "sort",
     "in": "query",
     "description": "The sort parameter has the vlaues MostPopular and Recommended. The
default is MostPopular. Recommended sort order is only supported for deals.",
     "schema": {
      "type": "string"
     }
    },
    {
     "name": "destination",
     "in": "query",
     "description": "This will filter the products by destination. For example - New Zealand.
This corresponds to the destination field in the output. One or more destination filters may be
supplied. If there is more than 1 destination then any products that match any of the
destinations are returned. If the destination is blank then all products are returned. If a type of
activity is used then the destination is mandatory.",
     "schema": {
      "type": "string"
     }
    },
    {
     "name": "type",
     "in": "query",
     "description": "The type filter has values of Deal, Activity, or Accommodation. If no type is
specified then deals are returned. If a destination is also specified and there are not enough
deals for the count required then activities are also returned by default. Type of accommodation
is only supported if Id is also supplied. Type of activity is only supported if destination or Id is
supplied.",
     "schema": {
      "type": "string"
     }
    },
    {
     "name": "currency",
     "in": "query",
     "description": "The currency is the three letter ISO code for the currency. All products will
return prices and RRP in the requested currency. If the currency is blank then it will use the
default currency for the brand. Some deals may not be available in all currencies and may not
be returned. The currency must be in the list of TRAVLR supported currencies.",
     "schema": {
      "type": "string"
     }
    },
    {
     "name": "id",
     "in": "query",
     "description": "The Id parameter is used to pick one specific product. If Id is used then
type must also be supplied. For a deal this is the deal Id. For an activity or an accommodation
then the Id is a listing Id. This parameter is optional.",
     "schema": {
      "type": "string"
     }
    }
   ],
   "responses": {
    "200": {
     "description": "200 response",
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProductSearchResult"
       }
      }
     }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "ProductSearchResult": {
    "type": "object",
    "properties": {
     "products": {
      "title": "The products schema",
      "type": "array",
      "description": "This is a list of products that match the filters on the API call",
      "items": {
       "title": "A product",
       "type": "object",
       "properties": {
        "id": {
         "title": "The product id",
         "type": "integer",
         "description": "This is the numeric id of the product within the type."
        },
        "type": {
         "title": "The product type",
         "type": "string",
         "description": "The product type is one of Deal, Activity, or Accommodation."
        },
        "title": {
         "title": "The product title",
         "type": "string",
         "description": "A short title describing the product."
        },
        "url": {
         "title": "The product url",
         "type": "string",
         "description": "This URL represents the detail page where the product can be viewed
and purchased."
        },
        "label": {
         "title": "The product label",
         "type": "string",
         "description": "The label is an additional piece of information about the product. This
field is optional."
        },
        "image": {
         "title": "The product image",
         "type": "string",
         "description": "This is the URL of an image to visually represent the product. The
image can be scaled to suit the intended usage by adding ?imgeng=/w_300/h_200 to the URL."
        },
        "category": {
         "title": "The product category",
         "type": "string",
         "description": "This is the primary category of the product. For example 'Things To
Do' or 'Accommodation'"
        },
        "destination": {
         "title": "The product destination",
         "type": "string",
         "description": "The primary destination of the product. For example 'Wellington' or
'Central Otago Lakes'."
        },
        "price": {
         "title": "The product sale price",
         "type": "object",
         "properties": {
          "amount": {
           "title": "The sale price amount",
           "type": "number",
           "description": "The sale price amount as a number."
        },
        "currency": {
         "title": "The sale price currency",
         "type": "string",
         "description": "The sale price currency in ISO 4217 format."
        },
        "symbol": {
         "title": "The sale priced currency symbol",
         "type": "string",
         "description": "The sale price currency symbol."
        },
        "formatted": {
         "title": "The formatted sale price",
         "type": "string",
         "description": "The fully formatted version of the sale price including currency,
currency symbol, and amount using country locale separators."
        }
        },
        "description": "This is the total price a customer would pay to purchase the product."
       },
       "rrp": {
        "title": "The product rrp price",
        "type": "object",
        "properties": {
         "amount": {
          "title": "The rrp amount",
          "type": "number",
          "description": "The rrp amount as a number."
         },
         "currency": {
          "title": "The rrp currency",
          "type": "string",
          "description": "The rrp currency in ISO 4217 format."
         },
         "symbol": {
          "title": "The rrp currency symbol",
          "type": "string",
          "description": "The rrp currency symbol."
         },
         "formatted": {
          "title": "The formatted rrp",
          "type": "string",
          "description": "The fully formatted version of the rrp including currency, currency
symbol, and amount using country locale separators."
         }
        },
        "description": "This is the recommended retail price of the product. This price is
optional and may be 0. The RRP may also be the same as the sale price."
       },
       "inclusions": {
        "title": "The inclusions list",
        "type": "array",
        "description": "A list of up to 5 inlusions for the product.",
        "items": {
         "title": "The inclusion",
         "type": "string",
         "description": "A description of a single inclusion."
        }
       }
      }
     }
    },
    "errorMessage": {
     "title": "The error message",
     "type": "string",
     "description": "This will be blank unless an error occurs getting the product list. The text
here is to help with debugging and is not useful to display to an end user."
    }
   }
  }
 }
 }
}

TRAVLR Updates

Sign up for our TRAVLR Updates mailing list where you get first access to all our new releases, functionality optimizations, or BETA trials. Don't miss out on being at the forefront of the industry!

TRAVLR Updates

Sign up for our TRAVLR Updates mailing list where you get first access to all our new releases, functionality optimizations, or BETA trials. Don't miss out on being at the forefront of the industry!

TRAVLR Updates

Sign up for our TRAVLR Updates mailing list where you get first access to all our new releases, functionality optimizations, or BETA trials. Don't miss out on being at the forefront of the industry!

TRAVLR

© 2023 All rights reserved

TRAVLR

© 2023 All rights reserved

TRAVLR

© 2023 All rights reserved