Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Softrip's JSON API allows third parties to get user information, shop pricing and availability, and create bookings using a standard set of requests and responses.

Edit this section

Getting Started

Softrip's JSON API uses a standard request and response format.Edit this section

Requests

Requests should be built as HTTP POST or GET messages. All requests must have a "TransType" parameter. All input parameters should be passed as simple key-value pairs (except in the case of BookCommands in the "BOOK" request, see below).
For example, a login request will look like this:

Code Block
https://www.domain.com/res/json.aspx?TransType=LOGIN&login=mylogin&password=mypassword

Edit this section

Response

Responses are returned as JSON objects. All response have the following members, in addition to process-specific members (in the "content" placeholder below):

Code Block
languagejson
{
  "response": {
    "statuscode": 200,
    "iserror": false,
    "errormessage": "",
    "errors": [],
    "warnings": [],
    "stacktrace": "",
    "processingtime": 0.040,
    "friendlyerror": "",
    "friendlyerrortype": "",
    "<content>" 
  }
}

...

When consuming the API, always make sure to check the "iserror" boolean field. This will indicate if there was an error processing your request. If it is set to True, the "errors" array will contain an array of error messages that occurred during processing. The "errormessage" field contains the description of the first error that occurred (usually the most important one).
The "warnings" field contains an array of warning that occurred during processing. These are warning that didn't cause the process to fail, but may contain important messages about the process, indicating that the result set may not be what was expected.Edit this section

Terminology and Formats

Edit this section

Dates

All dates should be formatted as strings in yyyy-MM-dd format.

...

  • 23 Sep 2014 will be represented by the string "2014-09-23"

  • 1 Jan 2008 will be represented by the string "2008-01-01"

Edit this section

Masks

Masks are strings representing rooms and occupancies in a request (SHOP or BOOK). In a mask, each "A" represents an adult, each "C" represents a child (must be followed by the child's age), and each "/" (forward slash) represents a new room.

...

  • AA - Two adults in one room

  • AA/A - One room with two adults + one room with one adult

  • AAC5 - One room with two adults and one 5-year old child

...

Shares

If the product is configured to allow shared rooms, shared rooms can be booked using a special mask value to indicate the number of guests in a room, and their gender.

...

  • SFAA - One female guest in a double room

  • SMAAA - One male guest in a triple room

  • SXAA - One guest (male or female) in a double room

...

Suppliers & Services

Suppliers are companies providing services. For example, a hotel is a supplier, which provides room categories as services. Each supplier has a unique ID "SupplierID". Supplier IDs are strings representing this Supplier.

...

  • AIR - Air

  • CAR - Car Rental

  • CNV - Conveyance (Multi-day shared bus/transport - For escorted tours)

  • CRU - Cruise

  • DRK - Drink

  • ENF - Entrance Fee

  • EXP - Expense

  • FEE - Fee

  • FOR - Foreign Operator

  • GDE - Guide

  • HTL - Hotel

  • INS - Insurance

  • INV - Inventory Management

  • MIS - Miscellaneous

  • PKG - Package

  • PRO - Promotions and discounts

  • RST - Meal (Restaurant)

  • SHP - Shipping

  • SST - Sightseeing Tour

  • TIP - Tip

  • TRA - Rail (Train - Per seat)

  • TRF - Transfer

  • TRS - Rail (Sleeper Train - Per cabin)

Edit this section

Products

Products are collections of related services. In order to sell a service, it must be part of a product. The product contains a list of related services, and markup rules determining the selling price and other pricing/costing/commission rules for those services.
Products are identified by a unique ProductCode (string).
There are two types of products in Softrip:

  • Package

    • Packages are products with fixed itinerary, duration, and departure dates. For example, a package may be "8 Day Tour of Italy and Sicily". It will have a fixed duration, only depart on certain dates, and the itinerary will be pre-built (e.g. "Day 1 - Visit Rome, Day 2 - Tuscan winery your etc.").

  • List

    • Used for FIT/build-your-own bookings. List are collections of related services that can be booked for any date, any duration. For example, the product "List of services in Cancun, Mexico" will have all the hotel services the provder wants to sell, and may also include some optional transfers or sightseeing tours.

Edit this section

Contacts

Softrip Contacts represent people. For example, each passenger on a reservation is a contact in the system.
In addition, travel agents are also stored as Contacts.
Contacts are represented by a unique integer as their ContactID.Edit this section

Customers

Softrip Customers represent organizations or companies that purchase from the provider. For example, a travel agency will have a Customer record in the system.
Customer are represented by a unique CustomerID string. Usually, the CustomerID will be the travel agency's IATA or CLIA number.Edit this section

Price vs. DisplayPrice

If you are familiar with Price and DisplayPrice, note that the API always returns DisplayPrice in its "price" field.
If you are not familiar with Price vs. DisplayPrice:

...

Service

Price

DisplayPrice

Hotel

250

0

Transfer

50

0

Package

-25

275

Total

275

275

Edit this section

Sessioned Calls

Sessioned calls are always tied to a Softrip Reservation System or CMS session. If your company has its own homepage and static pages on a third-party platform (e.g. Joomla, Drupal), these calls can be used to change the content of the page based on the web user's status. For example, a logged-in user would see "My Account" in the header instead of "Log In" if they were not authenticated.Edit this section

SessionLess Calls

SessionLess calls are not tied to a Softrip Reservation System or CMS session. These are used by third-party custom front-ends that use Softrip's API as a booking back-end, or to pull content into a third-party web platform (e.g. Joomla, Drupal).