Best fares, easy and straightforward integration

Designed with for developers

Errors

Introduction

The following example will show you how to deal with errors. These may include bad requests or validation errors. The format is always the same and all errors returned will follow the same pattern.

  • type Error Type. Please refer to the example below.
  • Additional fields, specific to each error type. Depending on your use case and/or business logic, you may wish to abandon bookings with one of these errors, or for the best user experience, build logic on top of these for a smooth journey for your users.

Example

success boolean

A boolean whether your call succeeded or not. If you're getting false, something has gone wrong. Successful responses will not include the success field. You should check whether it's there and if false, and you still can't figure out what's wrong based on the error messages provided, please do not hesitate to contact us immediately!

type string

This string field will contain the error type. The default value is ERROR_GENERAL which is most of the time a problem with the submitted data.

There are however several cases where the type will be different and there may be additional data included in the error response to aid you in handling the error.

You'll get ERROR_DATA_VALIDATION upon data validation errors

You'll get ERROR_UNAUTHORIZED along with a 401 Unauthorized status code upon authentication/authorization errors.

errors array

An array of errors, each of which is a hash, which is described in the next table below.

Error

message Mandatory (Will always be there) string

The error message

path Optional (This element may be missing) string

The error path. This is very useful for identifying which exactly field in your request has wrong data. It may not be there depending on the nature of your request.

Make sure to make checks whether the path is there or not. If missing, the value will not be null, it will not be there at all.

{
    "success":false,
    "type":"ERROR_GENERAL",
    "errors":[
        {
            "message":"Departure Flight not found",
            "path":"flights.flightId"
        }
    ]
}