Confirm Booking

## Content - [Postman collection](#postman-collection) - [API Description](#api-description) - [API Parameters](#api-parameters) - [Input Parameters](#input-parameters) - [Output Parameters](#output-parameters) - [Error Codes](#error-codes) - [JSON Samples](#json-samples) - [Request](#request) - [Response](#response) ## Postman collection Please download the postman collection, environment and request for API Key to get started. Flight Booking API Collection- - Local playground with examples of request/response pairs for each endpoint. Additionally it assist the developers to understand the logical flow for the endpoints. Flight Booking API Environment - Holds the credential information that allows invocation of the endpoints. You can request for the credentials for this specific API [here](/apps/myapps). Request for API key ## API Description | | | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | API Name | confirmbooking | | API Type | Update | API Source | Eretail | | Description | Third call in the aggregated booking flow. Completes the payment procedures, and confirms the booking. The summary of the ticket(s) that were generated is also provided. | ## API Parameters ### HTTP Headers | Headers | Value | Description | | ------------------ | --------- | ---------------------------------------------------------------------------- | |Content-Type|application/json|| |apikey|*|An active SQ API Key for the FlightBooking Package| ### Input Parameters | Input Parameters | Data Type | Optional | Description | | ----------------------------------------------------------------------- | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | clientUUID | String | No | Any unique transaction identifier from the consumer’s end | | sessionID | String | No | Value returned by the last call to the booking flow | | pageTicket | String | No | Value returned by the last call to the booking flow | | recordLocator | String | No | 6 alphanumeric PNR value returned in the response of `createbooking` call | | orderInfo | String | No | Unique Payment identifier returned in the response of `createbooking` call | | validate3dsDetails | JSONObject | No | | | acsResponse | String | No | Base64 encoded string received from the card Issuer's ACS after the cardholder completes the authentication process. The payment authentication response (PaRes) value is posted from the ACS in the PaRes field. The value of the PaRes field must be used in the operation request unaltered. | | authorizationDetails | JSONObject | No | | | clientIPMACAddress | String | No | | | fareFamilyIndicator | String | No | | | deviceFingerPrint | String | No | | | billingAddressInfo | JSONObject | No | | | billingAddress1 | String | No | | | billingAddress2 | String | Yes | | | billingAddressCity | String | No | | | billingAddressState | String | Yes | | | billingAddressPostalCode | String | Yes | | | billingAddressCountry | String | No | | | bookingDetails | JSONObject | No | | | segmentIdList | String Array | | | | insuranceDetails | JSONObject | \_ | Mandatory is `insurancePresent` is true in `paymentDetails` below. Can be taken from `createBooking` response | | providerCode | String | No | | | productCode | String | No | | | totalAmount | Number | No | | | currencyCode | String | No | | | isMerchant | Boolean | No | | | travellerDetails | JSON Array | No | | | isLeadPassenger | Boolean | No | Boolean value, eg:true or false | | lastName | String | No | lastName of the passenger as in PNR | | travellerID | String | No | Taken from `createbooking` response | | identityDocumentList | JSON Array | \_ | Mandatory for US Itinerary | | dateOfBirth | Date | \_ | Date of Birth of passenger in yyyy-MM-dd format | | documentNumber | String | No | Document number, e.g.:P1234567G | | documentType | String | No | Document type, e.g.:P | | expiryDate | Date | \_ | Expiry date of document in YYMM format | | firstName | String | \_ | First name of passenger as in Document | | lastName | String | \_ | Last name of passenger as in Document | | gender | String | \_ | Gender of passenger as in Document | | nationality | String | \_ | Nationality of passenger as in Document | | title | String | \_ | Title of passenger as in Document | | issuingCountry | String | \_ | Issuing country of Document | | applicableCountry | String | \_ | Applicable Country of Document | | addressDetails | JSONObject | \_ | Only for US Visitors (pax travelling to US) | | address | String | No | Address of US Visitor | | city | String | No | City of US Visitor | | state | String | No | State of US Visitor | | zipCode | String | No | Zip code of US Visitor | | countryCode | String | No | Country Code of US Visitor | | gstDetails | JSONObject | Yes | To be provided when GST details are available | | gstRegNumber | String | Yes | 15 Digit GST Register Number, e.g.:894wer324 | | companyName | String | Yes | GST company Name, e.g.: TCS | | emailAddress | String | Yes | | | addressDetails | JSON Object | Yes | | | additionalAddressLine | String | Yes | Additional Address Line of the GST | | countryCode | String | Yes | | | zipCode | String | Yes | | | city | String | Yes | | | address | String | Yes | | | state | String | Yes | | | gstContactDetails | JSON Object | Yes | | | countryCode | String | Yes | Country Code of the Contact Number, e.g.:91 | | areaCode | String | Yes | Area code of the Contact Number | | contactNumber | String | Yes | | | infantDetails | | | Same structure as `travellerDetails` | | identityDocumentList | JSON Array | \_ | Mandatory for US Itinerary | | dateOfBirth | Date | \_ | Date of Birth of passenger in yyyy-MM-dd format | | documentNumber | String | No | Document number, e.g.:P1234567G | | documentType | String | No | Document type, e.g.:P | | expiryDate | Date | \_ | Expiry date of document in YYMM format | | firstName | String | \_ | First name of passenger as in Document | | lastName | String | \_ | Last name of passenger as in Document | | title | String | \_ | Gender of passenger as in Document | | gender | String | \_ | Nationality of passenger as in Document | | nationality | String | \_ | Title of passenger as in Document | | issuingCountry | String | \_ | Issuing country of Document | | applicableCountry | String | \_ | Applicable Country of Document | | addressDetails | JSONObject | \_ | Only for US Visitors (pax travelling to US) | | address | String | No | Address of US Visitor | | city | String | No | City of US Visitor | | state | String | No | State of US Visitor | | zipCode | String | No | Zip code of US Visitor | | countryCode | String | No | Country Code of US Visitor | | paymentDetails | JSONObject | No | | | payeeName | String | No | | | accountNumber | String | No | | | paymentType | String | No | | | cardType | String | No | | | expiryDate | String | No | | | cvvNumber | String | No | | | amount | String | No | | | isInsurancePresent | String | No | | | ccSurchargeAmount | String | Yes | | | resumeDetails | JSONObject | Yes | Used when we jumpstart to an intermediate call within the aggregator.
Is usually copied over from a partially failed response | ### Output Parameters | Output Parameters | Data Type | Description | | -------------------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------- | | status | String | “SUCCESS” / “FAILED” | | code | Number | 200 if status is “SUCCESS”. Refer to Section 5 for possible error codes | | message | String | Populated and displayed only if status is “FAILED” | | clientUUID | String | Same value as in request | | validationResult | JSONObject | Result of the CreditCard validation | | details | JSONObject | | | authenticationStatus | String | | | orderInfo | String | | | authorizationResult | JSONObject | | | details | JSONObject | | | responseStatusCode | String | | | approvalCode | String | | | fraudStatusCode | String | | | orderInfo | String | | | bookingConfirmationDetails | | | | bookingReference | String | | | ticketList | JSON Array | | | ticketNumber | String | | | infant | Boolean | True for infants | | travellerId | String | | | insuranceDetails | JSONObject | | | confirmationNumber | String | | | issuanceSuccess | String | | | failureDetails | JSONObject | | | errorCode | String | | | errorDesc | String | | | errorType | String | | | errorDetails | JSONObject | | | code | String | | | message | String | | | ticketSummary | JSONObject | | | tickets | JSON Array | | | issueDate | Date | | | isCCVRequired | Boolean | | | iataNumber | String | | | issuingStation | String | | | membershipNo | String | | | pnrNo | String | | | endorsementRestriction | String | | | boardingPoint | String | | | ticketList | JSON Array | | | firstName | String | | | lastName | String | | | paxType | String | | | ticketNumber | String | | | ticketKfNumber | String | | | totalMilesUsed | String | | | approvalCode | String | | | isPWMBooking | Boolean | | | isRedemptionBooking | Boolean | | | pwMMilesEqvCashUsed | String | | | cashPwMAmount | String | | | currency | String | | | fare | JSONObject | | | fareAmount | Number | | | totalAmount | Number | | | taxCount | Number | | | taxList | JSONArray | | | taxAmount | Number | | | taxCode | String | | | taxDescription | String | | | flightList | JSON Array | | | carrier | String | | | marketingCarrier | String | | | operatingCarrier | String | | | sellingClassType | String | | | isCodeShare | Boolean | | | isOAL | Boolean | | | baggageAllowance | String | | | flightNumber | String | | | notValidAfter | String | | | notValidBefore | String | | | status | String | | | couponNumber | String | | | departureCityCode | String | | | departureCityName | String | | | arrivalAirportCode | String | | | arrivalAirportName | String | | | departDate | String | | | departTime | String | | | cabinClass | String | | | departureAirportCode | String | | | departureAirportName | String | | | fopList | JSON Array | | | cardNumber | String | | | cardType | String | | | paymentMode | String | | | cardName | String | | | expiryDate | String | | | isConjunctiveTktFlg | String | | | insurance | JSON Array | | | issueDate | String | | | freeText | String | | | insuranceEmailId | String | | | receiptNo | String | | | associatedTicketNumbers | String | | | fop | JSON Array | | | currencyType | String | | | amount | String | | | mode | String | | | cardNumber | String | | | cardType | String | | | approvalCode | String | | | receiptDetails | String | | | receiptInfo | JSONObject | | | agencyCode | String | | | travellerName | String Array | | | flightDetails | JSON Array | | | origin | String | | | destination | String | | | marketingCompany | String | | | flightNumber | String | | | departureDate | String | | | departureTime | String | | | arrivalTime | String | | | errorDetails | JSONObject | Present if the ticket details could not be retrieved after booking | | code | String | | | message | String | | | paymentRetryRequest | JSONObject | Present when authorization fails or when FDS response is CHALLENGE or DENY | | request | JSONObject | Similar structure as appropriate request | | uri | String | The operation to be called | | isBookingDetailsRequired | Boolean | Whether booking details are to be filled in the request | | isPaymentDetailsRequired | Boolean | Whether payment details are to be filled in the request | | retryRequest | JSONObject | Present when a recoverable error occurs in any of the aggregated calls | | request | JSONObject | Same structure as the appropriate request objet | | uri | String | The operation to be called | ## Error Codes | ErrorCodes | Message | Description | | ---------- | ------------------------------------------------------------------------------------------ | -------------------------------- | | BKAGCO0002 | Missing or Invalid expected field: adultCount. Must be an integer more than 0 | | | BKAGCO0003 | Missing or Invalid expected field: childCount. Must be an integer more than or equal to 0 | | | BKAGCO0004 | Missing or Invalid expected field: infantCount. Must be an integer more than or equal to 0 | | | BKAGCO0016 | Missing or Invalid expected field: bookingDetails | | | BKAGCO0020 | Missing or Invalid expected field: sessionID | | | BKAGCO0021 | Missing or Invalid expected field: pageTicket | | | BKAGCO0039 | Missing or Invalid expected field: orderInfo | | | BKAGCO0040 | Missing or Invalid expected field: acsResponse | | | BKAGCO0041 | Missing or Invalid expected field: authorizeDetails | | | BKAGCO0042 | Missing or Invalid expected field: country. Expected 2-char input | | | BKAGCO0043 | Missing or Invalid expected field: passengerEmail | | | BKAGCO0044 | Missing or Invalid expected field: passengerPhoneNumber | | | BKAGCO0045 | Missing or Invalid expected field: adultFare | | | BKAGCO0046 | Missing or Invalid expected field: childFare | | | BKAGCO0047 | Missing or Invalid expected field: infantFare | | | BKAGCO0048 | Missing or Invalid expected field: cabinClassIndicator. Must be one of: F,J,S,Y | | | BKAGCO0050 | Missing or Invalid expected field: clientIPMACAddress | | | BKAGCO0051 | Missing or Invalid expected field: deviceFingerPrint | | | BKAGCO0052 | Missing or Invalid expected field: fareFamilyIndicator | | | BKAGCO0053 | Missing or Invalid expected field: departureAirportCode | | | BKAGCO0054 | Missing or Invalid expected field: arrivalAirportCode | | | BKAGCO0055 | Missing or Invalid expected field: hoursToFirstDep | | | BKAGCO0056 | Missing expected field: billingAddressInfo | | | BKAGCO0057 | Missing expected field: billingAddressCity | | | BKAGCO0058 | Missing expected field: billingAddressCountry | | | BKAGCO0060 | Missing expected field: billingAddress1 | | | BKAGCO0071 | Missing or Invalid expected field: amount | | | BKAGCO0072 | Unsupported airlineCode: ffpCode | | | BKAGCO0073 | Required field `ffpNumber` should be 10 digit numerical value | | | BKAGCO0076 | We are unable to proceed with the booking as we cannot guarantee unaccompanied minor service to or from other airlines' flights on singaporeair.com | | | BKAGCO0077 | Missing or Invalid expected field: departureDateTime. Expected format: yyyy-MM-dd HH:mm:ss | | | BKAGCO0078 | `ffpCode` field is mandatory if `frequentFlyerDetails` field is provided | | | BKAGCO0150 | The sessionID that you have provided has already expired. Please restart the booking flow. | | | BKAGCO0200 | The operation could not be completed at the current moment please try again | | | BKAGCO0300 | The requested booking could not be retrieved from our system | | | BKAGCO0301 | The amount and/or ccChargeAmount in the request did not match the actual fareAmount | | | 9999/9998 | Unknown error occurs. Please contact CSL team for details. | For all errors of unknown origin | | ErrorCodes | Message | Description | | ---------- | ------------------------------------------------------------------------ | ----------- | | BKAGCN0000 | Exception occurred while conducting 3ds authentication on the creditcard | | | BKAGCN0050 | Exception occurred while authorizing the payment | | | BKAGCN0051 | Authorization has been challenged. | | | BKAGCN0100 | Exception occurred while confirming the booking | | | BKAGCN0250 | Exception occurred while retrieving ticket information | ## JSON Samples ### Request ```json Request #1 { "clientUUID":"SQ-API-Booking-Aggregator", "bookingDetails":{ "travellerDetails": [ { "isLeadPassenger": "true", "lastName": "TRAN", "travellerID": "1", "identityDocumentList": [ { "dateOfBirth": "1989-02-03", "documentNumber": "J12345678", "documentType": "P", "firstName": "ONE", "lastName": "TEST", "gender": "M", "nationality": "IN", "issuingCountry": "SG", "addressDetails": { "address": "1, Upper Changi Road", "city": "Singapore", "state": "", "zipCode": "123456" } }, { "documentType": "USVisitor", "addressDetails": { "address": "12, SomeLane", "city": "San Francisco", "state": "CA", "zipCode": "12345", "countryCode": "US" } } ], "infantDetails": { "lastName": "TEST", "travellerID": "1", "identityDocumentList": [ { "dateOfBirth": "2019-02-01", "documentNumber": "E1234567", "documentType": "P", "firstName": "THREE", "lastName": "TEST", "gender": "M", "nationality": "IN", "issuingCountry": "SG" }, { "documentNumber": "1234523", "documentType": "R", "applicableCountry": "US" } ] } }, { "isLeadPassenger": "false", "lastName": "Xuka", "travellerID": "2", "identityDocumentList": [ { "dateOfBirth": "2013-01-01", "documentNumber": "T12345678", "documentType": "P", "expiryDate": "2023-01-01", "firstName": "TWO", "lastName": "Xuka", "gender": "F", "nationality": "IN", "issuingCountry": "SG" }, { "dateOfBirth": "2013-01-01", "documentNumber": "US2345678", "documentType": "C", "expiryDate": "2023-01-01", "firstName": "TWO", "lastName": "Xuka", "gender": "F", "nationality": "IN", "issuingCountry": "US" } ] } ], "paymentDetails":{ "payeeName":"Test", "accountNumber":"XXXXXXXXXX1111", "cardType":"DC", "expiryDate":"2022-01", "cvvNumber":"123", "isInsurancePresent":"false", "amount": "3659.00", "ccSurchargeAmount":"0" } }, "validate3dsDetails":{ "acsResponse":"" }, "authorizationDetails":{ "clientIPMACAddress":"103.6.106.251", "fareFamilyIndicator":"Y11SGO", "deviceFingerPrint":"0400R9HVeoYv1gsNf94lis1ztpOyIsTDqFChJAHInd4sUERyOzZNURJ+BXt80/lB3fnapM+cDQcZrLvBrqj59ySG++vh69vH9gMkzNoc05O2+mgIzzvOlBUh9qRTaDjmUTl26LEtcYEgIDXyxDKJBqBicdce1XPQj9MKuLyMF4+8TBhgO962GbSLFcqAPNKVwml2phH0W2k+wt/QtVCYANQUGUOCbnRzpX9SwTbkqlmBR5N+Yk9XXjom4y0AH2WgO40osBx6w1tx0mMZz7HtmSQrKuHt39bvxE86eVaYJEF00M2dmwpFJMf4g5eZXoMyDfiAGZGrC6XyI9GzOADrSTduJlSAFu7g0I1z9QmIvkwaq95fBcrrvhqNv+nKNB1rRJdRbvF8nEikqb77Y7flCLnn8u/0ZYV5FBk6y+u/4durVCfHQ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GK5ZOY6osDdKdGAcTHS1YG7QIlYePinmlZ4rxn1JCGkbcGZ1Tq4deCV9DchDoUQBmVOVZENjYAgoiMxxq0IURUjoXA+k9XRlIy/uRttl95u4BtfOeJHxOJA+bb1yEXhrW0HoaIpaR7PJ+NiFJzXFoJ5wJ+ku3tVf7ae", "billingAddressInfo":{ "billingAddress1":"1, BuildingName", "billingAddressCity":"Singapore", "billingAddressState":"", "billingAddressPostalCode":"123456", "billingAddressCountry":"SG" } }, "recordLocator":"KKS8QT", "orderInfo":"C1900107139", "sessionID":"JSESSIONID=c-HBnfgEPANUjR1kQj4872OC1XK9D1r9p_zdZZLk6ZmL5V6aExvK!1486754568!-1892816259", "pageTicket":"3" } ``` ### Response ```json { "status": "SUCCESS", "code": "200", "message": "Authorization has been challenged.", "clientUUID": "SQ-API-Booking-Aggregator", "validationResult": { "details": { "authenticationStatus": "AUTHENTICATION_SUCCESSFUL", "orderInfo": "C1900107139" } }, "authorizationResult": { "details": { "fraudStatusCode": "CHALLENGE", "orderInfo": "C1900107139" } }, "paymentRetryRequest": { "request": { "clientUUID": "KAYAK-SQ-API-Booking-Aggregator", "paymentDetails": { "currencyCode": "SGD", "amount": "3659.00" }, "sessionID": "JSESSIONID=c-HBnfgEPANUjR1kQj4872OC1XK9D1r9p_zdZZLk6ZmL5V6aExvK!1486754568!-1892816259", "pageTicket": "3", "resumeDetails": { "resumeIdentifier": "CHECK3DS", "recordLocator": "KKS8QT" } }, "uri": "/create", "isBookingDetailsRequired": false, "isPaymentDetailsRequired": true } } ```