Trip API (v2)

Download OpenAPI specification:Download

Trips

APIs to manage trips and PNRs.

List trips

This endpoint returns the trips and associated PNR's for an organisation, depending on the updated time and pnrType.

SecurityBearer
Request
Request Body schema: application/json
required
object (OrganizationId)

Organization id for traveler.

object (DateTimeOffset)

ISO8601 UTC Date Time

pnrType
required
string

Type of PNR

Enum: "AIR" "CAR" "RAIL" "HOTEL" "LIMO" "ALL"
Array of objects (CustomFieldId)

List of custom field IDs to filter

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/list-organisation-trips
Request samples
application/json
{
  • "organizationId": {
    },
  • "updatedAt": {
    },
  • "pnrType": "AIR",
  • "customFieldIds": [
    ]
}
Response samples
application/json
{
  • "trips": [
    ]
}

Create trip

This endpoint creates a trip object. A trip is a container object for all related PNRs associated with a trip.

SecurityBearer
Request
Request Body schema: application/json
tripName
required
string

Name of the trip.

tripDescription
string

Description of the trip.

object (UserId)

User identifier

object (UserId)

Creator of the Trip.

Responses
201

Created

400

Bad request

401

Unauthorized

403

Forbidden

post/v2/trips
Request samples
application/json
{
  • "tripName": "string",
  • "tripDescription": "string",
  • "userId": {
    },
  • "registrarId": {
    }
}
Response samples
application/json
{
  • "id": "string"
}

Get trip

This endpoint gets trip by ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Identifier for trip.

Example: 2398199412
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/trips/{tripId}
Request samples
Response samples
application/json
{
  • "tripId": "6926658168",
  • "tripName": "JFK SFO Trip",
  • "tripDescription": "JFK SFO Business Trip",
  • "applicationId": "97ab27fa-30e2-43e3-92a3-160e80f4c0d5",
  • "startDate": {
    },
  • "endDate": {
    }
}

Update trip

This endpoint updates trip by ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Identifier for trip.

Example: 2398199412
Request Body schema: application/json
tripId
required
string

Spotnana trip Id

tripName
required
string

Name of the trip

tripDescription
string

Trip description

Responses
204

Updated Successfully

400

