action wheretocredit_post_api_1_0_calculate { label: "Calculates the number of miles earned for every frequent flyer program." provider: wheretocredit method: POST path: "/api/1.0/calculate" encoding: json input: { type: "array" description: "Collection of Itinerary to allow multiple frequent flyer mile or point calculations at once." items: { type: "object" required: ["segments"] properties: { baseFareUSD: { type: "number" format: "double" description: "Amount in USD that will be used to calculate revenue program mileage earning. This amount should generally include carrier imposed surcharges but exclude other taxes. Default is 0." } id: { type: "string" description: "Unique identifier for this itinerary that will be passed back to help correlate a result." } segments: { type: "array" description: "Every flight transfer or stopover should be considered a separate segment." items: { type: "object" required: ["bookingClass", "carrier", "destination", "origin"] properties: { bookingClass: { type: "string" description: "Single-letter booking class used to determine the earning rate for the flight segment." } carrier: { type: "string" description: "Two-letter IATA carrier code for the marketing airline. This is used to determine which earnings chart will be applied for this segment. \nNOTE: Frequent flyer programs based on operating carrier, including but not limited to Star Alliance carriers, cannot be reliably mapped to a booking class and will not be accurately reflected in this API." } departure: { type: "string" format: "date-time" description: "The date on the flight will depart from the origin to go to the destination. This is used to determine which earnings chart will be in effect at time of departure." } destination: { type: "string" description: "Three-letter IATA airport code to which the flight is going." } distance: { type: "number" format: "double" description: "The number of miles for this flight segment. Otherwise, distance is calculated using the great-circle distance between the origin and destination and may not match other data sources exactly." } flightNumber: { type: "integer" format: "int32" description: "The airline identifier for the flight segment, most commonly (but not always) a number and is used for earning charts that are restricted to specific flight numbers." } operatingCarrier: { type: "string" description: "Two-letter IATA carrier code for the operating airline. This value is only used when earning is based on marketing carrier but restricted to a specific operating carrier. Leaving this value blank will assume the flight is operated by the marketing carrier." } origin: { type: "string" description: "Three-letter IATA airport code from which the flight will depart." } } } } ticketingCarrier: { type: "string" description: "Two-letter IATA carrier code for the ticketing or plating airline. This is used for revenue programs (i.e. UA, DL, B6). Leaving this value blank will exclude revenue programs." } } } } output: { type: "array" items: { type: "object" properties: { errorMessage: { type: "string" description: "Error message if the API call was not successful." } success: { type: "boolean" description: "Indicates whether the API call was successful." } value: { type: "object" properties: { id: { type: "string" description: "Unique identifier provided for this itinerary." } totals: { type: "array" description: "Total miles earned for each frequent flyer program." items: { type: "object" properties: { airlines: { type: "array" description: "Two-letter IATA carrier codes that are associated with the frequent flyer program." items: { type: "string" } } id: { type: "string" description: "Unique identifier for the frequent flyer program. See Programs API." } name: { type: "string" description: "Frequent flyer program name. See Programs API." } revenueBased: { type: "boolean" description: "Indicates that the itinerary includes revenue-based miles earnings." } unpublished: { type: "boolean" description: "Indicates that the itinerary may be missing miles due to unpublished earning rates from the program." } value: { type: "integer" format: "int32" description: "Total redeemable miles or points earned for the frequent flyer program." } } } } } } } } } }