Introduction
API version
v2.4
Welcome to the 30K Milefy API documentation!
Offline documentation
Looking for an offline version? Simply print this page as PDF. (Yes, you can do that, and it’ll look great.)
What does the Milefy API do?
You can use it to:
- Calculate frequent flyer earnings (miles) for specific flights,
- Learn which flights are eligible for mileage upgrades to a higher cabin, e.g. from Economy to Business.
Milefy API is a REST service using HTTPS protocole and JSON to encode both request and response data.
Request headers
To enforce proper request encoding and its compression you should always set following headers:
Content-Type: application/json; charset=UTF-8
Content-Encoding: utf-8
Accept-Encoding: gzip
Authentication
Example of request authentication in C#
var bytes = Encoding.UTF8.GetBytes(
string.Format("{0}:{1}",
_configuration.UserName,
_configuration.Password)
);
var base64AutorizationData = Convert.ToBase64String(bytes);
var webRequest = WebRequest.Create(url);
webRequest.Method = httpVerb;
webRequest.ContentType = "application/json";
webRequest.Headers.Add(
HttpRequestHeader.AcceptEncoding, "gzip"
);
webRequest.Headers.Add(
HttpRequestHeader.ContentEncoding, "utf-8"
);
webRequest.Headers.Add(
HttpRequestHeader.Authorization,
string.Format("Basic {0}", base64AutorizationData)
);
We use SSL to transmit data from client to our service. You must authenticate client with HTTP Basic Authentication, which takes your login and password to form the request authentication header. This header must be sent with every request together with other headers.
Authorization header example
Authorization: Basic eW91cmxvZ2luOnlvdXJwYXNzd29yZA==
Error handling
We use HTTP status codes listed in Appendix: HTTP status codes to handle general errors.
We also use internal status codes listed in Appendix: Status codes to indicate if request has been processed successfully.
In addition to that, majority of our methods, return in response a collection of error[]
objects (e.g. CalculateMiles). These objects contain error codes listed in Appendix: Error codes as well as human-readable messages for debugging purposes.
Environments
Calculate method prepended with sample base service URL
GET https://milefyapi-client-xyz.30k.com/api/miles/programs
Testing
Used only for development and testing purposes. The Testing environment is usually slower than Live and may include less accurate results.
Live
You can switch to Live environment once your integration is verified by our team. Once that is done, you will receive the Live credentials. Accessing the Live environment ensures the best possible accuracy of calculation and performance.
Performance
Large flight result sets
When working with large flight result sets, it’s recommended to divide them into smaller batches and send them in simultaneous requests. When received, the multiple responses should then be remerged into a single result set. For example, instead of sending a single request containing a result set of 1,000 different flights, you can send 5 smaller requests simultaneously, each consisting of 200 flights.
All divided requests for the same result set are billed as only one request. In order to assure that, you only need to fulfill the following two conditions:
- All requests need to be send almost at the same time (we need to receive them within a frame of less than 30 seconds),
- The flights need to be split into chunks of 50-200 flights.
Mixed methods
The methods CalculateMixed and CalculateOneMixed are designed primarily for developer convenience, but they can have a slight impact on performance. To optimize your application for best performance, we recommend using the specific methods instead. For example, rather than using the CalculateMixed request to retrive frequent flyer earnings (miles) and upgrades, it’s advisable to use the two separate methods instead (CalculateMiles and CalculateUpgrades) and send two requests simultaneously. The two requests will be billed as a single one on also in this case.
Methods
Programs
The Programs method returns a list of all supported frequent flyer programs.
You can use the returned information in combination with any method that calculates frequent flyer miles or upgrades (for instance, the method CalculateMiles).
HTTP Request
GET /api/miles/programs
Request parameters
This method has no parameters.
Response structure
Sample response
{
"Success": true,
"Status":{
"Code": 0,
"Message": "OK"
},
"Value":[{
"pc": "UMP",
"pn": "United Airlines MileagePlus",
"hu": "https://www.united.com/web/en-US/apps/account/settings/pin/pinResolution2.aspx",
"su": "https://www.united.com/web/en-US/apps/account/enroll.aspx?sdl=sds&sdl=sd",
"al": 4,
"mtc":[{
"at": 1,
"atn": "Award Miles"
},{
"at": 2,
"atn": "Premier Qualifying Miles"
},{
"at": 3,
"atn": "Premier Qualifying Segments"
},{
"at": 5,
"atn": "Premier Qualifying Dollars"
}],
"tc":[{
"ta": 1,
"tn": "Member"
},{
"ta": 8,
"tn": "Premier Silver"
},{
"ta": 16,
"tn": "Premier Gold"
},{
"ta": 24,
"tn": "Premier Platinum"
},{
"ta": 32,
"tn": "Premier 1K"
}],
"arl": ["UA"]
},{
"pc": "MAS",
"pn": "Miles and Smiles",
"hu": "https://www4.thy.com/tkmiles/pinproblems.tk?lang=en",
"su": "https://www4.thy.com/tkmiles/membersignin.tk?lang=en",
"al": 4,
"mtc":[{
"at": 1,
"atn": "Redeemable Miles"
},{
"at": 2,
"atn": "Status miles"
}],
"tc":[{
"ta": 1,
"tn": "Classic"
},{
"ta": 8,
"tn": "Classic Plus"
},{
"ta": 16,
"tn": "Elite"
},{
"ta": 24,
"tn": "Elite Plus"
}],
"arl": ["TK"]
}]
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value[] | array | No | Contains list of frequent flyer programs. May be absent in case of error. |
Value[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value[].pn | string | Yes | Full name of a frequent flyer program. |
Value[].hu | string | No | URL to password recovery page on program’s website. Useful to help users remind their password. |
Value[].wu | string | No | URL to program’s website. |
Value[].su | string | No | URL to sign up page on program’s website. |
Value[].al | integer | Yes | Code of alliance defined in Appendix: Alliances. |
Value[].mtc[] | array | Yes | Collection of all accruals (types of miles) earned in this program. |
Value[].mtc[].at | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value[].mtc[].atn | string | Yes | Program-specific name of accrual (type of miles) intended for end-user interface usage. |
Value[].tc[] | array | Yes | Collection of all status tiers available in this program. |
Value[].tc[].ta | integer | Yes | Code of status tier as in Appendix: Status tiers. |
Value[].tc[].tn | string | Yes | Program-specific name of status tier intended for end-user interface usage. |
Value[].arl[] | array | Yes | Collection of IATA codes of both owning and affiliated airlines of this program. |
CalculateMiles
Sample request
{
"flts": [{
"fid": "SK1674-SK0503|SK0502-SK0679",
"pri": {
"cc": "USD",
"tp": 150.0,
"bf": 128.5
},
"lg":[{
"sg": [{
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
},{
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T12:05:00",
"fc": "A",
"fn": 503,
"dn":610
}]
},{
"segments":[{
"mac": "SK",
"oac": "SK",
"dac": "LHR",
"aac": "CPH",
"dd": "2016-07-16T09:50:00",
"fc": "A",
"fn": 502,
"dn": 610
},{
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "TXL",
"dd": "2016-07-16T15:05:00",
"fc": "A",
"fn": 679,
"dn": 213
}]
}]
},{
"fid": "SK1674-SK0505|SK0502-SK0679",
"pri": {
"cc": "USD",
"tp": 750.0,
"bf": 677.3
},
"lg": [{
"sg": [{
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
},{
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T14:50:00",
"fc": "A",
"fn": 505,
"dn": 610
}]
},{
"sg": [{
"mac": "SK",
"oac": "SK",
"dac": "LHR",
"aac": "CPH",
"dd": "2016-07-16T09:50:00",
"fc": "A",
"fn": 502,
"dn": 610
},{
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "TXL",
"dd": "2016-07-16T15:05:00",
"fc": "A",
"fn": 679,
"dn": 213
}]
}]
}],
"tgp": [{
"pc": "SEB",
"ut": 8
}],
"uid": "0000001internal"
}
The CalculateMiles method returns the eligible frequent flyer earnings (miles), as calculated, for all flights in a request.
You can specify frequent flyer programs to personalize the calculations in the response based on a user’s program memberships. If you don’t specify, the earnings will be calculated and returned according to the frequent flyer program of the marketing carrier of each flight. For example if marketing carrier is Delta, earnings will be returned for Delta SkyMiles program.
HTTP Request
POST /api/miles/calculate
Request parameters
Should be sent as the body of a request in JSON format.
Property | Value | Required | Description |
---|---|---|---|
flts[] | array | Yes | Collection of flights for which miles will be calculated. |
flts[].fid | string | Yes | Unique id of the flight used as a reference in API response |
flts[].lg[] | array | Yes | Collection of flight legs. Flight leg may contain a few flight segments separated by layovers. Round-trip flight consists of two flight legs. |
flts[].lg[].sg[] | array | Yes | Collection of flight segments. Flight segment is characterized by single takeoff and landing. |
flts[].lg[].sg[].mac | string | Yes | IATA code (two characters) of the marketing (selling) airline. |
flts[].lg[].sg[].oac | string | Yes | IATA code (two characters) of the operating (owning the aircraft) airline. |
flts[].lg[].sg[].dac | string | Yes | IATA code (three letters) of the departure airport. |
flts[].lg[].sg[].aac | string | Yes | IATA code (three letters) of the destination airport. |
flts[].lg[].sg[].dd | string | Yes | Date in ISO-8601 format e.g. MM/DD/YYYY , YYYY-MM-DD or YYYY-MM-DDThh:mm:ss . Time is not required. |
flts[].lg[].sg[].fc | string | Yes | Single letter code also known as booking code or Reservation Booking Designator (RBD). |
flts[].lg[].sg[].fn | string | Yes | Flight number without airline code prefix. In other words just digits e.g. 3861 . |
flts[].lg[].sg[].dn | integer | No | Flown distance in land miles rounded to whole mile. If absent, the shortest distance between two airports will be calculated instead. Recommended to ensure best accuracy. |
flts[].pri | object | No | Required to ensure correct calculations for revenue-based frequent flyer programs. Strongly recommended. |
flts[].pri.cc | string | Yes | ISO-4217 3-letter currency code |
flts[].pri.tp | double | Yes | Total fare price for entire flight including taxes, fees, surcharges etc. |
flts[].pri.bf | double | No | Base fare price. Recommended to ensure best accuracy for revenue-based frequent flyer programs. |
flts[].pri.tx | double | No | Total amount for all taxes. |
flts[].pri.cx | double | No | Total amount of surcharges imposed by the carrier. |
tgp[] | array | No | Collection of frequent flyer program objects for which you want to calculate miles. Used to personalize results based on user memberships. |
tgp[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. You can request list of programs with their codes using Programs method. |
tgp[].ut | integer | No | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. Used to personalize calculations for users holding special status tier in a program e.g. Silver Status. If not specified, default, basic status tier will be used. |
uid | string | No | Unique user id to link subsequent requests to the same person. Strongly recommended. |
Response structure
Sample response
{
"Success": true,
"Status": {
"Code": 0,
"Message": "OK"
},
"Value": {
"uid": "56cbd707-66de-4b94-a132-4a7650ed3c67",
"flts": [{
"fid": "SK1674-SK0503|SK0502-SK0679",
"aprg": [{
"pc": "SEB",
"ut": 8,
"mi": [{
"at": 1,
"val": 6000
},{
"at": 2,
"val": 6000
},{
"at": 3,
"val": 4
}]
}]
},{
"fid": "SK1674-SK0505|SK0502-SK0679",
"aprg": [{
"pc": "SEB",
"ut": 8,
"mi": [{
"at": 1,
"val": 6000
},{
"at": 2,
"val": 6000
},{
"at": 3,
"val": 4
}]
}]
}],
"prg": [{
"pc": "SEB"
}],
"err": []
}
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value | object | No | Contains frequent flyer earnings (miles) for specified (or default) pairs of frequent flyer program and status tier. May be absent in case of error. |
Value.uid | string | Yes | Unique id generated for every request. |
Value.flts[] | array | Yes | Collection of flights containing frequent flyer earnings. |
Value.flts[].fid | string | Yes | Unique id of the flight specified in request. |
Value.flts[].aprg[] | array | No | Collection of objects with frequent flyer earnings (miles) for particular frequent flyer program and its certain status tier. It reflects fact, that one flight can potentially earn miles to many programs. |
Value.flts[].aprg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.flts[].aprg[].ut | integer | Yes | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. By default only basic status tier is returned. |
Value.flts[].aprg[].mi[] | array | Yes | Collection of objects with frequent flyer earnings (miles). Each object contains earnings for different accrual (type of earned miles). |
Value.flts[].aprg[].mi[].at | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value.flts[].aprg[].mi[].val | double | Yes | Number of earned frequent flyer miles or points. In some cases it may be a decimal. |
Value.prg[] | array | Yes | Collection of basic information about frequent flyer programs used in response. For more detailed information and full list of programs, you need to use Programs method. Array may be empty if there were no programs earning to any of specified flights. |
Value.prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.err[] | array | Yes | Collection of error objects for specific flights (if any occured). |
Value.err[].fid | string | Yes | Unique id of the flight specified in request. |
Value.err[].ec | string | Yes | Error code indicating problem encountered when processing flight information in request. See all error codes listed in Appendix: Error codes. |
Value.err[].em | string | Yes | Human-readable message for debugging purposes. |
CalculateOneMiles
Sample request
{
"flt": {
"fid": "SK1674-SK0503|SK0502-SK0679",
"pri": {
"cc": "USD",
"tp": 128.5,
"bf": 128.5
},
"lg": [{
"sg": [{
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
}, {
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T12:05:00",
"fc": "A",
"fn": 503,
"dn": 610
}]
}, {
"sg": [{
"mac": "SK",
"oac": "SK",
"dac": "LHR",
"aac": "CPH",
"dd": "2016-07-16T09:50:00",
"fc": "A",
"fn": 502,
"dn": 610
}, {
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "TXL",
"dd": "2016-07-16T15:05:00",
"fc": "A",
"fn": 679,
"dn": 213
}]
}]
},
"uid": "Internal000001"
}
CalculateOneMiles method returns frequent flyer earnings (miles) for a single flight.
In contrast with CalculateMiles method, CalculateOneMiles returns list of all applicable frequent flyer programs and their status tiers.
HTTP Request
POST /api/miles/calculateone
Request parameters
Should be sent as the body of a request in JSON format.
Property | Value | Required | Description |
---|---|---|---|
flt | object | Yes | Flight for which miles will be calculated. |
flt.fid | string | Yes | Unique id of the flight used as a reference in API response |
flt.lg[] | array | Yes | Collection of flight legs. Flight leg may contain a few flight segments separated by layovers. Round-trip flight consists of two flight legs. |
flt.lg[].sg[] | array | Yes | Collection of flight segments. Flight segment is characterized by single takeoff and landing. |
flt.lg[].sg[].mac | string | Yes | IATA code (two characters) of the marketing (selling) airline. |
flt.lg[].sg[].oac | string | Yes | IATA code (two characters) of the operating (owning the aircraft) airline. |
flt.lg[].sg[].dac | string | Yes | IATA code (three letters) of the departure airport. |
flt.lg[].sg[].aac | string | Yes | IATA code (three letters) of the destination airport. |
flt.lg[].sg[].dd | string | Yes | Date in ISO-8601 format e.g. MM/DD/YYYY , YYYY-MM-DD or YYYY-MM-DDThh:mm:ss . Time is not required. |
flt.lg[].sg[].fc | string | Yes | Single letter code also known as booking code or Reservation Booking Designator (RBD). |
flt.lg[].sg[].fn | string | Yes | Flight number without airline code prefix. In other words just digits e.g. 3861 . |
flt.lg[].sg[].dn | integer | No | Flown distance in land miles rounded to whole mile. If absent, the shortest distance between two airports will be calculated instead. Recommended to ensure best accuracy. |
flt.pri | object | No | Required to ensure correct calculations for revenue-based frequent flyer programs. Strongly recommended. |
flt.pri.cc | string | Yes | ISO-4217 3-letter currency code |
flt.pri.tp | double | Yes | Total fare price for entire flight including taxes, fees, surcharges etc. |
flt.pri.bf | double | No | Base fare price. Recommended to ensure best accuracy for revenue-based frequent flyer programs. |
flt.pri.tx | double | No | Total amount for all taxes. |
flt.pri.cx | double | No | Total amount of surcharges imposed by the carrier. |
uid | string | No | Unique user id to link subsequent requests to the same person. Strongly recommended. |
Response structure
Sample response
{
"Success": true,
"Status": {
"Code": 0,
"Message": "OK"
},
"Value": {
"uid": "56cbd707-66de-4b94-a132-4a7650ed3c67",
"flts": [{
"fid": "SK1674-SK0503|SK0502-SK0679",
"aprg": [{
"pc": "SEB",
"ut": 1,
"mi": [{
"at": 1,
"val": 6000
},{
"at": 2,
"val": 6000
},{
"at": 3,
"val": 4
}]
},{
"pc": "SEB",
"ut": 8,
"mi": [{
"at": 1,
"val": 12000
},{
"at": 2,
"val": 12000
},{
"at": 3,
"val": 4
}]
},{
"pc": "ACA",
"ut": 1,
"mi": [{
"at": 1,
"val": 5000
},{
"at": 2,
"val": 5000
}]
}]
}],
"prg": [{
"pc": "SEB"
},{
"pc": "ACA"
}],
"err": []
}
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value | object | No | Contains frequent flyer earnings (miles) for specified (or default) pairs of frequent flyer program and status tier. May be absent in case of error. |
Value.uid | string | Yes | Unique id generated for every request. |
Value.flts[] | array | Yes | Collection of flights containing frequent flyer earnings. |
Value.flts[].fid | string | Yes | Unique id of the flight specified in request. |
Value.flts[].aprg[] | array | No | Collection of objects with frequent flyer earnings (miles) for particular frequent flyer program and its certain status tier. It reflects fact, that one flight can potentially earn miles to many programs. |
Value.flts[].aprg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.flts[].aprg[].ut | integer | Yes | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. By default only basic status tier is returned. |
Value.flts[].aprg[].mi[] | array | Yes | Collection of objects with frequent flyer earnings (miles). Each object contains earnings for different accrual (type of earned miles). |
Value.flts[].aprg[].mi[].at | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value.flts[].aprg[].mi[].val | double | Yes | Number of earned frequent flyer miles or points. In some cases it may be a decimal. |
Value.prg[] | array | Yes | Collection of basic information about frequent flyer programs used in response. For more detailed information and full list of programs, you need to use Programs method. Array may be empty if there were no programs earning to any of specified flights. |
Value.prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.err[] | array | Yes | Collection of error objects for specific flights (if any occured). |
Value.err[].fid | string | Yes | Unique id of the flight specified in request. |
Value.err[].ec | string | Yes | Error code indicating problem encountered when processing flight information in request. See all error codes listed in Appendix: Error codes. |
Value.err[].em | string | Yes | Human-readable message for debugging purposes. |
CalculateUpgrades
Sample request
{
"flts": [{
"fid": "SK1674-SK0503|SK0502-SK0679",
"pri": {
"cc": "USD",
"tp": 150.0,
"bf": 128.5,
"cx": 11.5,
"tx": 10
},
"lg":[{
"lid": "SK1674-SK0503",
"sg": [{
"sid": "SK1674",
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
},{
"sid": "SK0503",
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T12:05:00",
"fc": "A",
"fn": 503,
"dn":610
}]
},{
"lid": "SK0502-SK0679",
"sg": [{
"sid": "SK0502",
"mac": "SK",
"oac": "SK",
"dac": "LHR",
"aac": "CPH",
"dd": "2016-07-16T09:50:00",
"fc": "A",
"fn": 502,
"dn": 610
},{
"sid": "SK0679",
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "TXL",
"dd": "2016-07-16T15:05:00",
"fc": "A",
"fn": 679,
"dn": 213
}]
}]
}],
"prg": [{
"pc": "AKF",
"ut": 1
}],
"uid": "0000001internal"
}
The CalculateUpgrades method returns the eligibility for a cabin upgrade of flight segments and legs, e.g. from Economy to Business.
In order to retrieve the redemption cost (in redeeemable miles) of an upgrade, use the CalculateOneUpgrades method.
HTTP Request
POST /api/upgrades/calculate
Request parameters
Should be sent as the body of a request in JSON format.
Property | Value | Required | Description |
---|---|---|---|
flts[] | array | Yes | Collection of flights for which upgrade eligibility will be calculated. |
flts[].fid | string | Yes | Unique id of the flight used as a reference in API response. |
flts[].lg[] | array | Yes | Collection of flight legs. Flight leg may contain a few flight segments separated by layovers. Round-trip flight consists of two flight legs. |
flts[].lg[].lid | string | No | Unique id of the flight leg used as a reference in API response. Will be generated if absent. |
flts[].lg[].sg[] | array | Yes | Collection of flight segments. Flight segment is characterized by single takeoff and landing. |
flts[].lg[].sg[].sid | string | No | Unique id of the flight segment used as a reference in API response. Will be generated if absent. |
flts[].lg[].sg[].mac | string | Yes | IATA code (two characters) of the marketing (selling) airline. |
flts[].lg[].sg[].oac | string | Yes | IATA code (two characters) of the operating (owning the aircraft) airline. |
flts[].lg[].sg[].dac | string | Yes | IATA code (three letters) of the departure airport. |
flts[].lg[].sg[].aac | string | Yes | IATA code (three letters) of the destination airport. |
flts[].lg[].sg[].dd | string | Yes | Date in ISO-8601 format e.g. MM/DD/YYYY , YYYY-MM-DD or YYYY-MM-DDThh:mm:ss . Time is not required. |
flts[].lg[].sg[].fc | string | Yes | Single letter code also known as booking code or Reservation Booking Designator (RBD). |
flts[].lg[].sg[].fn | string | Yes | Flight number without airline code prefix. In other words just digits e.g. 3861 . |
flts[].lg[].sg[].dn | integer | No | Flown distance in land miles rounded to whole mile. If absent, the shortest distance between two airports will be calculated instead. Recommended to ensure best accuracy. |
flts[].pri | object | No | Required to ensure correct calculations for revenue-based frequent flyer programs. Strongly recommended. |
flts[].pri.cc | string | Yes | ISO-4217 3-letter currency code |
flts[].pri.tp | double | Yes | Total fare price for entire flight including taxes, fees, surcharges etc. |
flts[].pri.bf | double | No | Base fare price. Recommended to ensure best accuracy for revenue-based frequent flyer programs. |
flts[].pri.tx | double | No | Total amount for all taxes. |
flts[].pri.cx | double | No | Total amount of surcharges imposed by the carrier. |
prg[] | array | No | Collection of frequent flyer program objects for which you want to calculate upgrades eligibility. Used to personalize results based on user memberships. |
prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. You can request list of programs with their codes using Programs method. |
prg[].ut | integer | No | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. Used to personalize calculations for users holding special status tier in a program e.g. Silver Status. If not specified, default, basic status tier will be used. |
uid | string | No | Unique user id to link subsequent requests to the same person. Strongly recommended. |
Response structure
Sample response
{
"Success": true,
"Status": {
"Code": 0,
"Message": "OK"
},
"Value": {
"uid": "56cbd707-66de-4b94-a132-4a7650ed3c67",
"flts": [{
"fid": "SK1674-SK0503|SK0502-SK0679",
"aprg": [{
"pc": "AKF",
"ut": 1,
"upgro": [{
"utft": 48,
"upgrd": [{
"utrg": "SK1674-SK0503",
"ulegl": true
}]
}]
}]
}],
"prg": [{
"pc": "AKF"
}],
"err": []
}
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value | object | No | Contains cabin upgrade options for each specified flight and combinations of frequent flyer program and status tier pairs (if set in request). May be absent in case of error. |
Value.uid | string | Yes | Unique id generated for every request. |
Value.flts[] | array | Yes | Collection of flights containing upgrade eligibility information. |
Value.flts[].fid | string | Yes | Unique id of the flight specified in request. |
Value.flts[].aprg[] | array | No | Collection of objects with cabin upgrade options for particular frequent flyer program and its certain status tier. It reflects fact, that one flight leg or segment can potentially be upgraded with redeemable miles from different programs. |
Value.flts[].aprg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.flts[].aprg[].ut | integer | Yes | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. By default only basic status tier is returned. |
Value.flts[].aprg[].upgro[] | array | Yes | Collection of cabin upgrade options e.g. upgrade to Economy is one option, upgrade to Business is another. |
Value.flts[].aprg[].upgro[].utft | integer | Yes | Code of target fare type (cabin) as listed in Appendix: Fare families. |
Value.flts[].aprg[].upgro[].upgrd[] | array | Yes | Collection of upgrade objects for particular, eligible flight leg and/or segment. |
Value.flts[].aprg[].upgro[].upgrd[].utrg | string | Yes | Unique id of flight leg or segment specified in request (or generated if absent). Indicates which fragment of entire flight is eligible for an upgrade. |
Value.flts[].aprg[].upgro[].upgrd[].ulegl | boolean | Yes | True if utrg field relates to flight leg. False if it relates to flight segment. |
Value.prg[] | array | Yes | Collection of basic information about frequent flyer programs used in response. For more detailed information and full list of programs, you need to use Programs method. Array may be empty if there were no upgrade options available for any of specified flights. |
Value.prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.err[] | array | Yes | Collection of error objects for specific flights (if any occured). |
Value.err[].fid | string | Yes | Unique id of the flight specified in request. |
Value.err[].ec | string | Yes | Error code indicating problem encountered when processing flight information in request. See all error codes listed in Appendix: Error codes. |
Value.err[].em | string | Yes | Human-readable message for debugging purposes. |
CalculateOneUpgrades
Sample request
{
"flt": {
"fid": "SK1674-SK0503",
"pri": {
"cc": "USD",
"tp": 150.0,
"bf": 128.5,
"cx": 11.5,
"tx": 10
},
"lg":[{
"lid": "SK1674-SK0503",
"sg": [{
"sid": "SK1674",
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
},{
"sid": "SK0503",
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T12:05:00",
"fc": "A",
"fn": 503,
"dn":610
}]
}]
},
"uid": "0000001internal"
}
The CalculateOneUpgrades method returns the cost of the cabin upgrade (e.g. from Economy to Business) in redeemable miles. The cost will be returned either per segment or per leg, as applicable for each frequent flyer program.
In contrast with CalculateUpgrades method, CalculateOneUpgrades returns list of all applicable frequent flyer programs and their status tiers.
HTTP Request
POST /api/upgrades/calculateone
Request parameters
Should be sent as the body of a request in JSON format.
Property | Value | Required | Description |
---|---|---|---|
flt | object | Yes | Flight for which upgrade eligibility and cost will be calculated. |
flt.fid | string | Yes | Unique id of the flight used as a reference in API response. |
flt.lg[] | array | Yes | Collection of flight legs. Flight leg may contain a few flight segments separated by layovers. Round-trip flight consists of two flight legs. |
flt.lg[].lid | string | No | Unique id of the flight leg used as a reference in API response. Will be generated if absent. |
flt.lg[].sg[] | array | Yes | Collection of flight segments. Flight segment is characterized by single takeoff and landing. |
flt.lg[].sg[].sid | string | No | Unique id of the flight segment used as a reference in API response. Will be generated if absent. |
flt.lg[].sg[].mac | string | Yes | IATA code (two characters) of the marketing (selling) airline. |
flt.lg[].sg[].oac | string | Yes | IATA code (two characters) of the operating (owning the aircraft) airline. |
flt.lg[].sg[].dac | string | Yes | IATA code (three letters) of the departure airport. |
flt.lg[].sg[].aac | string | Yes | IATA code (three letters) of the destination airport. |
flt.lg[].sg[].dd | string | Yes | Date in ISO-8601 format e.g. MM/DD/YYYY , YYYY-MM-DD or YYYY-MM-DDThh:mm:ss . Time is not required. |
flt.lg[].sg[].fc | string | Yes | Single letter code also known as booking code or Reservation Booking Designator (RBD). |
flt.lg[].sg[].fn | string | Yes | Flight number without airline code prefix. In other words just digits e.g. 3861 . |
flt.lg[].sg[].dn | integer | No | Flown distance in land miles rounded to whole mile. If absent, the shortest distance between two airports will be calculated instead. Recommended to ensure best accuracy. |
flt.pri | object | No | Required to ensure correct calculations for revenue-based frequent flyer programs. Strongly recommended. |
flt.pri.cc | string | Yes | ISO-4217 3-letter currency code |
flt.pri.tp | double | Yes | Total fare price for entire flight including taxes, fees, surcharges etc. |
flt.pri.bf | double | No | Base fare price. Recommended to ensure best accuracy for revenue-based frequent flyer programs. |
flt.pri.tx | double | No | Total amount for all taxes. |
flt.pri.cx | double | No | Total amount of surcharges imposed by the carrier. |
uid | string | No | Unique user id to link subsequent requests to the same person. Strongly recommended. |
Response structure
Sample response
{
"Success": true,
"Status": {
"Code": 0,
"Message": "OK"
},
"Value": {
"uid": "56cbd707-66de-4b94-a132-4a7650ed3c67",
"flts": [{
"fid": "SK1674-SK0503",
"aprg": [{
"pc": "AKF",
"ut": 1,
"upgro": [{
"utft": 48,
"upgrc": 10000,
"upgrd": [{
"utrg": "SK1674-SK0503",
"ulegl": true,
"ucst": 10000
}]
}]
},{
"pc": "AKF",
"ut": 8,
"upgro": [{
"utft": 48,
"upgrc": 8000,
"upgrd": [{
"utrg": "SK1674-SK0503",
"ulegl": true,
"ucst": 8000
}]
}]
}]
}],
"prg": [{
"pc": "AKF"
}],
"err": []
}
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value | object | No | Contains cabin upgrade options for each specified flight and combinations of frequent flyer program and status tier pairs (if set in request). May be absent in case of error. |
Value.uid | string | Yes | Unique id generated for every request. |
Value.flts[] | array | Yes | Collection of flights containing frequent flyer earnings. |
Value.flts[].fid | string | Yes | Unique id of the flight specified in request. |
Value.flts[].aprg[] | array | No | Collection of objects with cabin upgrade options for particular frequent flyer program and its certain status tier. It reflects fact, that one flight leg or segment can potentially be upgraded with redeemable miles from different programs. |
Value.flts[].aprg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.flts[].aprg[].ut | integer | Yes | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. By default only basic status tier is returned. |
Value.flts[].aprg[].upgro[] | array | Yes | Collection of cabin upgrade options e.g. upgrade to Economy is one option, upgrade to Business is another. |
Value.flts[].aprg[].upgro[].utft | integer | Yes | Code of target fare type (cabin) as listed in Appendix: Fare families. |
Value.flts[].aprg[].upgro[].upgrc | integer | Yes | Cost of entire upgrade option in redeemable miles used in particular frequent flyer program. |
Value.flts[].aprg[].upgro[].upgrd[] | array | Yes | Collection of upgrade objects for particular, eligible flight leg and/or segment. |
Value.flts[].aprg[].upgro[].upgrd[].utrg | string | Yes | Unique id of flight leg or segment specified in request (or generated if absent). Indicates which fragment of entire flight is eligible for an upgrade. |
Value.flts[].aprg[].upgro[].upgrd[].ulegl | boolean | Yes | True if utrg field relates to flight leg. False if it relates to flight segment. |
Value.flts[].aprg[].upgro[].upgrd[].ucst | integer | Yes | Cost of single leg or segment upgrade in redeemable miles used in particular frequent flyer program. |
Value.prg[] | array | Yes | Collection of basic information about frequent flyer programs used in response. For more detailed information and full list of programs, you need to use Programs method. Array may be empty if there were no upgrade options available for any of specified flights. |
Value.programs[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.err[] | array | Yes | Collection of error objects for specific flights (if any occured). |
Value.err[].fid | string | Yes | Unique id of the flight specified in request. |
Value.err[].ec | string | Yes | Error code indicating problem encountered when processing flight information in request. See all error codes listed in Appendix: Error codes. |
Value.err[].em | string | Yes | Human-readable message for debugging purposes. |
CalculateMixed
Sample request
{
"earn": true,
"upgr": true,
"flts": [{
"fid": "SK1674-SK0503",
"pri": {
"cc": "USD",
"tp": 150.0,
"bf": 128.5,
"cx": 11.5,
"tx": 10
},
"lg":[{
"lid": "SK1674-SK0503",
"sg": [{
"sid": "SK1674",
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
},{
"sid": "SK0503",
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T12:05:00",
"fc": "A",
"fn": 503,
"dn":610
}]
}]
}],
"uid": "0000001internal"
}
The CalculateMixed method is a shorthand method that returns a subset of features, selectable between the frequent flyer earnings (miles) and cabin upgrades of all flights in a request.
You can specify frequent flyer programs to personalize the calculations in the response based on a user’s program memberships. If you don’t specify, the information will be calculated and returned according to the frequent flyer program of the marketing carrier of each flight. For example if marketing carrier is Delta, frequent flyer information will be returned for Delta SkyMiles program.
See CalculateMiles and CalculateUpgrades methods, which can be used separatelly for requesting the same information.
HTTP Request
POST /api/mixed/calculate
Request parameters
Should be sent as the body of a request in JSON format.
Property | Value | Required | Description |
---|---|---|---|
earn | boolean | No | True to calculate frequent flyer earnings (miles) for specified flights. Default: false . See CalculateMiles method. |
upgr | boolean | No | True to calculate upgrade eligibility for specified flights. Default: false . See CalculateUpgrades method. |
flts[] | array | Yes | Collection of flights for which frequent flyer information will be calculated. |
flts[].fid | string | Yes | Unique id of the flight used as a reference in API response |
flts[].lg[] | array | Yes | Collection of flight legs. Flight leg may contain a few flight segments separated by layovers. Round-trip flight consists of two flight legs. |
flts[].lg[].lid | string | No | Unique id of the flight leg used as a reference in API response. Will be generated if absent. |
flts[].lg[].sg[] | array | Yes | Collection of flight segments. Flight segment is characterized by single takeoff and landing. |
flts[].lg[].sg[].sid | string | No | Unique id of the flight segment used as a reference in API response. Will be generated if absent. |
flts[].lg[].sg[].mac | string | Yes | IATA code (two characters) of the marketing (selling) airline. |
flts[].lg[].sg[].oac | string | Yes | IATA code (two characters) of the operating (owning the aircraft) airline. |
flts[].lg[].sg[].dac | string | Yes | IATA code (three letters) of the departure airport. |
flts[].lg[].sg[].aac | string | Yes | IATA code (three letters) of the destination airport. |
flts[].lg[].sg[].dd | string | Yes | Date in ISO-8601 format e.g. MM/DD/YYYY , YYYY-MM-DD or YYYY-MM-DDThh:mm:ss . Time is not required. |
flts[].lg[].sg[].fc | string | Yes | Single letter code also known as booking code or Reservation Booking Designator (RBD). |
flts[].lg[].sg[].fn | string | Yes | Flight number without airline code prefix. In other words just digits e.g. 3861 . |
flts[].lg[].sg[].dn | integer | No | Flown distance in land miles rounded to whole mile. If absent, the shortest distance between two airports will be calculated instead. Recommended to ensure best accuracy. |
flts[].pri | object | No | Required to ensure correct calculations for revenue-based frequent flyer programs. Strongly recommended. |
flts[].pri.cc | string | Yes | ISO-4217 3-letter currency code |
flts[].pri.tp | double | Yes | Total fare price for entire flight including taxes, fees, surcharges etc. |
flts[].pri.bf | double | No | Base fare price. Recommended to ensure best accuracy for revenue-based frequent flyer programs. |
flts[].pri.tx | double | No | Total amount for all taxes. |
flts[].pri.cx | double | No | Total amount of surcharges imposed by the carrier. |
prg[] | array | No | Collection of frequent flyer program objects for which you want to calculate miles. Used to personalize results based on user memberships. |
prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. You can request list of programs with their codes using Programs method. |
prg[].ut | integer | No | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. Used to personalize calculations for users holding special status tier in a program e.g. Silver Status. If not specified, default, basic status tier will be used. |
uid | string | No | Unique user id to link subsequent requests to the same person. Strongly recommended. |
Response structure
Sample response
{
"Success": true,
"Status": {
"Code": 0,
"Message": "OK"
},
"Value": {
"uid": "56cbd707-66de-4b94-a132-4a7650ed3c67",
"flts": [{
"fid": "SK1674-SK0503",
"aprg": [{
"pc": "SEB",
"ut": 1,
"earn": {
"mi": [{
"at": 1,
"val": 5250
},{
"at": 2,
"val": 5250
},{
"at": 3,
"val": 2
}]
},
"upgr": {
"upgro": [{
"utft": 48,
"upgrd": [{
"utrg": "SK1674-SK0503",
"ulegl": true
}]
}]
}
}]
}],
"prg": [{
"pc": "SEB"
}],
"err": []
}
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value | object | No | Contains frequent flyer information for specified (or default) pairs of frequent flyer program and status tier. May be absent in case of error. |
Value.uid | string | Yes | Unique id generated for every request. |
Value.flts[] | array | Yes | Collection of flights containing frequent flyer information. |
Value.flts[].fid | string | Yes | Unique id of the flight specified in request. |
Value.flts[].aprg[] | array | No | Collection of objects with frequent flyer information for particular frequent flyer program and its certain status tier. |
Value.flts[].aprg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.flts[].aprg[].ut | integer | Yes | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. By default only basic status tier is returned. |
Value.flts[].aprg[].earn | object | No | Object containing frequent flyer earnings (miles). Absent if earn flag in request is false or not set. |
Value.flts[].aprg[].earn.mi[] | array | Yes | Collection of objects with frequent flyer earnings (miles). Each object contains earnings for different accrual (type of earned miles). |
Value.flts[].aprg[].earn.mi[].at | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value.flts[].aprg[].earn.mi[].val | double | Yes | Number of earned frequent flyer miles or points. In some cases it may be a decimal. |
Value.flts[].aprg[].upgr | object | No | Object containing eligibility of cabin upgrades. Absent if upgr flag in request is false or not set. |
Value.flts[].aprg[].upgr.upgro[] | array | Yes | Collection of cabin upgrade options e.g. upgrade to Economy is one option, upgrade to Business is another. |
Value.flts[].aprg[].upgr.upgro[].utft | integer | Yes | Code of target fare type (cabin) as listed in Appendix: Fare families. |
Value.flts[].aprg[].upgr.upgro[].upgrd[] | array | Yes | Collection of upgrade objects for particular, eligible flight leg and/or segment. |
Value.flts[].aprg[].upgr.upgro[].upgrd[].utrg | string | Yes | Unique id of flight leg or segment specified in request (or generated if absent). Indicates which fragment of entire flight is eligible for an upgrade. |
Value.flts[].aprg[].upgr.upgro[].upgrd[].ulegl | boolean | Yes | True if utrg field relates to flight leg. False if it relates to flight segment. |
Value.prg[] | array | Yes | Collection of basic information about frequent flyer programs used in response. For more detailed information and full list of programs, you need to use Programs method. Array may be empty if there were no programs earning to any of specified flights. |
Value.prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.err[] | array | Yes | Collection of error objects for specific flights (if any occured). |
Value.err[].fid | string | Yes | Unique id of the flight specified in request. |
Value.err[].ec | string | Yes | Error code indicating problem encountered when processing flight information in request. See all error codes listed in Appendix: Error codes. |
Value.err[].em | string | Yes | Human-readable message for debugging purposes. |
CalculateOneMixed
Sample request
{
"earn": true,
"upgr": true,
"flt": {
"fid": "SK1674-SK0503",
"pri": {
"cc": "USD",
"tp": 150.0,
"bf": 128.5,
"cx": 11.5,
"tx": 10
},
"lg":[{
"lid": "SK1674-SK0503",
"sg": [{
"sid": "SK1674",
"mac": "SK",
"oac": "SK",
"dac": "TXL",
"aac": "CPH",
"dd": "2016-07-02T09:35:00",
"fc": "A",
"fn": 1674,
"dn": 213
},{
"sid": "SK0503",
"mac": "SK",
"oac": "SK",
"dac": "CPH",
"aac": "LHR",
"dd": "2016-07-02T12:05:00",
"fc": "A",
"fn": 503,
"dn":610
}]
}]
},
"uid": "0000001internal"
}
The CalculateOneMixed method is a shorthand method that returns a subset of features, selectable between the frequent flyer earnings (miles) and cabin upgrades of a single flight.
In contrast with CalculateMixed method, CalculateOneMixed returns list of all applicable frequent flyer programs and their status tiers.
HTTP Request
POST /api/mixed/calculateone
Request parameters
Should be sent as the body of a request in JSON format.
Property | Value | Required | Description |
---|---|---|---|
earn | boolean | No | True to calculate frequent flyer earnings (miles) for specified flight. Default: false . See CalculateOneMiles method. |
upgr | boolean | No | True to calculate upgrade eligibility for specified flight. Default: false . See CalculateOneUpgrades method. |
flt | object | Yes | Flight for which frequent flyer information will be calculated. |
flt.fid | string | Yes | Unique id of the flight used as a reference in API response |
flt.lg[] | array | Yes | Collection of flight legs. Flight leg may contain a few flight segments separated by layovers. Round-trip flight consists of two flight legs. |
flt.lg[].lid | string | No | Unique id of the flight leg used as a reference in API response. Will be generated if absent. |
flt.lg[].sg[] | array | Yes | Collection of flight segments. Flight segment is characterized by single takeoff and landing. |
flt.lg[].sg[].sid | string | No | Unique id of the flight segment used as a reference in API response. Will be generated if absent. |
flt.lg[].sg[].mac | string | Yes | IATA code (two characters) of the marketing (selling) airline. |
flt.lg[].sg[].oac | string | Yes | IATA code (two characters) of the operating (owning the aircraft) airline. |
flt.lg[].sg[].dac | string | Yes | IATA code (three letters) of the departure airport. |
flt.lg[].sg[].aac | string | Yes | IATA code (three letters) of the destination airport. |
flt.lg[].sg[].dd | string | Yes | Date in ISO-8601 format e.g. MM/DD/YYYY , YYYY-MM-DD or YYYY-MM-DDThh:mm:ss . Time is not required. |
flt.lg[].sg[].fc | string | Yes | Single letter code also known as booking code or Reservation Booking Designator (RBD). |
flt.lg[].sg[].fn | string | Yes | Flight number without airline code prefix. In other words just digits e.g. 3861 . |
flt.lg[].sg[].dn | integer | No | Flown distance in land miles rounded to whole mile. If absent, the shortest distance between two airports will be calculated instead. Recommended to ensure best accuracy. |
flt.pri | object | No | Required to ensure correct calculations for revenue-based frequent flyer programs. Strongly recommended. |
flt.pri.cc | string | Yes | ISO-4217 3-letter currency code |
flt.pri.tp | double | Yes | Total fare price for entire flight including taxes, fees, surcharges etc. |
flt.pri.bf | double | No | Base fare price. Recommended to ensure best accuracy for revenue-based frequent flyer programs. |
flt.pri.tx | double | No | Total amount for all taxes. |
flt.pri.cx | double | No | Total amount of surcharges imposed by the carrier. |
uid | string | No | Unique user id to link subsequent requests to the same person. Strongly recommended. |
Response structure
Sample response
{
"Success": true,
"Status": {
"Code": 0,
"Message": "OK"
},
"Value": {
"uid": "56cbd707-66de-4b94-a132-4a7650ed3c67",
"flts": [{
"fid": "SK1674-SK0503",
"aprg": [{
"pc": "SEB",
"ut": 1,
"earn": {
"mi": [{
"at": 1,
"val": 5250
},{
"at": 2,
"val": 5250
},{
"at": 3,
"val": 2
}]
},
"upgr": {
"upgro": [{
"utft": 48,
"upgrc": 10000,
"upgrd": [{
"utrg": "SK1674-SK0503",
"ulegl": true,
"ucst": 10000
}]
}]
}
},{
"pc": "SEB",
"ut": 8,
"earn": {
"mi": [{
"at": 1,
"val": 7540
},{
"at": 2,
"val": 7540
},{
"at": 3,
"val": 2
}]
},
"upgr": {
"upgro": [{
"utft": 48,
"upgrc": 8000,
"upgrd": [{
"utrg": "SK1674-SK0503",
"ulegl": true,
"ucst": 8000
}]
}]
}
},{
"pc": "AKA",
"ut": 1,
"earn": {
"mi": [{
"at": 1,
"val": 4200
},{
"at": 3,
"val": 2
}]
}
}]
}],
"prg": [{
"pc": "SEB"
},{
"pc": "AKA"
}],
"err": []
}
}
Property | Value | Required | Description |
---|---|---|---|
Success | boolean | Yes | True if request has been executed successfully |
Status | object | Yes | Contains status of executed method |
Status.Code | integer | Yes | Response status code as in Appendix: Status codes. |
Status.Message | string | Yes | Human-readable message describing response status. |
Value | object | No | Contains frequent flyer information for specified (or default) pairs of frequent flyer program and status tier. May be absent in case of error. |
Value.uid | string | Yes | Unique id generated for every request. |
Value.flts[] | array | Yes | Collection of flights containing frequent flyer information. |
Value.flts[].fid | string | Yes | Unique id of the flight specified in request. |
Value.flts[].aprg[] | array | No | Collection of objects with frequent flyer information for particular frequent flyer program and its certain status tier. |
Value.flts[].aprg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.flts[].aprg[].ut | integer | Yes | Code of status tier for specified frequent flyer program as in Appendix: Status tiers. By default only basic status tier is returned. |
Value.flts[].aprg[].earn | object | No | Object containing frequent flyer earnings (miles). Absent if earn flag in request is false or not set. |
Value.flts[].aprg[].earn.mi[] | array | Yes | Collection of objects with frequent flyer earnings (miles). Each object contains earnings for different accrual (type of earned miles). |
Value.flts[].aprg[].earn.mi[].at | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value.flts[].aprg[].earn.mi[].val | double | Yes | Number of earned frequent flyer miles or points. In some cases it may be a decimal. |
Value.flts[].aprg[].upgr | object | No | Object containing eligibility of cabin upgrades. Absent if upgr flag in request is false or not set. |
Value.flts[].aprg[].upgr.upgro[] | array | Yes | Collection of cabin upgrade options e.g. upgrade to Economy is one option, upgrade to Business is another. |
Value.flts[].aprg[].upgr.upgro[].utft | integer | Yes | Code of target fare type (cabin) as listed in Appendix: Fare families. |
Value.flts[].aprg[].upgr.upgro[].upgrc | integer | Yes | Cost of entire upgrade option in redeemable miles used in particular frequent flyer program. |
Value.flts[].aprg[].upgr.upgro[].upgrd[] | array | Yes | Collection of upgrade objects for particular, eligible flight leg and/or segment. |
Value.flts[].aprg[].upgr.upgro[].upgrd[].utrg | string | Yes | Unique id of flight leg or segment specified in request (or generated if absent). Indicates which fragment of entire flight is eligible for an upgrade. |
Value.flts[].aprg[].upgr.upgro[].upgrd[].ulegl | boolean | Yes | True if utrg field relates to flight leg. False if it relates to flight segment. |
Value.flts[].aprg[].upgr.upgro[].upgrd[].ucst | integer | Yes | Cost of single leg or segment upgrade in redeemable miles used in particular frequent flyer program. |
Value.prg[] | array | Yes | Collection of basic information about frequent flyer programs used in response. For more detailed information and full list of programs, you need to use Programs method. Array may be empty if there were no programs earning to any of specified flights. |
Value.prg[].pc | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.err[] | array | Yes | Collection of error objects for specific flights (if any occured). |
Value.err[].fid | string | Yes | Unique id of the flight specified in request. |
Value.err[].ec | string | Yes | Error code indicating problem encountered when processing flight information in request. See all error codes listed in Appendix: Error codes. |
Value.err[].em | string | Yes | Human-readable message for debugging purposes. |
Appendices
Frequent flyer programs
A list of all supported frequent flyer programs and their respective codes used in the API.
You can always use the Programs method to retrieve an up to date list of all programs along together with any additional information, for example, status tier levels and their required thresholds.
Program code | Program name |
---|---|
AMB | Aegean Airlines Miles+Bonus |
LGC | Aer Lingus AerClub |
AFL | Aeroflot Bonus |
ARP | Aerolíneas Plus |
MCP | Aeromexico Club Premier |
ARD | Air Arabia Airewards |
ACA | Air Canada Altitude/Aeroplan |
ACP | Air China PhoenixMiles |
UXS | Air Europa SUMA |
AKF | Air France/KLM Flying Blue |
IFR | Air India Flying Returns |
NZA | Air New Zealand AirPoints |
UKV | Air Vistara Club Vistara |
AKB | AirAsia BIG Loyalty |
AMP | Alaska Airlines Mileage Plan |
AMM | Alitalia MilleMiglia |
AAA | American Airlines AAdvantage |
AMC | ANA Mileage Club |
ASC | Asiana Club |
ALM | Avianca LifeMiles |
BBL | Belavia Belarusian Airlines Belavia Leader |
BAC | British Airways Executive Club |
CXA | Cathay Pacific Marco Polo Club/AsiaMiles |
CDF | China Airlines Dynasty Flyer |
CEM | China Eastern Eastern Miles |
SPC | China Southern SkyPearl Club |
CCM | Copa Airlines ConnectMiles |
OKP | Czech Airlines OK Plus |
DSM | Delta SkyMiles |
MSP | EgyptAir Plus |
EAM | El Al Matmid |
EKS | Emirates Skywards |
ETS | Ethiopian Airlines ShebaMiles |
EYG | Etihad Airways Guest |
EWB | Eurowings Boomerang Club |
IML | EVA Air Inifinity MileageLands |
FPL | Finnair Plus |
FMF | Frontier Airlines Frontier Miles |
GFF | Garuda Indonesia GarudaMiles |
GOS | GOL Smiles |
FWC | Hainan Airlines Fortune Wings Club |
IBP | Iberia Plus |
JMB | JAL Mileage Bank |
JRP | Jeju Air Refresh Point |
JJP | Jet Airways JetPrivilege |
JTB | JetBlue TrueBlue |
KSP | Korean Air Skypass |
KOC | Kuwait Airways Oasis Club |
LAP | LATAM Pass Program |
LMM | Lufthansa Miles & More |
MHE | Malaysia Airlines Enrich |
MEA | Middle East Airlines Cedar Miles |
NRW | Norwegian Air Shuttle Norwegian Reward |
PMM | Philippine Airlines Mabuhay Miles |
QFF | Qantas Frequent Flyer |
QAP | Qatar Airways Privilege Club |
RJP | Royal Jordanian Royal Plus |
SPR | S7 Priority |
SEB | SAS EuroBonus |
SVA | Saudi Arabian Airlines Alfursan |
SKF | Singapore Airlines KrisFlyer |
SAV | South African Airways Voyager |
SFS | Spirit Airlines Free Spirit |
SAF | SriLankan Airlines FlySmiLes |
SCU | Sun Country Airlines Ufly Rewards |
TMF | LATAM Fidelidade |
TPV | TAP Miles&Go |
ROP | Thai Airways Royal Orchid Plus |
MAS | Turkish Airlines Miles&Smiles |
UMP | United Airlines MileagePlus |
GLP | Vietnam Airlines Lotusmiles |
VFC | Virgin Atlantic Flying Club |
VAV | Virgin Australia Velocity Frequent Flyer |
WSR | WestJet Rewards |
MFE | Xiamen Airlines Egret Club |
Status tiers
A list of abstract status tiers used in the API across all frequent flyer programs.
The actual names of status tiers tend to be branded and vary between programs (see the Programs method).
Tier code | Name for internal usage |
---|---|
0 | Unknown |
1 | Basic |
8 | Tier1 Silver |
16 | Tier2 Gold |
24 | Tier3 Platinum |
32 | Tier4 Diamond |
33 | Tier5 |
34 | Tier6 |
35 | Tier7 |
HTTP status codes
The most common HTTP status codes you may encounter in response.
HTTP status code | Name | Description |
---|---|---|
200 | OK | Operation completed without any critical errors |
400 | Bad Request | Request is invalid and can’t be processed |
500 | Internal Server Error | Error on server side aborting operation. If you encounter any, please contact our support to resolve the issue. |
Status codes
Codes used to ensure, that response was processed successfully.
Status code | Description |
---|---|
0 | Operation was successful. Always in conjunction with 200 HTTP status code. |
-1 | Operation finished with error while processing request. Always in conjunction with 400 or 500 HTTP status code. |
Accrual types
Also known as types of miles. You can retrieve program-specific names of these accrual types using the Programs method.
Accrual code | Accrual name |
---|---|
1 | Redeemable Miles (RDM). Redeemable miles are the most common ones. The only ones used to redeem for free flights or cabin upgrades. |
2 | Elite Qualifying Miles (EQM). Elite qualifying miles are collected to reach certain threshold needed for particular status tier in a program e.g. after collecting 50,000 EQM you become Silver member (you reached Silver status tier). |
3 | Elite Qualifying Segments (EQS). Elite qualifying segments have the same purpose as EQM, but are collected based on flown flight segments instead of distance. |
4 | Elite Qualifying Points (EQP). Elite qualifying points have the same purpose as EQM, but have earning different rules. |
5 | Elite Qualifying Dollars (EQD). Elite qualifying dollars have the same purpose as EQM, but they are related to purchased fare price, not neccessarily the flown distance. |
Error codes
Error codes returned in response to any calculate method, such as CalculateMiles.
Error code | Description |
---|---|
FLEMP | Flights collection is empty. |
FLIDE | The flightId field is not set for some flight(s). |
FLTPE | Flight doesn’t have total price specified in the price block. |
FLLGE | Legs are not set for some flight(s). |
FLSGE | Segments are not set for some flight(s). |
FLSGDAE | Departure airport code is either not set or has not been provided in IATA format. |
FLSGAAE | Arrival airport code is either not set or has not been provided in IATA format. |
FLSGMKE | Marketing airline code is either not set or has not been provided in IATA format. |
FLSGOPE | Operating airline code is either not set or has not been provided in IATA format. |
FLSGFCE | The fare code is not set for some flight(s). |
FLSGDDE | Departure date is either not populated or set in invalid format. |
FLSGFNE | The flight number is not set for some flight(s). |
PCUKNW | Unknown program code detected. |
PTUKNW | Unknown program status tier code detected. |
Airline alliances
A list of airline alliances with their respective codes used in, for instance, the Programs method.
Alliance code | Alliance name |
---|---|
0 | Unknown |
1 | Independent (does not belong to any alliance) |
2 | OneWorld |
3 | SkyTeam |
4 | StarAlliance |
Fare families
A list of fare families used in methods related to cabin upgrade, for instance, CalculateUpgrades.
Fare family code | Fare family name |
---|---|
0 | Unknown |
8 | Discount Economy |
16 | Economy |
24 | Full Economy |
32 | Premium Economy |
40 | Discount Business |
48 | Business |
52 | Premium Business |
56 | First |
64 | Premium First |
Release notes
Version 2.4
- Added new methods: CalculateUpgrades, CalculateOneUpgrades, CalculateMixed, CalculateOneMixed.