{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/awardsecrets-com/json-schema/awardsecrets-com-x402-paid-answer-schema.json",
  "title": "X402PaidAnswer",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/awardsecrets-com-openapi.yml#/components/schemas/X402PaidAnswer",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok"
      ]
    },
    "operation": {
      "type": "string"
    },
    "query": {
      "type": "object"
    },
    "result": {
      "$ref": "#/$defs/AnswerResult"
    },
    "charged": {
      "type": "boolean",
      "description": "false when the answer is a clarifying question (nothing collected)."
    },
    "payment": {
      "type": "object",
      "properties": {
        "transaction": {
          "type": "string"
        },
        "network": {
          "type": "string"
        },
        "payer": {
          "type": "string"
        },
        "amount": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "AnswerResult": {
      "type": "object",
      "properties": {
        "answer_status": {
          "type": "string",
          "enum": [
            "ok",
            "cabin_not_priced",
            "needs_clarification",
            "off_topic"
          ],
          "description": "ok: priced in the cabin asked for. cabin_not_priced: we don't price that cabin (premium economy); options are ECONOMY, offered as an alternative. needs_clarification / off_topic: answer is a question or a one-line reply. Only ok is charged."
        },
        "answer": {
          "type": "string",
          "description": "Ready-to-show markdown."
        },
        "availability_checked": {
          "type": "boolean",
          "const": false,
          "description": "Always false: award-chart prices, not a live seat check."
        },
        "requested_cabin": {
          "type": [
            "string",
            "null"
          ]
        },
        "priced_cabin": {
          "type": [
            "string",
            "null"
          ]
        },
        "cabin_note": {
          "type": [
            "string",
            "null"
          ]
        },
        "ranking": {
          "type": "string"
        },
        "fields": {
          "type": "object",
          "description": "How the question was read (airlines, origin, destination, cabin, points_held...)."
        },
        "points_assumed": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "The answer for one airline the traveller could fly.",
            "properties": {
              "airline": {
                "type": "string"
              },
              "airline_name": {
                "type": "string"
              },
              "origin": {
                "type": "string"
              },
              "destination": {
                "type": "string"
              },
              "cabin": {
                "type": "string",
                "description": "The cabin asked for."
              },
              "priced_cabin": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The cabin the miles are for. Differs from cabin when we don't price the cabin asked for; null when the airline has no such cabin (Scoot has no business or first class)."
              },
              "best": {
                "oneOf": [
                  {
                    "type": "object",
                    "description": "One way to book: a loyalty programme and what it costs in its miles.",
                    "properties": {
                      "programme": {
                        "type": "string"
                      },
                      "programme_name": {
                        "type": "string"
                      },
                      "miles": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "miles_one_way": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "round_trip": {
                        "type": "boolean"
                      },
                      "price_type": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "peak_miles": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "season_miles": {
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "price_state": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "fixed_chart",
                          "published_starting_price",
                          "off_peak",
                          "seasonal",
                          null
                        ],
                        "description": "What kind of number miles is. Only fixed_chart is the chart's price for any date; never present a starting or off-peak price as a quote."
                      },
                      "transfer_amounts_at": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Which price the transfer amounts are worked out on, when not the only one."
                      },
                      "chart_as_of": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "YYYY-MM-DD: the date we hold for this programme's chart: the date it took effect, or the date we read it from the programme's own pages."
                      },
                      "surcharge_level": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "surcharge_usd_approx": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "pricing_model": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "book_online": {
                        "type": "boolean"
                      },
                      "reachable_with_your_points": {
                        "type": "boolean"
                      },
                      "transfers": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": "string"
                            },
                            "from_name": {
                              "type": "string"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "card_transfer",
                                "own_programme",
                                "linked_account_move"
                              ],
                              "description": "linked_account_move: Avios moved between the traveller's own linked accounts (British Airways, Iberia, Aer Lingus, Qatar, Finnair); conditional, see condition."
                            },
                            "condition": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "When the path only works under a condition (linked accounts)."
                            },
                            "ratio": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "transfer_time": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "points_needed": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "bonus_pct": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "bonus_ends": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "YYYY-MM-DD; the bonus ends then."
                            }
                          },
                          "required": [
                            "from",
                            "kind"
                          ]
                        },
                        "description": "How the traveller's own points reach it: points already in a programme first, then card transfers."
                      },
                      "how_to_reach": {
                        "type": "string"
                      },
                      "caveats": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "where_to_book": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "programme",
                      "programme_name"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The best way: fewest points once taxes and surcharges count."
              },
              "others": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "One way to book: a loyalty programme and what it costs in its miles.",
                  "properties": {
                    "programme": {
                      "type": "string"
                    },
                    "programme_name": {
                      "type": "string"
                    },
                    "miles": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "miles_one_way": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "round_trip": {
                      "type": "boolean"
                    },
                    "price_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "peak_miles": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "season_miles": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "price_state": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "fixed_chart",
                        "published_starting_price",
                        "off_peak",
                        "seasonal",
                        null
                      ],
                      "description": "What kind of number miles is. Only fixed_chart is the chart's price for any date; never present a starting or off-peak price as a quote."
                    },
                    "transfer_amounts_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Which price the transfer amounts are worked out on, when not the only one."
                    },
                    "chart_as_of": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "YYYY-MM-DD: the date we hold for this programme's chart: the date it took effect, or the date we read it from the programme's own pages."
                    },
                    "surcharge_level": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "surcharge_usd_approx": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "pricing_model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "book_online": {
                      "type": "boolean"
                    },
                    "reachable_with_your_points": {
                      "type": "boolean"
                    },
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "from_name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "card_transfer",
                              "own_programme",
                              "linked_account_move"
                            ],
                            "description": "linked_account_move: Avios moved between the traveller's own linked accounts (British Airways, Iberia, Aer Lingus, Qatar, Finnair); conditional, see condition."
                          },
                          "condition": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the path only works under a condition (linked accounts)."
                          },
                          "ratio": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "transfer_time": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "points_needed": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "bonus_pct": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "bonus_ends": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "YYYY-MM-DD; the bonus ends then."
                          }
                        },
                        "required": [
                          "from",
                          "kind"
                        ]
                      },
                      "description": "How the traveller's own points reach it: points already in a programme first, then card transfers."
                    },
                    "how_to_reach": {
                      "type": "string"
                    },
                    "caveats": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "where_to_book": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "programme",
                    "programme_name"
                  ]
                }
              },
              "priced_by_date": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "programme": {
                      "type": "string"
                    },
                    "programme_name": {
                      "type": "string"
                    },
                    "where_to_book": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "programme"
                  ]
                },
                "description": "Programmes that price this flight by date: no fixed price."
              },
              "listed_not_ranked": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "programme": {
                      "type": "string"
                    },
                    "programme_name": {
                      "type": "string"
                    },
                    "where_to_book": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "programme"
                  ]
                },
                "description": "Programmes that book it but whose price we don't stand behind (e.g. British Airways Avios)."
              },
              "where_to_check": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "why_best": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "restriction_note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "error": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "connection": {
                "type": "string",
                "enum": [
                  "one_airline",
                  "change_of_airline",
                  "by_date",
                  "separate_awards"
                ],
                "description": "Only on a trip with a connection (no airline flies the route nonstop). one_airline: one airline all the way; change_of_airline: several airlines on ONE award (best is that award); by_date: only date-priced programmes book it; separate_awards: no programme books all of them on one award, so each flight is its own award (see separate)."
              },
              "airlines": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The airline of each flight, in order (with connection)."
              },
              "via": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The connecting airport(s)."
              },
              "flights": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "Each flight: from, to, airline, airline_name."
              },
              "separate": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "separate_awards only: each flight (from, to, airline) and its own best way (best)."
              },
              "total_miles_one_way": {
                "type": "integer",
                "description": "separate_awards only: the flights' best ways added up."
              },
              "seasonal": {
                "type": "boolean",
                "description": "A flight of this trip is seasonal."
              },
              "route_source": {
                "type": "string",
                "description": "Where the trip's flights come from: the airports' route listings (Wikipedia, secondary)."
              }
            },
            "required": [
              "airline",
              "cabin",
              "priced_cabin"
            ]
          }
        },
        "count_priced": {
          "type": "integer"
        },
        "basis": {
          "type": "string"
        }
      },
      "required": [
        "answer_status",
        "answer",
        "availability_checked",
        "requested_cabin",
        "priced_cabin",
        "options"
      ]
    }
  }
}