Air API (v2)

Download OpenAPI description
Languages
Servers
Staging URL
https://apis.spotnana.com/
Spotnana mock server
https://developer.spotnana.com/_mock/openapi/airapi/

Air

APIs to perform search, checkout and book an air pnr

Operations

Validate air itinerary (interim)

Request

Validates an itinerary at any interim stage of air booking workflow and allows you to keep track of fare details before proceeding to checkout. Using this endpoint is optional. It requires a searchId and the itineraryId to obtain the latest fare details of the selected itinerary. The travelerType field in this endpoint response currently only accepts ADULT, CHILD and INFANT.

Bodyapplication/jsonrequired
searchIdstringrequired

The unique searchId corresponding to the selected itinerary.

itineraryIdstringrequired

The selected itineraryId which you would like to validate.

curl -i -X POST \
  https://apis.spotnana.com/v2/air/intermediate-revalidate-itinerary \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "searchId": "string",
    "itineraryId": "string"
  }'

Responses

OK

Bodyapplication/json
bookingIdstring

The booking ID for the booking.

Example: "bookingid"
fareBreakDownobject(BookingFareBreakdown)
legPricesArray of objects(LegPrice)
perTravelerPricesArray of objects(PerTravelerPrice)
policyDetailsobject(PnrPolicyInfo)

Policy Info applicable for the associated itinerary

Response
application/json
{ "bookingId": "bookingid", "fareBreakDown": { "totalFare": {}, "merchantFee": {}, "airlineFee": {} }, "legPrices": [ {} ], "perTravelerPrices": [ {} ], "policyDetails": { "policies": [], "ruleResultInfos": [] } }

Create air pnr

Request

Creates a new air booking with the given itinerary

Bodyapplication/jsonrequired
bookingIdstring

The booking ID for which the PNR is being created. This is returned in the revalidate itinerary API response.

Example: "booking-id"
initiateBookingIdstring

Initiate booking id is returned in response to air-initiate-booking API call. This id is required if in case the booking id is not available due to third-party redirection.

Example: "eCfghty567jkHG56DFgh"
preSearchAnswersobject(PreSearchAnswers)
postPaymentVerificationInfoPostPaymentVerificationInfo (object) or PostPaymentVerificationInfo (object) or PostPaymentVerificationInfo (object) or PostPaymentVerificationInfo (object) or PostPaymentVerificationInfo (object)(PostPaymentVerificationInfo)
One of:

Wrapper for post stripe verification info object.

isPreAuthApprovalRequiredboolean

Flag to check if the pre-authorization approval is enabled.

Example: false
customFieldV3ResponsesArray of objects(CustomFieldV3Response)

Custom field responses for the booking.

preBookAnswersobject(PreBookAnswers)Deprecated
curl -i -X POST \
  https://apis.spotnana.com/v2/air/create-pnr \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "bookingId": "booking-id",
    "initiateBookingId": "eCfghty567jkHG56DFgh",
    "preBookAnswers": {
      "answers": [
        {
          "entityId": "string",
          "userInput": "string",
          "itemIds": [
            0
          ],
          "answers": [
            {
              "item": "string",
              "value": "string",
              "description": "string"
            }
          ],
          "customFieldType": "QUESTION",
          "questionDisplayText": "string",
          "question": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "name": "string",
            "questionFormat": "CHECKBOX",
            "optionInfo": {
              "source": "MANUAL",
              "sourceMetadata": {
                "companyConfig": {}
              },
              "totalNumOptions": 0,
              "options": [
                {}
              ]
            },
            "isRequired": true,
            "isDisabled": true,
            "includeInItinerary": true,
            "customFieldLocations": [
              "POLICY_APPROVAL_EMAIL"
            ],
            "matchConditions": {
              "travelerConditions": {
                "workerTypes": [
                  null
                ],
                "countries": [
                  null
                ],
                "legalEntities": [
                  null
                ],
                "departments": [
                  null
                ],
                "costCenters": [
                  null
                ],
                "offices": [
                  null
                ]
              },
              "travelTypes": [
                "AIR"
              ],
              "travelRegionTypes": [
                "DOMESTIC"
              ],
              "tripUsageTypes": [
                "STANDARD"
              ]
            },
            "questionType": {
              "preSearchQuestionType": "PURPOSE_OF_TRIP",
              "preCheckoutQuestionType": "OOP_REASON_CODE"
            }
          }
        }
      ],
      "preBookQuestionResponseId": "string"
    },
    "preSearchAnswers": {
      "answers": [
        {
          "entityId": "string",
          "userInput": "string",
          "itemIds": [
            0
          ],
          "answers": [
            {
              "item": "string",
              "value": "string",
              "description": "string"
            }
          ],
          "customFieldType": "QUESTION",
          "questionDisplayText": "string",
          "question": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "name": "string",
            "questionFormat": "CHECKBOX",
            "optionInfo": {
              "source": "MANUAL",
              "sourceMetadata": {
                "companyConfig": {}
              },
              "totalNumOptions": 0,
              "options": [
                {}
              ]
            },
            "isRequired": true,
            "isDisabled": true,
            "includeInItinerary": true,
            "customFieldLocations": [
              "POLICY_APPROVAL_EMAIL"
            ],
            "matchConditions": {
              "travelerConditions": {
                "workerTypes": [
                  null
                ],
                "countries": [
                  null
                ],
                "legalEntities": [
                  null
                ],
                "departments": [
                  null
                ],
                "costCenters": [
                  null
                ],
                "offices": [
                  null
                ]
              },
              "travelTypes": [
                "AIR"
              ],
              "travelRegionTypes": [
                "DOMESTIC"
              ],
              "tripUsageTypes": [
                "STANDARD"
              ]
            },
            "questionType": {
              "preSearchQuestionType": "PURPOSE_OF_TRIP",
              "preCheckoutQuestionType": "OOP_REASON_CODE"
            }
          }
        }
      ],
      "userEntitiesResponseId": "string"
    },
    "postPaymentVerificationInfo": {
      "paymentKey": "string",
      "postStripeVerificationInfo": {
        "paymentMethodId": "pm_1HzKDPI3bT9GUjvoUkRQooN3"
      }
    },
    "isPreAuthApprovalRequired": false,
    "customFieldV3Responses": [
      {
        "fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
        "fieldName": "string",
        "armId": "0fd508db-63ff-4444-bfb1-b89c43061433",
        "selectedOptions": [
          {
            "name": "string",
            "description": "string",
            "additionalUserInput": "string",
            "additionalInfos": [
              "string"
            ]
          }
        ]
      }
    ]
  }'

