Android BCBP parser
The BCBP parser reads IATA Bar Coded Boarding Pass data and returns the passenger, flight and other boarding-pass fields instead of only the raw barcode value. You can enable it explicitly with BCBP formatting. Automatic formatting also recognizes boarding passes, using a lightweight pre-check to avoid false positives. The parser reads the mandatory header and flight-leg data, the variable and security sections and the baggage-related fields. It also accepts common real-world irregularities, such as small padding errors, and still reports parse diagnostics.
Bar Coded Boarding Pass (BCBP) parser #
You can explicitly enable BCBP formatting with:
bkdView.config.getDecoderConfig().formattingType = Barkoder.FormattingType.BCBP;
You can also use the Automatic formatting mode, where BCBP barcodes can be automatically recognized and parsed.
When BCBP formatting is enabled and you scan a compatible barcode from a flight boarding pass, the result will contain additional structured BCBP data in results extras instead of only the raw barcode value.
This is useful when you need to extract information from a boarding pass, such as passenger, flight, journey, and other available boarding-pass fields.
BCBP result fields #
The parser reads IATA Bar Coded Boarding Pass (BCBP) data, up to version 8 of the standard (June 2020), and returns it as JSON in the result's extras. Fields marked "when available" appear only when the boarding pass carries them.
Core fields #
| Field | JSON type | Description |
|---|---|---|
Standard | string | The parsed standard: "IATA-BCBP". |
Success | string | Parsing status, "YES" when parsed. |
Licensed | string | Parser licensing status, "YES" when licensed. |
FormatCode | string | BCBP format code, such as "M". |
NumberOfLegs | integer | Number of flight legs on the boarding pass. |
PassengerName | object | The parsed and raw passenger name. |
PassengerName.Last | string | Surname or last-name component. |
PassengerName.First | string | First-name component. |
PassengerName.Raw | string | Raw passenger-name field, padding spaces kept. |
ElectronicTicketIndicator | string | Electronic-ticket indicator, such as "E". |
Legs | array of objects | The flight legs (fields below). |
ReferenceYear | integer | Reference year the parser used to resolve dates. |
Additional fields, when available #
| Field | JSON type | Description |
|---|---|---|
Version | string | BCBP format version, such as "5". |
VariableSectionBytes | integer | Byte count of the variable section. |
UniqueConditionalBytes | integer | Byte count of the unique conditional section. |
PassengerDescription | string | Encoded passenger-description code. |
SourceOfCheckIn | string | Encoded code of the check-in channel. |
SourceOfBoardingPassIssuance | string | Encoded code of the boarding-pass issuance channel. |
DateOfIssueOfBoardingPass | object | The raw and interpreted issue date. |
DateOfIssueOfBoardingPass.Raw | string | Raw encoded issue date, such as "7285". |
DateOfIssueOfBoardingPass.Year | integer | Full issue year, such as 2027. |
DateOfIssueOfBoardingPass.JulianDay | integer | Issue day of the year, such as 285. |
DocumentType | string | Encoded document-type code, such as "B". |
AirlineDesignatorOfBoardingPassIssuer | string | Airline designator of the boarding-pass issuer. |
Fields of each flight leg #
| Field | JSON type | Description |
|---|---|---|
Legs[].OperatingCarrierPnrCode | string | Operating carrier's booking reference (Passenger Name Record code). |
Legs[].FromCityAirportCode | string | Departure city or airport code. |
Legs[].ToCityAirportCode | string | Arrival city or airport code. |
Legs[].OperatingCarrierDesignator | string | Airline designator of the operating carrier. |
Legs[].FlightNumber | string | Flight number, leading zeros kept. |
Legs[].FlightDate | object | The raw flight date and its year. |
Legs[].FlightDate.JulianRaw | string | Raw flight day of the year, such as "286" or "006". |
Legs[].FlightDate.Year | integer | Full flight year. |
Legs[].CompartmentCode | string | Cabin or compartment code. |
Legs[].SeatNumber | string | Seat, such as "023C" or "28C". |
Legs[].CheckInSequenceNumber | string | Check-in sequence number; can be an empty string. |
Legs[].PassengerStatus | string | Encoded passenger-status code. |
Additional leg fields, when available #
| Field | JSON type | Description |
|---|---|---|
Legs[].AirlineNumericCode | string | Numeric airline code, as a string. |
Legs[].DocumentFormSerialNumber | string | Document form and serial number. |
Legs[].SelecteeIndicator | string | Encoded security-screening selectee indicator. |
Legs[].MarketingCarrierDesignator | string | Airline designator of the marketing carrier. |
Legs[].FrequentFlyerAirlineDesignator | string | Airline designator of the frequent-flyer program. |
Legs[].FrequentFlyerNumber | string | Frequent-flyer number. |
Legs[].AirlineIndividualUse | string | Airline-specific data, returned raw. |
When part of the data is not parsed #
| Field | JSON type | Description |
|---|---|---|
TrailingUnparsedData | string | Data at the end of the barcode that the parser did not turn into fields. |