NAV Navbar
Logo
json

Introduction

API version

v1.1

Welcome to the 30K Wallet 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 Wallet API do?

You can use it to:

  1. Sync user frequent flyer accounts to retrieve mileage balances,
  2. Manage a list synced of user frequent flyer memberships,
  3. Get additional data about the user’s memberships, such as miles expiration dates or current status tier.

The Wallet API is a REST service using HTTPS protocole and JSON to encode both the request and response data.

Request headers

To enforce proper request encoding and compression, you should always set the following headers:

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 the client to our service. You must authenticate the client with HTTP Basic Authentication, which takes your login and password to form a request authentication header. This header must be included in 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 err[] objects (e.g. CheckAccounts).

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

The CheckAccounts method used to update (and read) user balances of accumulated frequent flyer miles is somewhat time-consuming (executes at least during a few seconds).

Here are common use cases addressing how to improve the performance:

Connecting user memberships

Assuming that you design a dashboard for your user to organize and track his frequent flyer memberships, you should allow him to sync (add) several memberships simultaneously. This way, you won’t force the user to wait during the syncing process before he can sync additional memberships.

Updating mileage balances

We recommend running the CheckAccounts method in the background to update user balances, e.g. as a scheduled CRON task. This way, your user doesn’t need to wait for his membership to be updated. The recommended frequency of an update is once a month and should only be executed for active users.

Reading mileage balances

Use the Memberships method to read user balances of accumulated frequent flyer miles. It is lightning-fast comparing with the CheckAccounts method because it uses cached data from the last CheckAccounts and AccountsManualInput response.

Methods

CheckAccounts

Sample request

{
  "uid": "0000001internal",
  "mbs": [{
    "lgn": "john-smith",
    "pwd": "abc102938",
    "pc": "LMM"
  },{
    "lgn": "vgbobx899",
    "pwd": "qwerty67@+",
    "pc": "MAS"
  }],
  "ucc": "FR"
}

Depends on the context, the CheckAccounts method can be used to:

  1. Update and read user frequent flyer balances (accumulated miles),
  2. Add or edit user frequent flyer memberships (programs).

Besides mileage balances, you can retrieve additional information about user memberships, such as the current status tier or miles expiration dates.

HTTP Request

POST /api/checkaccounts

Request parameters

Should be sent as the body of a request in JSON format.

Property Value Required Description
uid string Yes Unique id of a user specified by API consumer. Used to attach frequent flyer memberships to particular user.
mbs[] array No Collection of frequent flyer membership objects with their credentials to authenticate on behalf of a user. If absent, all memberships already connected to the user account will be used instead.
mbs[].lgn string No Login to user membership in frequent flyer program specified as pc parameter. If absent, credentials already stored in user account will be used instead.
mbs[].pwd string No Password to user membership in frequent flyer program specified as pc parameter. Required if lgn is set.
mbs[].pc string Yes Code of frequent flyer program, that user has membership in. See list of programs in Appendix: Frequent flyer programs. You can also retrieve all programs using Providers method.
mbs[].exp string No Additional parameter used to authenticate user (besides login and password) such as email or user surname. Use Providers method to get list of frequent flyer programs with parameters they require for user authentication.
ucc string No IATA code of the country of user’s residence. Used to properly calculate e.g. thresholds for the user next status tier, which frequently depend on user’s origin. Strongly recommended

Response structure

Sample response