Responses

OK

Bodyapplication/json
pnrIdstring

Spotnana PNR ID.

sourcePnrIdstring

Source PNR ID

pnrStatusstring

PNR status (for example success, approval pending)

Enum"SUCCESS""APPROVAL_PENDING""CC_VERIFICATION_REQUIRED""PAYMENT_PENDING""CONFIRMATION_PENDING""ERROR"
createPnrApplicationInfoobject

Create PNR application info, will return warning or error if present

Response
application/json
{ "pnrId": "string", "sourcePnrId": "string", "pnrStatus": "SUCCESS", "createPnrApplicationInfo": { "applicationWarning": [] } }

Cancel Air Pnr

Request

Cancel the air pnr and issues applicable refunds

Bodyapplication/jsonrequired
pnrIdstringrequired

The spotnana assigned unique PNR id of the booking.

Example: "1234567819"
optionIdstringrequired

Cancellation option id chosen by the traveler prior to cancelling the booking. The trip->cancellation-details API returns a bunch of options like whether the traveler wants to keep the ticket as unused or get the refunds with applicable penalties.

Example: "OPTION123"
cancellationOverrideobject(CancellationOverride)

Cancellation info override details, like cancellation penalty, waiver code, etc.

customFieldV3ResponsesArray of objects(CustomFieldV3Response)

Custom field responses for the booking.

curl -i -X POST \
  https://apis.spotnana.com/v2/air/cancel-pnr \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pnrId": "1234567819",
    "optionId": "OPTION123",
    "cancellationOverride": {
      "waiverCode": "WAV123",
      "tourCode": "TRAC345",
      "newCancellationPenalty": {
        "amount": 510,
        "currencyCode": "GBP",
        "convertedAmount": 715.42,
        "convertedCurrency": "USD",
        "otherCoinage": [
          {
            "coinageCode": "BREX_POINTS",
            "amount": 1000,
            "conversionRate": 0.01,
            "preferredCurrencyConversionRate": 0.01
          }
        ]
      }
    },
    "customFieldV3Responses": [
      {
        "fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
        "fieldName": "string",
        "armId": "0fd508db-63ff-4444-bfb1-b89c43061433",
        "selectedOptions": [
          {
            "name": "string",
            "description": "string",
            "additionalUserInput": "string",
            "additionalInfos": [
              "string"
            ]
          }
        ]
      }
    ]
  }'

Responses

OK

Bodyapplication/json
sourcePnrIdstring

Source pnr id of the cancellation.

Example: "ABCDEF"
statusstring(CancellationStatus)
  • CANCELLED: PNR is cancelled.
  • AGENT_TASK_CREATED: Agent task is created for the cancellation.
Enum"CANCELLED""AGENT_TASK_CREATED"
Response
application/json
{ "sourcePnrId": "ABCDEF", "status": "CANCELLED" }

Loyalty Programs

Operations