Bad request

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/trips/{tripId}
Request samples
application/json
{
  • "tripId": "6926658168",
  • "tripName": "JFK SFO Trip",
  • "tripDescription": "JFK SFO Business Trip"
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get trip details

This endpoint gets trip details for a given trip ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v3/trips/{tripId}/detail
Request samples
Response samples
application/json
{
  • "basicTripInfo": {
    },
  • "pnrs": [
    ],
  • "pendingShellPnrs": [
    ],
  • "pendingManualFormPnrs": [
    ],
  • "tripStatus": "CONFIRMED",
  • "tripBookingStatus": "PENDING_STATUS",
  • "eventSummary": {
    },
  • "simplePnrs": [
    ],
  • "additionalInfo": {
    }
}

Create PNR

This endpoint creates a PNR. A PNR represents a booking in spotnana. This could be Air/Hotel/Car/Rail booking. This endpoint is used to creare PNR document for a booking that is created outside Spotnana platform and its details are to be put in Spotnana.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
Request Body schema: application/json
version
integer <int32>

Current PNR version. This field is used for handling conflicts in case of concurrent updates. This should be sent unmodified in update request.

object (SourceInfo)

Information about the source of booking

invoiceDelayedBooking
boolean

True if the billing is delayed

Array of objects (Traveler) non-empty
Deprecated
Array of objects (PnrTraveler) non-empty

List of travelers on this pnr and their information. This is a required field.

object (COGS)

Payment information about all goods sold. This is a required field for now.

object (CTC)

Cost of services, charged to customer

object (PolicyInfo)

Policy related info for this booking

object (Air)

Air booking information

object (Hotel)

Hotel booking information

object (Car)

Car booking information

object (Rail)

Rail booking information

object (LimoInfo)

Limo booking information

object (MiscInfo)

Miscellaneous booking information

object

Any addtional metadata associated with the booking

object (PreBookAnswers)

The per booking answers collected from the traveler during checkout.

Array of objects (CustomField)

List of all the Custom Fields associated with this Pnr

travelerPnrVisibilityStatus
string

Represents the PNR visibility status, if marked as HIDDEN should not be displayed to the traveler

Enum: "VISIBLE" "HIDDEN"
object (ShellPnrInfo)

Information about shell pnr

object (PnrCreationDetails)

Information about pnr creation

Array of objects (ApprovalInfo)

Approval related information for the PNR

cancellationRequestStatus
string (CancellationRequestStatus)

Status of in progress cancellation request CANCELLATION_IN_PROGRESS - Cancellation request is in progress via OBT CANCELLATION_BY_AGENT_REQUESTED - Cancellation request is in progress via agent

Enum: "CANCELLATION_IN_PROGRESS" "CANCELLATION_BY_AGENT_REQUESTED"
object

PNR related external information

tripId
string

Spotnana trip ID to which the PNR belongs to

object

Information passed to the Spotnana email system that processes booking updates.

object (LLFPnrInfo)

Lowest logical fare info at pnr level

pnrId
string

Spotnana PNR ID

Array of objects (InvoiceInfo)

Invoice related information for the PNR

object (FareAmount)

Total fare amount of the PNR comprising components such as base fare and taxes. This field does not include any Service fees.

dkNumber
string

DK number attached to the PNR.

object (SavingsFare)
Deprecated

Total savings present.

Responses
201

Created

400

Bad request

401

Unauthorized

403

Forbidden

post/v3/trips/{tripId}/pnrs
Request samples
application/json
{
  • "version": 1,
  • "sourceInfo": {
    },
  • "invoiceDelayedBooking": false,
  • "travelers": [
    ],
  • "pnrTravelers": [
    ],
  • "costOfGoodsSold": {
    },
  • "costToCustomer": {
    },
  • "policyInfo": {
    },
  • "airPnr": {
    },
  • "hotelPnr": {
    },
  • "carPnr": {
    },
  • "railPnr": {
    },
  • "limoPnr": {
    },
  • "miscPnr": {
    },
  • "additionalMetadata": { },
  • "preBookAnswers": {
    },
  • "customFields": [
    ],
  • "totalFare": {
    },
  • "bookingStatus": "PENDING_STATUS",
  • "travelerPnrVisibilityStatus": "VISIBLE",
  • "shellPnrInfo": {
    },
  • "pnrCreationDetails": {},
  • "approvalInfo": [
    ],
  • "cancellationRequestStatus": "CANCELLATION_IN_PROGRESS",
  • "externalInfo": {
    },
  • "tripId": "123456789",
  • "freshnessInfo": {
    },
  • "bookingEmailInfo": {
    },
  • "llfPnrInfo": {
    },
  • "pnrId": "123456789",
  • "invoiceInfos": [
    ],
  • "totalFareAmount": {
    },
  • "dkNumber": "123456789",
  • "savingsFare": {
    }
}
Response samples
application/json
{
  • "id": "string"
}

Get PNR

This endpoint gets PNR for a given trip ID and PNR ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
pnrId
required
string

Pnr Id

Example: 6926658168
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v3/trips/{tripId}/pnrs/{pnrId}
Request samples
Response samples
application/json
{
  • "version": 1,
  • "createdVia": "OFFLINE",
  • "initialVersionCreatedVia": "OFFLINE",
  • "sourceInfo": {
    },
  • "invoiceDelayedBooking": false,
  • "travelers": [
    ],
  • "pnrTravelers": [
    ],
  • "costOfGoodsSold": {
    },
  • "costToCustomer": {
    },
  • "isFinalized": false,
  • "policyInfo": {
    },
  • "airPnr": {
    },
  • "hotelPnr": {
    },
  • "carPnr": {
    },
  • "railPnr": {
    },
  • "limoPnr": {
    },
  • "miscPnr": {
    },
  • "additionalMetadata": {
    },
  • "preBookAnswers": {
    },
  • "customFields": [
    ],
  • "bookingHistory": [
    ],
  • "totalFare": {
    },
  • "serviceFees": [
    ],
  • "paymentInfo": [
    ],
  • "bookingStatus": "PENDING_STATUS",
  • "contactSupport": false,
  • "travelerPnrVisibilityStatus": "VISIBLE",
  • "shellPnrInfo": {
    },
  • "pnrCreationDetails": {},
  • "approvalInfo": [
    ],
  • "cancellationRequestStatus": "CANCELLATION_IN_PROGRESS",
  • "externalInfo": {
    },
  • "tripId": "123456789",
  • "documents": [
    ],
  • "freshnessInfo": {
    },
  • "bookingEmailInfo": {
    },
  • "llfPnrInfo": {
    },
  • "pnrId": "123456789",
  • "invoiceInfos": [
    ],
  • "totalFareAmount": {
    },
  • "dkNumber": "123456789",
  • "savingsFare": {
    }
}

Update PNR

This endpoint updates PNR by ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
pnrId
required
string

Pnr Id

Example: 6926658168
Request Body schema: application/json
version
integer <int32>

Current PNR version. This field is used for handling conflicts in case of concurrent updates. This should be sent unmodified in update request.

object (SourceInfo)

Information about the source of booking

invoiceDelayedBooking
boolean

True if the billing is delayed

Array of objects (Traveler) non-empty
Deprecated
Array of objects (PnrTraveler) non-empty

List of travelers on this pnr and their information. This is a required field.

object (COGS)

Payment information about all goods sold. This is a required field for now.

object (CTC)

Cost of services, charged to customer

object (PolicyInfo)

Policy related info for this booking

object (Air)

Air booking information

object (Hotel)

Hotel booking information

object (Car)

Car booking information

object (Rail)

Rail booking information

object (LimoInfo)

Limo booking information

object (MiscInfo)

Miscellaneous booking information

object

Any addtional metadata associated with the booking

object (PreBookAnswers)

The per booking answers collected from the traveler during checkout.

Array of objects (CustomField)

List of all the Custom Fields associated with this Pnr

travelerPnrVisibilityStatus
string

Represents the PNR visibility status, if marked as HIDDEN should not be displayed to the traveler

Enum: "VISIBLE" "HIDDEN"
object (ShellPnrInfo)

Information about shell pnr

object (PnrCreationDetails)

Information about pnr creation

Array of objects (ApprovalInfo)

Approval related information for the PNR

cancellationRequestStatus
string (CancellationRequestStatus)

Status of in progress cancellation request CANCELLATION_IN_PROGRESS - Cancellation request is in progress via OBT CANCELLATION_BY_AGENT_REQUESTED - Cancellation request is in progress via agent

Enum: "CANCELLATION_IN_PROGRESS" "CANCELLATION_BY_AGENT_REQUESTED"
object

PNR related external information

tripId
string

Spotnana trip ID to which the PNR belongs to

object

Information passed to the Spotnana email system that processes booking updates.

object (LLFPnrInfo)

Lowest logical fare info at pnr level

pnrId
string

Spotnana PNR ID

Array of objects (InvoiceInfo)

Invoice related information for the PNR

object (FareAmount)

Total fare amount of the PNR comprising components such as base fare and taxes. This field does not include any Service fees.

dkNumber
string

DK number attached to the PNR.

object (SavingsFare)
Deprecated

Total savings present.

Responses
204

Updated Successfully

400

Bad request

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v3/trips/{tripId}/pnrs/{pnrId}
Request samples
application/json
{
  • "version": 1,
  • "sourceInfo": {
    },
  • "invoiceDelayedBooking": false,
  • "travelers": [
    ],
  • "pnrTravelers": [
    ],
  • "costOfGoodsSold": {
    },
  • "costToCustomer": {
    },
  • "policyInfo": {
    },
  • "airPnr": {
    },
  • "hotelPnr": {
    },
  • "carPnr": {
    },
  • "railPnr": {
    },
  • "limoPnr": {
    },
  • "miscPnr": {
    },
  • "additionalMetadata": { },
  • "preBookAnswers": {
    },
  • "customFields": [
    ],
  • "totalFare": {
    },
  • "bookingStatus": "PENDING_STATUS",
  • "travelerPnrVisibilityStatus": "VISIBLE",
  • "shellPnrInfo": {
    },
  • "pnrCreationDetails": {},
  • "approvalInfo": [
    ],
  • "cancellationRequestStatus": "CANCELLATION_IN_PROGRESS",
  • "externalInfo": {
    },
  • "tripId": "123456789",
  • "freshnessInfo": {
    },
  • "bookingEmailInfo": {
    },
  • "llfPnrInfo": {
    },
  • "pnrId": "123456789",
  • "invoiceInfos": [
    ],
  • "totalFareAmount": {
    },
  • "dkNumber": "123456789",
  • "savingsFare": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Add Remark

This endpoint provided adding third party remarks to the given PNR.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
pnrId
required
string

PNR ID

Example: 6926658168
Request Body schema: application/json
required
Array of SabrePnrRemarkWrapper (object) (ThirdPartyPnrRemark)

The list of remarks to be added to the give PNR.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v3/trips/{tripId}/pnrs/{pnrId}/remarks
Request samples
application/json
{
  • "remarks": [
    ]
}
Response samples
application/json
{
  • "processedRemarks": [
    ],
  • "ignoredRemarks": [
    ]
}

Finalize the given pnr.

This endpoint changes the metadata of PNR to finalized and triggers supplier actions if required.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip Id

Example: 6926658168
pnrId
required
string

Pnr Id

Example: 6926658168
Request Body schema: application/json
object (PreBookAnswers)
AirPriceOptimizationMetadataWrapper (object) or ManualVerificationIntentWrapper (object) or QcFinalizationWrapper (object) (FinalizeIntent)
object (FinalizeMetadata)

Metadata information related to finalize request

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v3/trips/{tripId}/pnrs/{pnrId}/finalize
Request samples
application/json
{
  • "preBookAnswers": {
    },
  • "finalizeIntent": {
    },
  • "finalizeMetadata": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Suspend the given pnr.

This endpoint suspends the PNR, transitioning it into a read-only state. Once suspended, updates via OBT will be restricted. This API serves various use cases, such as price optimization and rebooking.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip Id

Example: 6926658168
pnrId
required
string

Pnr Id

Example: 6926658168
Request Body schema: application/json
reason
required
string

Reason for suspending the pnr

Enum: "AIR_PRICE_OPTIMIZATION" "EXCHANGE"
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v3/trips/{tripId}/pnrs/{pnrId}/suspend
Request samples
application/json
{
  • "reason": "AIR_PRICE_OPTIMIZATION"
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Delete trip

This endpoint deletes a trip by ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
Responses
204

Deleted Successfully

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

delete/v3/trips/{tripId}
Request samples
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Download PNR invoice

This endpoint downloads invoice on demand for a given trip ID and PNR ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip Id

Example: 6926658168
pnrId
required
string

Pnr Id

Example: 2643222286
Responses
200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/trips/{tripId}/pnrs/{pnrId}/download-invoice
Request samples
Response samples
application/json
{
  • "data": "6935813e12584abda0e43d71cd2ea260"
}

Cancel PNR

This endpoint cancels PNR or part of PNR object.In case of partial PNR cancel we can cancel journey/ticket.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID

Example: 6926658168
pnrId
required
string

PNR ID

Example: 6926658168
Request Body schema: application/json
cancellationType
string

Type of cancellation to be performed. For the NO_REFUND, FULL_REFUND and FULL_CREDIT cancellation types, if no cancellationDetails are provided, we assume the entire PNR is being canceled. If the cancellation type is FULL_CREDIT, we will also assume the credits created will have 0 penalty and an expiry date of 1 year from the issue date of the ticket.

Enum: "NO_REFUND" "FULL_REFUND" "PARTIAL_REFUND" "FULL_CREDIT"
Array of objects (CancelDetail)

List of object to be cancelled and their associated refund details.

object

Information passed to the Spotnana email system that processes booking updates.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v3/trips/{tripId}/pnrs/{pnrId}/cancel
Request samples
application/json
{
  • "cancellationType": "FULL_REFUND",
  • "cancellationDetails": [
    ],
  • "bookingEmailInfo": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get trip partner info

This endpoint provides info related to partner for the trip.

SecurityBearer
Request
path Parameters
tripId
required
string

Identifier for trip.

Example: 2398199412
bookerEmailId
required
string

Booker Email Id for whom budget info will be fetched.

Example: akanksha@spotnana.com
Responses
200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/trips/{tripId}/booker-email/{bookerEmailId}/partner-info
Request samples
Response samples
application/json
{
  • "tripId": "6926658168",
  • "partnerInfo": {
    }
}

Get cancellation details

This endpoint gets cancellation details for a given trip ID and PNR ID.

SecurityBearer
Request
path Parameters
tripId
required
string

Trip ID.

Example: 1234567890
pnrId
required
string

PNR ID.

Example: 6926658168
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/trips/{tripId}/pnrs/{pnrId}/cancellation-details
Request samples
Response samples
application/json
{
  • "pnrId": "1234567890",
  • "tripId": "2345678901",
  • "cancellationDetails": {
    }
}

Get PNR by external Id

This endpoint gets PNR Id and Trip Id for a given external Id.

SecurityBearer
Request
query Parameters
externalId
required
string

External ID

Example: externalId=external-pnr-id
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/pnrs
Request samples
Response samples
application/json
{
  • "pnrId": "1234567890",
  • "tripId": "1234567890"
}

Process the PNR approval

This endpoint process a PNR approval to approved or declined

SecurityBearer
Request
path Parameters
pnrId
required
string

Pnr Id

Example: 6926658168
Request Body schema: application/json
approvalId
string

Serialised Id containing approval related info

approvalType
required
string

Approval response APPROVED or DECLINED

Enum: "APPROVED" "DECLINED"
Responses
200

OK

400

Bad request

401

Unauthorized

403

Forbidden

post/v2/pnrs/{pnrId}/process-approval
Request samples
application/json
{
  • "approvalId": "test-approval-id",
  • "approvalType": "APPROVED"
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Invoicing

Get Invoice Data

This endpoint gets the invoice data for given invoice numbers

SecurityBearer
Request
Request Body schema: application/json
tmcId
string
Deprecated

TMC for which invoice is being requested. Deprecated in favor of invoiceIds.

invoiceNumbers
Array of strings
Deprecated

One or more invoice numbers being requested. Deprecated in favor of invoiceIds.

invoiceIds
Array of strings <uuid>

One or more Invoice IDs being requested

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/invoicing/invoice-data
Request samples
application/json
{
  • "tmcId": "15c94ac1-f540-4916-9243-306a75fbd8a9",
  • "invoiceNumbers": [
    ],
  • "invoiceIds": [
    ]
}
Response samples
application/json
{
  • "invoices": [
    ]
}
Copyright © 2020-2024 Spotnana Technology, Inc.