{
  "Success": true,
  "Status":{
    "Code": 0,
    "Message": "OK"
  },
  "Value": {
    "uid": "f29d2d66-3318-4756-af25-03f5908833b9",
    "mbs": [{
      "pc": "MAS",
      "mnu": "488987875",
      "mna": "John Smith",
      "mnl": false,
      "lvc": true,
      "exd": "2017-12-31T00:00:00",
      "upd": "2015-12-31T00:00:00",
      "cmi": [{
        "at": 1,
        "val": 8098
      },{
        "at": 2,
        "val": 2816
      }],
      "ctn": "Elite",
      "ctc": 16,
      "ntn": "Elite Plus",
      "ntc": 24,
      "nmi": [{
        "at": 2,
        "val": 80000
      }],
      "ncd": [
        "Qualification period: 12 consecutive months"
      ],
      "ntg": []
    },{
      "pc": "LMM",
      "mnu": "992002412488047",
      "mna": "James Bond",
      "mnl": true,
      "lvc": false,
      "upd": "2015-12-31T00:00:00",
      "cmi": [{
        "at": 1,
        "val": 3500
      },{
        "at": 2,
        "val": 2562
      }],
      "ctn": "Member",
      "ctc": 1,
      "ntn": "Frequent Traveller",
      "ntc": 8,
      "nmi": [{
        "at": 2,
        "val": 35000
      },{
        "at": 4,
        "val": 0
      }],
      "ncd": [
        "Qualification period: January 1 to December 31"
      ],
      "ntg": []
    }],
    "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 Envelope object containig information about user memberships. If request contains error, it will be absent.
Value.uid string Yes Unique id for every request
Value.mbs[] array Yes Collection of frequent flyer membership objects associated with particular user.
Value.mbs[].pc string Yes Code of frequent flyer program hosting user membership. See list of programs in Appendix: Frequent flyer programs.
Value.mbs[].mnu string No Number of user frequent flyer membership.
Value.mbs[].mna string No Name of the user as saved in his frequent flyer membership account.
Value.mbs[].mnl boolean Yes Always set to false for the CheckAccounts response.
Value.mbs[].lvc boolean Yes True if membership has been connected with user credentials.
Value.mbs[].exd string No Expiration date of user redeemable miles encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss.
Value.mbs[].upd string Yes Date when membership has been updated last time encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss.
Value.mbs[].cmi[] array Yes Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program.
Value.mbs[].cmi[].at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types.
Value.mbs[].cmi[].val double Yes Number miles accumulated by the user. This can be a decimal value.
Value.mbs[].ctn string Yes Name of the status tier, that user currently holds.
Value.mbs[].ctc integer Yes Code of the status tier, that user currently holds. See Appendix: Status tiers.
Value.mbs[].ntn string Yes Name of the status tier, that user is closest to reach.
Value.mbs[].ntc integer Yes Code of the status tier, that user is closest to reach. If ntc equals ctc, then it means, that user needs to re-qualify to his current status first. See Appendix: Status tiers.
Value.mbs[].nmi[] array Yes Collection of objects containing thresholds required for next status tier. Often there are different thresholds for different accrual types.
Value.mbs[].nmi[].at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types. Note, that redeemable miles are not used to qualify for the status tier.
Value.mbs[].nmi[].val double Yes Number of miles required for the next status tier.
Value.mbs[].ncd array No Collection of conditions (strings), that need to be met by user in order to qualify for the next status tier.
Value.mbs[].ntg array No Collection of IATA country codes. Only members residing in these countries are eligible to qualify for next status tier based on thresholds specified in nmi array.
Value.mbs[].err[] array No Collection of error objects related to particular membership.
Value.mbs[].err[].ec string Yes Error code from Appendix: Error codes.
Value.mbs[].err[].em string Yes Human-readable message for debugging purposes.
Value.err[] array No Collection of error objects (if any occured).
Value.err[].ec string Yes Error code indicating problem encountered when processing request. See all error codes listed in Appendix: Error codes.
Value.err[].em string Yes Human-readable message for debugging purposes.

AccountsManualInput

Sample request

{
  "uid": "0000001internal",
  "mbs": [{
    "pc": "LMM",
    "mnu": "123456789",
    "mna": "John Smith",
    "cmi": [{
        "at": 1,
        "val": 5000
    },{
        "at": 2,
        "val": 600
    },{
        "at": 3,
        "val": 3
    }],
    "ctc": 1,
    "exd": "2017-04-17"
  },{
    "pc": "MAS",
    "ctc": 8
  }]
}

The AccountsManualInput method can be used to add or update user frequent flyer membership(s).

In contrast with the CheckAccounts method, the user membership information is not synced automatically with the frequent flyer account. Instead, user himself indicates the information manually, which then is passed on through the API.

This method can be utilized when automatic syncing via the CheckAccounts method is not available (applies for a a few frequent flyer programs). You can use the Providers method to get an up to date list of programs that we provide automatic syncing for.

The method can also be used when the user prefers not to sync his frequent flyer accounts using his credentials.

HTTP Request

POST /api/accountsmanual

Request parameters

Should be sent as the body of a request in JSON format.

Property Value Required Description
uid string Yes Unique id of a user specified by API consumer. Used to attach frequent flyer memberships to particular user.
mbs[] array No Collection of frequent flyer membership objects their credentials to authenticate on behalf of a user. If absent, all memberships already connected to the user account will be used instead.
mbs[].pc string Yes Code of frequent flyer program, that user has membership in. See list of programs in Appendix: Frequent flyer programs. You can also retrieve all programs using Providers method.
mbs[].mnu string No Number of user frequent flyer membership.
mbs[].mna string No Name of the user as saved in his frequent flyer membership account.
mbs[].cmi[] array No Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program. See Providers method.
mbs[].cmi[]. at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types.
mbs[].cmi[]. val double Yes Number miles accumulated by the user.
mbs[].ctc integer No Code of the status tier, that user currently holds. See Appendix: Status tiers. You can get the list of status tiers available for particular program using Providers method. If not set, basic status tier is assumed.
ucc string No IATA code of the country of user’s residence. Used to properly calculate e.g. thresholds for the user next status tier, which frequently depend on user’s origin. Strongly recommended

Response structure

Sample response

{
  "Success": true,
  "Status":{
    "Code": 0,
    "Message": "OK"
  },
  "Value": {
    "uid": "f29d2d66-3318-4756-af25-03f5908833b9",
    "mbs": [{
      "pc": "MAS",
      "mnu": "488987875",
      "mna": "John Smith",
      "mnl": false,
      "lvc": true,
      "exd": "2017-12-31T00:00:00",
      "upd": "2015-12-31T00:00:00",
      "cmi": [{
        "at": 1,
        "val": 8098
      },{
        "at": 2,
        "val": 2816
      }],
      "ctn": "Elite",
      "ctc": 16,
      "ntn": "Elite Plus",
      "ntc": 24,
      "nmi": [{
        "at": 2,
        "val": 80000
      }],
      "ncd": [
        "Qualification period: 12 consecutive months"
      ],
      "ntg": []
    },{
      "pc": "LMM",
      "mnu": "992002412488047",
      "mna": "James Bond",
      "mnl": true,
      "lvc": false,
      "upd": "2015-12-31T00:00:00",
      "cmi": [{
        "at": 1,
        "val": 3500
      },{
        "at": 2,
        "val": 2562
      }],
      "ctn": "Member",
      "ctc": 1,
      "ntn": "Frequent Traveller",
      "ntc": 8,
      "nmi": [{
        "at": 2,
        "val": 35000
      },{
        "at": 4,
        "val": 0
      }],
      "ncd": [
        "Qualification period: January 1 to December 31"
      ],
      "ntg": []
    }], 
    "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 Envelope object containig information about user memberships. If request contains error, it will be absent.
Value.uid string Yes Unique id for every request
Value.mbs[] array Yes Collection of frequent flyer membership objects associated with particular user.
Value.mbs[].pc string Yes Code of frequent flyer program hosting user membership. See list of programs in Appendix: Frequent flyer programs.
Value.mbs[].mnu string No Number of user frequent flyer membership.
Value.mbs[].mna string No Name of the user as saved in his frequent flyer membership account.
Value.mbs[].mnl boolean Yes Always set to true for AccountsManualInput method.
Value.mbs[].lvc boolean Yes True if mileage balances are available.
Value.mbs[].exd string No Expiration date of user redeemable miles encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss.
Value.mbs[].upd string Yes Date when membership has been updated last time encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss.
Value.mbs[].cmi[] array Yes Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program.
Value.mbs[].cmi[].at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types.
Value.mbs[].cmi[].val double Yes Number of accumulated miles. This can be a decimal value.
Value.mbs[].ctn string Yes Name of the status tier, that user currently holds.
Value.mbs[].ctc integer Yes Code of the status tier, that user currently holds. See Appendix: Status tiers.
Value.mbs[].ntn string Yes Name of the status tier, that user is closest to reach.
Value.mbs[].ntc integer Yes Code of the status tier, that user is closest to reach. If ntc equals ctc, then it means, that user needs to re-qualify to his current status first. See Appendix: Status tiers.
Value.mbs[].nmi[] array Yes Collection of objects containing thresholds required for next status tier. Often there are different thresholds for different accrual types.
Value.mbs[].nmi[].at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types. Note, that redeemable miles are not used to qualify for the status tier.
Value.mbs[].nmi[].val double Yes Number of miles required for the next status tier.
Value.mbs[].ncd array No Collection of conditions (strings), that need to be met by user in order to qualify for the next status tier.
Value.mbs[].ntg array No Collection of IATA country codes. Only members residing in these countries are eligible to qualify for next status tier based on thresholds specified in nmi array.
Value.mbs[].err[] array No Collection of error objects related to particular membership.
Value.mbs[].err[].ec string Yes Error code from Appendix: Error codes.
Value.mbs[].err[].em string Yes Human-readable message for debugging purposes.
Value.err[] array No Collection of error objects (if any occured).
Value.err[]. ec string Yes Error code indicating problem encountered when processing request. See all error codes listed in Appendix: Error codes.
Value.err[]. em string Yes Human-readable message for debugging purposes.

Memberships

Sample request

{
  "uid": "0000001internal"
}

The Memberships method can be used to retrieve frequent flyer memberships associated with a particular user.

HTTP Request

POST /api/memberships

Request parameters

Should be sent as the body of a request in JSON format.

Property Value Required Description
uid string Yes Unique id of a user specified by API consumer.

Response structure

Sample response

{
  "Success": true,
  "Status":{
    "Code": 0,
    "Message": "OK"
  },
  "Value": {
    "uid": "f29d2d66-3318-4756-af25-03f5908833b9",
    "mbs": [{
      "pc": "MAS",
      "mnu": "488987875",
      "mna": "John Smith",
      "mnl": false,
      "lvc": true,
      "exd": "2017-12-31T00:00:00",
      "upd": "2015-12-31T00:00:00",
      "cmi": [{
        "at": 1,
        "val": 8098
      },{
        "at": 2,
        "val": 2816
      }],
      "ctn": "Elite",
      "ctc": 16,
      "ntn": "Elite Plus",
      "ntc": 24,
      "nmi": [{
        "at": 2,
        "val": 80000
      }],
      "ncd": [
        "Qualification period: 12 consecutive months"
      ],
      "ntg": []
    },{
      "pc": "LMM",
      "mnu": "992002412488047",
      "mna": "James Bond",
      "mnl": true,
      "lvc": false,
      "upd": "2015-12-31T00:00:00",
      "cmi": [{
        "at": 1,
        "val": 3500
      },{
        "at": 2,
        "val": 2562
      }],
      "ctn": "Member",
      "ctc": 1,
      "ntn": "Frequent Traveller",
      "ntc": 8,
      "nmi": [{
        "at": 2,
        "val": 35000
      },{
        "at": 4,
        "val": 0
      }],
      "ncd": [
        "Qualification period: January 1 to December 31"
      ],
      "ntg": []
    }],
    "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 Envelope object containig information about user memberships. If request contains error, it will be absent.
Value.uid string Yes Unique id for every request
Value.mbs[] array Yes Collection of frequent flyer membership objects associated with particular user.
Value.mbs[].pc string Yes Code of frequent flyer program hosting user membership. See list of programs in Appendix: Frequent flyer programs.
Value.mbs[].mnu string No Number of user frequent flyer membership.
Value.mbs[].mna string No Name of the user as saved in his frequent flyer membership account.
Value.mbs[].mnl boolean Yes True if membership has been added manually (without live connection with user membership account). See AccountsManualInput method.
Value.mbs[].lvc boolean Yes True if membership has been connected with user credentials.
Value.mbs[].exd string No Expiration date of user redeemable miles encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss.
Value.mbs[].upd string Yes Date when membership has been updated last time encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss.
Value.mbs[].cmi[] array Yes Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program.
Value.mbs[].cmi[].at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types.
Value.mbs[].cmi[].val double Yes Number miles accumulated by the user. This can be a decimal value.
Value.mbs[].ctn string Yes Name of the status tier, that user currently holds.
Value.mbs[].ctc integer Yes Code of the status tier, that user currently holds. See Appendix: Status tiers.
Value.mbs[].ntn string Yes Name of the status tier, that user is closest to reach.
Value.mbs[].ntc integer Yes Code of the status tier, that user is closest to reach. If ntc equals ctc, then it means, that user needs to re-qualify to his current status first. See Appendix: Status tiers.
Value.mbs[].nmi[] array Yes Collection of objects containing thresholds required for next status tier. Often there are different thresholds for different accrual types.
Value.mbs[].nmi[].at integer Yes Code of accrual type (type of miles) as in Appendix: Accrual types. Note, that redeemable miles are not used to qualify for the status tier.
Value.mbs[].nmi[].val double Yes Number of miles required for the next status tier.
Value.mbs[].ncd array No Collection of conditions (strings), that need to be met by user in order to qualify for the next status tier.
Value.mbs[].ntg array No Collection of IATA country codes. Only members residing in these countries are eligible to qualify for next status tier based on thresholds specified in nmi array.
Value.mbs[].err[] array No Collection of error objects related to particular membership.
Value.mbs[].err[].ec string Yes Error code from Appendix: Error codes.
Value.mbs[].err[].em string Yes Human-readable message for debugging purposes.
Value.err[] array No Collection of error objects (if any occured).
Value.err[]. ec string Yes Error code indicating problem encountered when processing request. See all error codes listed in Appendix: Error codes.
Value.err[]. em string Yes Human-readable message for debugging purposes.

DeleteMembership

Sample request

{
  "uid": "0000001internal",
  "pc": "LMM"
}

The DeleteMembership method can be used to delete frequent flyer membership from the list of memberships associated with a particular user.

HTTP Request

DELETE /api/memberships

Request parameters

Should be sent as the body of a request in JSON format.

Property Value Required Description
uid string Yes Unique id of a user specified by API consumer.
pc string Yes Code of frequent flyer program, that user has membership in. See list of programs in Appendix: Frequent flyer programs. You can also retrieve all programs using Providers method.

Response structure

Sample response

{
  "Success": true,
  "Status":{
    "Code": 0,
    "Message": "OK"
  },
  "Value": {
    "uid": "f29d2d66-3318-4756-af25-03f5908833b9"
  }
}

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 Envelope object containig information about user memberships. If request contains error, it will be absent.
Value.uid string Yes Unique id for every request

Providers

The Providers method returns a list of all supported frequent flyer programs.

You can use the returned information to build a user dashboard (a mileage wallet), allowing him to manage his frequent flyer memberships from your website(s) or application(s).

HTTP Request

GET /api/providers

Request parameters

This method has no parameters.

Response structure

Sample response

{
    "Success": true,
    "Status": {
        "Code": 0,
        "Message": "OK"
    },
    "Value": {
        "uid": "5d5322df-e873-4665-9c36-ef5ba166a0e8",
        "tpc": 48,
        "pvd": [{
            "pc": "ACA",
            "lgn": "Aeroplan number",
            "pwd": "Password/PIN",
            "trs": [{
                "ta": "1",
                "tn": "Member",
                "ql": []
            }, {
                "ta": "8",
                "tn": "Altitude Prestige 25K",
                "ql": [{
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 25000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 3000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 25000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 1500
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 25
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 3000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 25
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 1500
                    }]
                }]
            }, {
                "ta": "16",
                "tn": "Altitude Elite 35K",
                "ql": [{
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 35000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 4000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 35000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 2000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 35
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 4000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 35
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 2000
                    }]
                }]
            }, {
                "ta": "24",
                "tn": "Altitude Elite 50K",
                "ql": [{
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 50000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 6000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 50000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 3000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 50
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 6000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 50
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 3000
                    }]
                }]
            }, {
                "ta": "32",
                "tn": "Altitude Elite 75K",
                "ql": [{
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 75000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 9000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 75000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 4500
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 75
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 9000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 75
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 4500
                    }]
                }]
            }, {
                "ta": "33",
                "tn": "Altitude Super Elite 100K",
                "ql": [{
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 100000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 20000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 100000
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 0
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 10000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": ["CA"],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 95
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 20000
                    }]
                }, {
                    "lgn": "Qualification Period: January 1 to December 31",
                    "geo": [],
                    "thr": [{
                        "at": "2",
                        "atn": "Altitude Qualifying Miles",
                        "val": 0
                    }, {
                        "at": "3",
                        "atn": "Altitude Qualifying Segments",
                        "val": 95
                    }, {
                        "at": "5",
                        "atn": "Altitude Qualifying Dollars",
                        "val": 10000
                    }]
                }]
            }]
        }]
    }
}

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 list of supported frequent flyer programs. May be absent in case of error.
Value.uid string Yes Unique id for every request.
Value.ptc integer Yes Number of returned frequent flyer programs.
Value.pvd[] array Yes Collection of all supported frequent flyer programs.
Value.pvd.pc string Yes Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs.
Value.pvd.lgn string No Title for a login input field designed for end-user interface. It reflects the fact, that different programs use different names for the login such as Member ID or Passenger username. May be absent if program doesn’t support automatic connection on behalf of a user (see AccountsManualInput).
Value.pvd.pwd string No Title for a password input field designed for end-user interface. It reflects the fact, that different programs use different names for the password such as PIN code or Member password. May be absent if program doesn’t support automatic connection on behalf of a user (see AccountsManualInput).
Value.pvd.ext string No Title for an extra authentication parameter input field designed for end-user interface e.g. Date of birth or Last name. May be absent if program doesn’t use extra parameter or program doesn’t support automatic connection on behalf of a user (see AccountsManualInput) at all.
Value.pvd.opt[] array No Collection of options for the input field with ext. It can be represented on end-user interface as a drop-down menu or group of radio buttons. Available only for some frequent flyer programs.
Value.pvd.opt[].cod string Yes Code of ext option, that needs to be included in CheckAccounts request to properly authenticate the user.
Value.pvd.opt[].val string Yes Name of ext option intended to be displayed on end-user interface.
Value.pvd.trs[] array Yes Collection of status tier objects for the frequent flyer program.
Value.pvd.trs[].ta integer Yes Code of status tier as in Appendix: Status tiers.
Value.pvd.trs[].tn string Yes Program-specific name of status tier intended for end-user interface usage.
Value.pvd.trs[].ql array No Collection of status tier level objects with qualification options (conditions a member has to meet to qualify for particular status tier).
Value.pvd.trs[].ql. lgn string No Conditions to qualify for particular status tier intended for end-user interface.
Value.pvd.trs[].ql. geo[] array No List of IATA country codes, that represent member residency. Only members residing in these countries are eligible to qualify for particular status tier on these conditions.
Value.pvd.trs[].ql. thr[] array Yes Collection of thresholds required to qualify for the particular status tier. There are different threshold for different accrual types (types of miles).
Value.pvd.trs[].ql.thr[]. at integer Yes Code of accrual (type of earned miles) as listed in Appendix: Accrual types.
Value.pvd.trs[].ql.thr[]. atn string Yes Program-specific name of accrual (type of miles) intended for end-user interface usage.
Value.pvd.trs[].ql.thr[]. val double Yes Threshold required to qualify for particular status tier.
Value.pvd.trs[].rl array No Collection of status tier level objects with renewal options (conditions a member has to meet to renew his status tier).
Value.pvd.trs[].rl. lgn string No Conditions to re-qualify for particular status tier intended for end-user interface.
Value.pvd.trs[].rl. geo[] array No List of IATA country codes, that represent member residency. Only members residing in these countries are eligible to re-qualify for particular status tier on these conditions.
Value.pvd.trs[].rl. thr[] array Yes Collection of thresholds required to re-qualify for the particular status tier. There are different threshold for different accrual types (types of miles).
Value.pvd.trs[].rl.thr[]. at integer Yes Code of accrual (type of earned miles) as listed in Appendix: Accrual types.
Value.pvd.trs[].rl.thr[]. atn string Yes Program-specific name of accrual (type of miles) intended for end-user interface usage.
Value.pvd.trs[].rl.thr[]. val double Yes Threshold required to re-qualify for particular status tier.
Value.err[] array No Collection of error objects (if any occured).

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 Providers method to retrieve an up to date list of all programs along with any additional information, like status tier levels and their required thresholds.

