{
  "$id": "https://vendia.net/schemas/alliance-ticket-sharing/v1.0",
  "$schema": "https://json-schema.org/draft-07/schema#",
  "description": "A ticket data model with ACLs that allows alliance partners to share ticket data in real-time and with control",
  "properties": {
    "Ticket": {
      "items": {
        "properties": {
          "airlineCode": {
            "description": "The 2-letter code of the issuing airline",
            "pattern": "[A-Z]{2}",
            "type": "string"
          },
          "bookingAgentId": {
            "description": "A code identifying the booking agent, as determined by the issuing airline",
            "type": "string"
          },
          "commissions": {
            "description": "Commissions owed for the ticket",
            "items": {
              "properties": {
                "commissionType": {
                  "description": "A code indicating the type of commission applicable to the transaction and associated with the corresponding COMMISSION RATE or COMMISSION AMOUNT",
                  "enum": [
                    "XLP",
                    "NEW",
                    "OLD"
                  ],
                  "type": "string"
                },
                "rate": {
                  "description": "The decimal percentage claimed by the agent as eligible commission. The format for 10.5% commission would be 10.5.",
                  "type": "number"
                },
                "value": {
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "description": "The code that is equivalent to the currency associated with the amount",
                      "type": "string"
                    },
                    "precision": {
                      "description": "Number of digits",
                      "type": "number"
                    }
                  },
                  "required": [
                    "amount",
                    "currency",
                    "precision"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "coupons": {
            "description": "A list of coupons related to this transaction",
            "items": {
              "description": "Information related to a coupon",
              "properties": {
                "additionalServicesAttributeGroup": {
                  "description": "A value which specifies the high-level group applicable to the service at the coupon level",
                  "type": "string"
                },
                "baggage": {
                  "description": "The applicable free baggage allowance amount followed by kilos \u2018K\u2019 or pounds \u2018L\u2019, e.g. 20K or 44L. When the baggage allowance is based on pieces, the field shall contain \u2018PC\u2019 preceded by the number of pieces, e.g. 2PC. When the fare used does not permit any free baggage allowance, \u2018NO\u2019, \u2018NIL\u2019, or \u2018XX\u2019 shall be entered in the baggage allowance box",
                  "properties": {
                    "allowance": {
                      "description": "The applicable free baggage allowance amount followed by kilos \u2018K\u2019 or pounds \u2018L\u2019, e.g. 20K or 44L. When the baggage allowance is based on pieces, the field shall contain \u2018PC\u2019 preceded by the number of pieces, e.g. 2PC. When the fare used does not permit any free baggage allowance, \u2018NO\u2019, \u2018NIL\u2019, or \u2018XX\u2019 shall be entered in the baggage allowance box",
                      "type": "string"
                    },
                    "overAllowanceQualifier": {
                      "description": "The type of applicable excess baggage allowance",
                      "type": "string"
                    },
                    "quantity": {
                      "description": "The numeric value for baggage weight, pieces, or seats used for excess baggage.",
                      "type": "number"
                    },
                    "rate": {
                      "description": "The monetary value being charged for excess baggage per baggage allowance for the total number in excess",
                      "properties": {
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "description": "The code that is equivalent to the currency associated with the amount",
                          "minLength": 1,
                          "type": "string"
                        },
                        "precision": {
                          "description": "Number of digits",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "amount",
                        "currency",
                        "precision"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "classOfService": {
                  "description": "The class of service for the coupon",
                  "minLength": 1,
                  "type": "string"
                },
                "conjunctionCompanionTicketIndicator": {
                  "description": "Provides additional information about any relationship this ticket has with any preceding ticket(s) within a transaction",
                  "type": "string"
                },
                "couponNumber": {
                  "description": "The coupon number for the ticket, within the range 1 through 4",
                  "maximum": 4,
                  "minimum": 1,
                  "type": "integer"
                },
                "operatingAirlineDesignator": {
                  "description": "The two character designator identifying the Operating Carrier for each coupon as it was sold",
                  "minLength": 1,
                  "type": "string"
                },
                "remarks": {
                  "description": "Free text to provide further information related to the coupon",
                  "type": "string"
                },
                "soldAirlineDesignator": {
                  "description": "The two character designator identifying the Marketing Carrier for each coupon as it was sold",
                  "minLength": 1,
                  "type": "string"
                },
                "soldDestinationCityCode": {
                  "description": "The airport or city code for the point of disembarkation for each coupon as it was sold",
                  "minLength": 1,
                  "type": "string"
                },
                "soldFlightDepartureDateTime": {
                  "description": "The scheduled date of departure for the coupon as it was sold. The local flight departure time based on a 12 or 24-hour clock as it was sold on each coupon",
                  "format": "date-time",
                  "type": "string"
                },
                "soldFlightNumber": {
                  "description": "The Marketing Carrier's flight number for each coupon as it was sold",
                  "minLength": 1,
                  "type": "string"
                },
                "soldOriginCityCode": {
                  "description": "The airport or city code identifying the point of embarkation for each coupon as it was sold",
                  "minLength": 1,
                  "type": "string"
                },
                "soldReservationBookingDesignator": {
                  "description": "The Marketing Carrier's code used in reservations to identify a compartment on an aircraft and/or a special inventory control for the coupon as it was sold",
                  "type": "string"
                },
                "soldReservationStatusCode": {
                  "description": "The passenger\u2019s reservation status for each coupon at the time of ticket issuance",
                  "type": "string"
                },
                "stopoverCode": {
                  "description": "A code to indicate whether a point is a stopover or not in accordance with PTC Composite Resolution 012 where O or blank indicates a stopover is taken and X indicates no stopover is taken",
                  "maxLength": 1,
                  "minLength": 1,
                  "type": "string"
                },
                "ticketDesignator": {
                  "description": "A series of characters defining the entitlement of the passenger based on the fare charged",
                  "type": "string"
                },
                "ticketNumber": {
                  "description": "A unique ticket number, represented as a 3-digit airline code followed by a 4-digit form number followed by a 6-digit serial number",
                  "pattern": "[0-9]{13}",
                  "type": "string"
                },
                "ticketingDateOfIssue": {
                  "description": "The date a ticket was issued in the format YYYY-MM-DD",
                  "format": "date",
                  "type": "string"
                },
                "useIndicator": {
                  "description": "An indication of the status of each coupon in the ticket consisting of one indicator per possible coupon number (\u20181\u2019 through \u20184\u2019)",
                  "minLength": 1,
                  "type": "string"
                },
                "value": {
                  "description": "The value associated with a single coupon",
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "description": "The code that is equivalent to the currency associated with the amount",
                      "type": "string"
                    },
                    "precision": {
                      "description": "Number of digits",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "amount",
                    "currency",
                    "precision"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "ticketNumber",
                "ticketingDateOfIssue",
                "couponNumber",
                "value",
                "soldAirlineDesignator",
                "operatingAirlineDesignator",
                "soldFlightDepartureDateTime",
                "soldOriginCityCode",
                "soldDestinationCityCode",
                "soldFlightNumber",
                "classOfService"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "dateOfIssue": {
            "description": "The date and time this ticket was issued, in the format YYYY-MM-DD",
            "format": "date",
            "type": "string"
          },
          "fees": {
            "items": {
              "description": "Fees for the ticket",
              "properties": {
                "code": {
                  "description": "The various fee code reflected on traffic documents as published in the IATA Ticket Tax/Fee/Charge Box Service (\u201cTTBS\u201d)",
                  "enum": [
                    "AY",
                    "XF",
                    "CP",
                    "MF",
                    "OA",
                    "OB",
                    "OC",
                    "OD",
                    "YR",
                    "YQ"
                  ],
                  "type": "string"
                },
                "subCode": {
                  "description": "A secondary code that further qualifies the fee code",
                  "type": "string"
                },
                "value": {
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "description": "The code that is equivalent to the currency associated with the amount",
                      "type": "string"
                    },
                    "precision": {
                      "description": "Number of digits",
                      "type": "number"
                    }
                  },
                  "required": [
                    "amount",
                    "currency",
                    "precision"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "passenger": {
            "description": "Information about the passenger",
            "properties": {
              "dateOfBirth": {
                "description": "The date of birth of the passenger, in YYYY-MM-DD format",
                "format": "date",
                "type": "string"
              },
              "firstName": {
                "description": "Passenger's first name",
                "type": "string"
              },
              "frequentFlyerInformation": {
                "description": "Passenger's frequent flyer information",
                "properties": {
                  "airlineCode": {
                    "description": "The 2-letter code of the airline",
                    "pattern": "[A-Z]{2}",
                    "type": "string"
                  },
                  "frequentFlyerNumber": {
                    "description": "The  identifier assigned to the passenger by the airline",
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "lastName": {
                "description": "Passenger's last name",
                "type": "string"
              }
            },
            "type": "object"
          },
          "passengerNameRecordCode": {
            "description": "A unique passenger record, represented by a 6-digit alphanumeric value",
            "pattern": "[A-Z0-9]{6}",
            "type": "string"
          },
          "payments": {
            "items": {
              "properties": {
                "paymentType": {
                  "description": "The type of payment",
                  "enum": [
                    "CA",
                    "CC",
                    "EX",
                    "RF",
                    "TC"
                  ],
                  "type": "string"
                },
                "paymentValue": {
                  "description": "The monetary value of the payment",
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "description": "The code that is equivalent to the currency associated with the amount",
                      "type": "string"
                    },
                    "precision": {
                      "description": "Number of digits",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "amount",
                    "currency",
                    "precision"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "prices": {
            "properties": {
              "baseFareAmount": {
                "description": "The amount (excluding tax, fees, and commissions)",
                "properties": {
                  "amount": {
                    "type": "number"
                  },
                  "currency": {
                    "description": "The code that is equivalent to the currency associated with the amount",
                    "type": "string"
                  },
                  "precision": {
                    "description": "Number of digits",
                    "type": "integer"
                  }
                },
                "required": [
                  "amount",
                  "currency",
                  "precision"
                ],
                "type": "object"
              },
              "equivalentFarePaid": {
                "description": "The amount (excluding tax, fees, and commissions) converted into the currency of the country of payment when the published fare is in a currency other than of the country of payment",
                "properties": {
                  "amount": {
                    "type": "number"
                  },
                  "currency": {
                    "description": "The code that is equivalent to the currency associated with the amount",
                    "type": "string"
                  },
                  "precision": {
                    "description": "Number of digits",
                    "type": "integer"
                  }
                },
                "required": [
                  "amount",
                  "currency",
                  "precision"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "remarks": {
            "description": "Free text to provide further information related to the ticket",
            "type": "string"
          },
          "taxes": {
            "items": {
              "properties": {
                "code": {
                  "description": "The various tax or charge codes reflected on traffic documents as published in the IATA Ticket Tax/Fee/Charge Box Service (\u201cTTBS\u201d)",
                  "type": "string"
                },
                "subCode": {
                  "description": "A secondary code that further qualifies the tax code",
                  "type": "string"
                },
                "value": {
                  "description": "Taxes for the ticket",
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "description": "The code that is equivalent to the currency associated with the amount",
                      "type": "string"
                    },
                    "precision": {
                      "description": "Number of digits",
                      "type": "number"
                    }
                  },
                  "required": [
                    "amount",
                    "currency",
                    "precision"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "ticketDocumentInfo": {
            "properties": {
              "attributeGroup": {
                "description": "A value which specifies the high-level group applicable to the service at the coupon level.",
                "type": "string"
              },
              "attributeSubGroup": {
                "description": "A value which specifies the sub group (within the specified group) applicable to the service at the coupon level.",
                "type": "string"
              },
              "documentType": {
                "description": "The type of document being processed.",
                "enum": [
                  "ADMS",
                  "ACMS",
                  "EMDA",
                  "EMDS",
                  "MD50",
                  "NONT",
                  "RCSM",
                  "TAAD",
                  "TASF",
                  "TKTT"
                ],
                "type": "string"
              },
              "endorsementRestriction": {
                "description": "Remarks provided to ensure common understanding between passenger and carrier when a fare is restricted as to time of travel, period of validity, voluntary rerouting, or where any other restricting condition(s) are applicable that are not otherwise clearly evident from other entries.",
                "type": "string"
              },
              "fareBasis": {
                "description": "A series of characters defining the entitlement of the passenger, based on the fare charged",
                "minLength": 1,
                "type": "string"
              },
              "fareCalculationArea": {
                "description": "A repeatable field containing a string of data reflecting the fare construction applicable to the transaction and, when applicable, the breakdown for Passenger Facility Charges and U.S. Flight Segment Taxes.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "fareCalculationModeIndicator": {
                "description": "A code identifying how the ticket was priced.",
                "type": "string"
              },
              "fareCalculationPricingIndicator": {
                "description": "The identifier reflecting the method of pricing for this transaction sent with the fare calculation of the document.",
                "type": "string"
              },
              "internationalSaleIndicator": {
                "description": "Used for domestic or international sales differentiation.",
                "type": "boolean"
              },
              "primaryDocumentNumber": {
                "description": "A unique document number, represented as 4-digit form number followed by a 6-digit serial number",
                "pattern": "[0-9]{10}",
                "type": "string"
              }
            },
            "required": [
              "primaryDocumentNumber",
              "documentType",
              "fareBasis",
              "fareCalculationArea"
            ],
            "type": "object"
          },
          "ticketNumber": {
            "description": "A unique ticket number, represented as a 3-digit airline code followed by a 4-digit form number followed by a 6-digit serial number",
            "pattern": "[0-9]{13}",
            "type": "string"
          }
        },
        "required": [
          "passengerNameRecordCode",
          "airlineCode",
          "ticketNumber",
          "dateOfIssue",
          "passenger",
          "ticketDocumentInfo",
          "coupons",
          "payments",
          "prices",
          "taxes",
          "fees"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "title": "Alliance Partner Ticket Share",
  "type": "object",
  "x-vendia-acls": {
    "TicketAcl": {
      "type": "Ticket"
    }
  }
}