Program code Program name
ARP Aerolineas Plus
AMB Aegean Airlines Miles&Bonus
LGC Aer Lingus Gold Circle
AFL Aeroflot Bonus
MCP Aeromexico Club Premier
ARD Air Arabia Airewards
TPB Air Berlin topbonus
ACA Air Canada Altitude/Aeroplan
ACP Air China Phoenix Miles
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 Programme
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 AsiaMiles
CDF China Airlines Dynasty Flyer
CEM China Eastern Eastern Miles
SPC China Southern Sky Pearl Club
CCM Copa Airlines ConnectMiles
OKP Czech Airlines OK Plus
DSM Delta SkyMiles
MSP EgyptAir Plus
EAM El AllianceCode Matmid
EKS Emirates Skywards
ETS Ethiopian Airlines ShebaMiles
EYG Etihad Airways Guest
EWB Eurowings Boomerang Club
IML EVA Air Inifinity MileageLands
FPL Finnair Plus
GFF Garuda Frequent Flyer
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 LAN LANPass
LMM Lufthansa Miles & More
MHE Malaysia Airlines Enrich
MEA Middle East Airlines Cedar Miles
PMM Philippine Airlines Mabuhay Miles
QFF Qantas Frequent Flyer
QAP Qatar Airways Privilege Club
RJP Royal Jordanian Royal Plus
SPR S7 Priority Club
SEB SAS EuroBonus
SVA Saudi Arabian Airlines Alfursan
SKF Singapore Airlines KrisFlyer
SAV South African Airways Voyager
SAF SriLankan Airlines FlySmiLes
TMF TAM Fidelidade
TPV TAP Victoria
ROP Thai Airways Royal Orchid Plus
MAS Turkish Airlines Miles&Smiles
UMP United Airlines MileagePlus
GLP Vietnam Airlines Golden Lotus Plus
VAE Virgin America Elevate
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 Providers 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 Providers 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, cabin upgrades or other passenger benefits.
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
MBEMP Memberships collection is empty.
MBNCH Membership account could not be accessed.
MBNSP Loyalty program not supported.
MBINV Provided credentials are invalid.
MBLKD Membership account is locked.

Release notes

Version 1.1

  1. Added AccountsManualInput and DeleteMembership methods,
  2. Modified CheckAccounts method with new required fields,
  3. Updated list of supported frequent flyer programs: AKB, ETC, MSP (see Appendix: Frequent flyer programs.