Introduction
API version
v1.2
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:
- Sync user frequent flyer accounts to retrieve mileage balances,
- Manage a list synced of user frequent flyer memberships,
- 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:
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 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==
Credentials encryption
Example of user credentials encryption in C#
using (var aes = new AesManaged()){
var charArray = secret.ToCharArray();
var length = charArray.Length > 32 ? 32 : charArray.Length;
aes.Key = Encoding.UTF8.GetBytes(charArray, 0, length);
aes.Mode = CipherMode.ECB;
aes.Padding = PaddingMode.Zeros;
using (MemoryStream encryptionStream = new MemoryStream()){
using (CryptoStream encrypt = new CryptoStream(encryptionStream, aes.CreateEncryptor(), CryptoStreamMode.Write)){
byte[] cleanText = Encoding.UTF8.GetBytes(text);
encrypt.Write(cleanText, 0, cleanText.Length);
encrypt.FlushFinalBlock();
}
byte[] encryptedData = encryptionStream.ToArray();
string encryptedText = Convert.ToBase64String(encryptedData);
return encryptedText;
}
}
To ensure, that user credentials submitted to connect his frequent flyer membership(s) are protected from MITM attacks, we added another layer of security – AES encryption using secret key.
How to use credentials encryption?
- Request user credentials encryption key. (If you haven’t received it yet with API authentication credentials.)
- Make sure your request to CheckAccounts method includes
encrypted
property set totrue
for every submitted frequent flyer membership. - Encrypt user credentials (login, password, extra parameter) using AES algorithm in ECB cipher mode, 256-bit key size and zeros padding mode. See provided example in C#.
Version
Since version 1.2, we require the setting of an additional request header, which indicates which version of Wallet API you want to use. In case the header is absent, version 1.1 will be used by default (not recommended).
Version header example
X-Api-Version: v1.2
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. 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
{
"clientUserId": "0000001internal",
"memberships": [{
"login": "john-smith",
"password": "abc102938",
"programCode": "LMM"
},{
"login": "vgbobx899",
"password": "qwerty67@+",
"programCode": "MAS"
}],
"countryCode": "FR"
}
Depends on the context, the CheckAccounts method can be used to:
- Update and read user frequent flyer balances (accumulated miles),
- 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 |
---|---|---|---|
clientUserId | string | Yes | Unique id of a user specified by API consumer. Used to attach frequent flyer memberships to particular user. |
memberships[] | 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. |
memberships[].programCode | 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. |
memberships[].login | string | No | Login to user membership in frequent flyer program specified as programCode parameter. If absent, credentials already stored in user account will be used instead. |
memberships[].password | string | No | Password to user membership in frequent flyer program specified as programCode parameter. Required if login is set. |
memberships[].extraParam | 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. |
memberships[].encrypted | boolean | No | If set true, login , password and extraParam properties are expected to be encrypted using AES method with provided secret key. See Credentials encryption section. Strongly recommended to ensure best security. |
countryCode | 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": {
"uniqueId": "f29d2d66-3318-4756-af25-03f5908833b9",
"memberships": [{
"programCode": "MAS",
"membershipNumber": "488987875",
"membershipName": "John Smith",
"isManual": false,
"isConnected": true,
"expirationDate": "2017-12-31T00:00:00",
"updatedDate": "2015-12-31T00:00:00",
"currentBalances": [{
"metricCode": 1,
"value": 8098
},{
"metricCode": 2,
"value": 2816
}],
"tierName": "Elite",
"tierCode": 16,
"nextTierName": "Elite Plus",
"nextTierCode": 24,
"nextTierBalances": [{
"metricCode": 2,
"value": 80000
}],
"nextTierDisclaimer": [
"Qualification period: 12 consecutive months"
],
"nextTierGeography": []
},{
"programCode": "LMM",
"membershipNumber": "992002412488047",
"membershipName": "James Bond",
"isManual": true,
"isConnected": false,
"updatedDate": "2015-12-31T00:00:00",
"currentBalances": [{
"metricCode": 1,
"value": 3500
},{
"metricCode": 2,
"value": 2562
}],
"tierName": "Member",
"tierCode": 1,
"nextTierName": "Frequent Traveller",
"nextTierCode": 8,
"nextTierBalances": [{
"metricCode": 2,
"value": 35000
},{
"metricCode": 4,
"value": 0
}],
"nextTierDisclaimer": [
"Qualification period: January 1 to December 31"
],
"nextTierGeography": []
}],
"errors": []
}
}
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.uniqueId | string | Yes | Unique id for every request |
Value.memberships[] | array | Yes | Collection of frequent flyer membership objects associated with particular user. |
Value.memberships[].programCode | string | Yes | Code of frequent flyer program hosting user membership. See list of programs in Appendix: Frequent flyer programs. |
Value.memberships[].membershipNumber | string | No | Number of user frequent flyer membership. |
Value.memberships[].membershipName | string | No | Name of the user as saved in his frequent flyer membership account. |
Value.memberships[].isManual | boolean | Yes | Always set to false for the CheckAccounts response. |
Value.memberships[].isConnected | boolean | Yes | True if membership has been connected with user credentials. |
Value.memberships[].expirationDate | string | No | Expiration date of user redeemable miles encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss . |
Value.memberships[].updatedDate | string | Yes | Date when membership has been updated last time encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss . |
Value.memberships[].currentBalances[] | array | Yes | Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program. |
Value.memberships[].currentBalances[].metricCode | integer | Yes | Code of accrual type (type of miles) as in Appendix: Accrual types. |
Value.memberships[].currentBalances[].value | double | Yes | Number miles accumulated by the user. This can be a decimal value. |
Value.memberships[].tierName | string | Yes | Name of the status tier, that user currently holds. |
Value.memberships[].tierCode | integer | Yes | Code of the status tier, that user currently holds. See Appendix: Status tiers. |
Value.memberships[].nextTierName | string | Yes | Name of the status tier, that user is closest to reach. |
Value.memberships[].nextTierCode | integer | Yes | Code of the status tier, that user is closest to reach. If nextTierCode equals tierCode , then it means, that user needs to re-qualify to his current status first. See Appendix: Status tiers. |
Value.memberships[].nextTierBalances[] | array | Yes | Collection of objects containing thresholds required for next status tier. Often there are different thresholds for different accrual types. |
Value.memberships[].nextTierBalances[].metricCode | 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.memberships[].nextTierBalances[].value | double | Yes | Number of miles required for the next status tier. |
Value.memberships[].nextTierDisclaimer | array | No | Collection of conditions (strings), that need to be met by user in order to qualify for the next status tier. |
Value.memberships[].nextTierGeography | 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 nextTierBalances array. |
Value.memberships[].errors[] | array | No | Collection of error objects related to particular membership. |
Value.memberships[].errors[].code | string | Yes | Error code from Appendix: Error codes. |
Value.memberships[].errors[].message | string | Yes | Human-readable message for debugging purposes. |
Value.errors[] | array | No | Collection of error objects (if any occured). |
Value.errors[].code | string | Yes | Error code indicating problem encountered when processing request. See all error codes listed in Appendix: Error codes. |
Value.errors[].message | string | Yes | Human-readable message for debugging purposes. |
AccountsManualInput
Sample request
{
"clientUserId": "0000001internal",
"memberships": [{
"programCode": "LMM",
"membershipNumber": "123456789",
"membershipName": "John Smith",
"currentBalances": [{
"metricCode": 1,
"value": 5000
},{
"metricCode": 2,
"value": 600
},{
"metricCode": 3,
"value": 3
}],
"tierCode": 1,
"expirationDate": "2017-04-17"
},{
"programCode": "MAS",
"tierCode": 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 |
---|---|---|---|
clientUserId | string | Yes | Unique id of a user specified by API consumer. Used to attach frequent flyer memberships to particular user. |
memberships[] | 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. |
memberships[].programCode | 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. |
memberships[].membershipNumber | string | No | Number of user frequent flyer membership. |
memberships[].membershipName | string | No | Name of the user as saved in his frequent flyer membership account. |
memberships[].currentBalances[] | 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. |
memberships[].currentBalances[]. metricCode | integer | Yes | Code of accrual type (type of miles) as in Appendix: Accrual types. |
memberships[].currentBalances[]. value | double | Yes | Number miles accumulated by the user. |
memberships[].tierCode | 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. |
countryCode | 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": {
"uniqueId": "f29d2d66-3318-4756-af25-03f5908833b9",
"memberships": [{
"programCode": "MAS",
"membershipNumber": "488987875",
"membershipName": "John Smith",
"isManual": false,
"isConnected": true,
"expirationDate": "2017-12-31T00:00:00",
"updatedDate": "2015-12-31T00:00:00",
"currentBalances": [{
"metricCode": 1,
"value": 8098
},{
"metricCode": 2,
"value": 2816
}],
"tierName": "Elite",
"tierCode": 16,
"nextTierName": "Elite Plus",
"nextTierCode": 24,
"nextTierBalances": [{
"metricCode": 2,
"value": 80000
}],
"nextTierDisclaimer": [
"Qualification period: 12 consecutive months"
],
"nextTierGeography": []
},{
"programCode": "LMM",
"membershipNumber": "992002412488047",
"membershipName": "James Bond",
"isManual": true,
"isConnected": false,
"updatedDate": "2015-12-31T00:00:00",
"currentBalances": [{
"metricCode": 1,
"value": 3500
},{
"metricCode": 2,
"value": 2562
}],
"tierName": "Member",
"tierCode": 1,
"nextTierName": "Frequent Traveller",
"nextTierCode": 8,
"nextTierBalances": [{
"metricCode": 2,
"value": 35000
},{
"metricCode": 4,
"value": 0
}],
"nextTierDisclaimer": [
"Qualification period: January 1 to December 31"
],
"nextTierGeography": []
}],
"errors": []
}
}
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.uniqueId | string | Yes | Unique id for every request |
Value.memberships[] | array | Yes | Collection of frequent flyer membership objects associated with particular user. |
Value.memberships[].programCode | string | Yes | Code of frequent flyer program hosting user membership. See list of programs in Appendix: Frequent flyer programs. |
Value.memberships[].membershipNumber | string | No | Number of user frequent flyer membership. |
Value.memberships[].membershipName | string | No | Name of the user as saved in his frequent flyer membership account. |
Value.memberships[].isManual | boolean | Yes | Always set to true for AccountsManualInput method. |
Value.memberships[].isConnected | boolean | Yes | True if mileage balances are available. |
Value.memberships[].expirationDate | string | No | Expiration date of user redeemable miles encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss . |
Value.memberships[].updatedDate | string | Yes | Date when membership has been updated last time encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss . |
Value.memberships[].currentBalances[] | array | Yes | Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program. |
Value.memberships[].currentBalances[].metricCode | integer | Yes | Code of accrual type (type of miles) as in Appendix: Accrual types. |
Value.memberships[].currentBalances[].value | double | Yes | Number of accumulated miles. This can be a decimal value. |
Value.memberships[].tierName | string | Yes | Name of the status tier, that user currently holds. |
Value.memberships[].tierCode | integer | Yes | Code of the status tier, that user currently holds. See Appendix: Status tiers. |
Value.memberships[].nextTierName | string | Yes | Name of the status tier, that user is closest to reach. |
Value.memberships[].nextTierCode | integer | Yes | Code of the status tier, that user is closest to reach. If nextTierCode equals tierCode , then it means, that user needs to re-qualify to his current status first. See Appendix: Status tiers. |
Value.memberships[].nextTierBalances[] | array | Yes | Collection of objects containing thresholds required for next status tier. Often there are different thresholds for different accrual types. |
Value.memberships[].nextTierBalances[].metricCode | 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.memberships[].nextTierBalances[].value | double | Yes | Number of miles required for the next status tier. |
Value.memberships[].nextTierDisclaimer | array | No | Collection of conditions (strings), that need to be met by user in order to qualify for the next status tier. |
Value.memberships[].nextTierGeography | 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 nextTierBalances array. |
Value.memberships[].errors[] | array | No | Collection of error objects related to particular membership. |
Value.memberships[].errors[].code | string | Yes | Error code from Appendix: Error codes. |
Value.memberships[].errors[].message | string | Yes | Human-readable message for debugging purposes. |
Value.errors[] | array | No | Collection of error objects (if any occured). |
Value.errors[]. code | string | Yes | Error code indicating problem encountered when processing request. See all error codes listed in Appendix: Error codes. |
Value.errors[]. message | string | Yes | Human-readable message for debugging purposes. |
Memberships
Sample request
{
"clientUserId": "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 |
---|---|---|---|
clientUserId | string | Yes | Unique id of a user specified by API consumer. |
Response structure
Sample response
{
"Success": true,
"Status":{
"Code": 0,
"Message": "OK"
},
"Value": {
"uniqueId": "f29d2d66-3318-4756-af25-03f5908833b9",
"memberships": [{
"programCode": "MAS",
"membershipNumber": "488987875",
"membershipName": "John Smith",
"isManual": false,
"isConnected": true,
"expirationDate": "2017-12-31T00:00:00",
"updatedDate": "2015-12-31T00:00:00",
"currentBalances": [{
"metricCode": 1,
"value": 8098
},{
"metricCode": 2,
"value": 2816
}],
"tierName": "Elite",
"tierCode": 16,
"nextTierName": "Elite Plus",
"nextTierCode": 24,
"nextTierBalances": [{
"metricCode": 2,
"value": 80000
}],
"nextTierDisclaimer": [
"Qualification period: 12 consecutive months"
],
"nextTierGeography": []
},{
"programCode": "LMM",
"membershipNumber": "992002412488047",
"membershipName": "James Bond",
"isManual": true,
"isConnected": false,
"updatedDate": "2015-12-31T00:00:00",
"currentBalances": [{
"metricCode": 1,
"value": 3500
},{
"metricCode": 2,
"value": 2562
}],
"tierName": "Member",
"tierCode": 1,
"nextTierName": "Frequent Traveller",
"nextTierCode": 8,
"nextTierBalances": [{
"metricCode": 2,
"value": 35000
},{
"metricCode": 4,
"value": 0
}],
"nextTierDisclaimer": [
"Qualification period: January 1 to December 31"
],
"nextTierGeography": []
}],
"errors": []
}
}
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.uniqueId | string | Yes | Unique id for every request |
Value.memberships[] | array | Yes | Collection of frequent flyer membership objects associated with particular user. |
Value.memberships[].programCode | string | Yes | Code of frequent flyer program hosting user membership. See list of programs in Appendix: Frequent flyer programs. |
Value.memberships[].membershipNumber | string | No | Number of user frequent flyer membership. |
Value.memberships[].membershipName | string | No | Name of the user as saved in his frequent flyer membership account. |
Value.memberships[].isManual | boolean | Yes | True if membership has been added manually (without live connection with user membership account). See AccountsManualInput method. |
Value.memberships[].isConnected | boolean | Yes | True if membership has been connected with user credentials. |
Value.memberships[].expirationDate | string | No | Expiration date of user redeemable miles encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss . |
Value.memberships[].updatedDate | string | Yes | Date when membership has been updated last time encoded according to ISO-8601 standard: YYYY-MM-DDThh:mm:ss . |
Value.memberships[].currentBalances[] | array | Yes | Collection of objects containing user mileage balances for every accrual type (type of mile) supported by the frequent flyer program. |
Value.memberships[].currentBalances[].metricCode | integer | Yes | Code of accrual type (type of miles) as in Appendix: Accrual types. |
Value.memberships[].currentBalances[].value | double | Yes | Number miles accumulated by the user. This can be a decimal value. |
Value.memberships[].tierName | string | Yes | Name of the status tier, that user currently holds. |
Value.memberships[].tierCode | integer | Yes | Code of the status tier, that user currently holds. See Appendix: Status tiers. |
Value.memberships[].nextTierName | string | Yes | Name of the status tier, that user is closest to reach. |
Value.memberships[].nextTierCode | integer | Yes | Code of the status tier, that user is closest to reach. If nextTierCode equals tierCode , then it means, that user needs to re-qualify to his current status first. See Appendix: Status tiers. |
Value.memberships[].nextTierBalances[] | array | Yes | Collection of objects containing thresholds required for next status tier. Often there are different thresholds for different accrual types. |
Value.memberships[].nextTierBalances[].metricCode | 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.memberships[].nextTierBalances[].value | double | Yes | Number of miles required for the next status tier. |
Value.memberships[].nextTierDisclaimer | array | No | Collection of conditions (strings), that need to be met by user in order to qualify for the next status tier. |
Value.memberships[].nextTierGeography | 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 nextTierBalances array. |
Value.memberships[].errors[] | array | No | Collection of error objects related to particular membership. |
Value.memberships[].errors[].code | string | Yes | Error code from Appendix: Error codes. |
Value.memberships[].errors[].message | string | Yes | Human-readable message for debugging purposes. |
Value.errors[] | array | No | Collection of error objects (if any occured). |
Value.errors[]. code | string | Yes | Error code indicating problem encountered when processing request. See all error codes listed in Appendix: Error codes. |
Value.errors[]. message | string | Yes | Human-readable message for debugging purposes. |
DeleteMembership
Sample request
{
"clientUserId": "0000001internal",
"programCode": "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 |
---|---|---|---|
clientUserId | string | Yes | Unique id of a user specified by API consumer. |
programCode | 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": {
"uniqueId": "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.uniqueId | 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": {
"uniqueId": "5d5322df-e873-4665-9c36-ef5ba166a0e8",
"count": 48,
"providers": [{
"programCode": "ACA",
"login": "Aeroplan number",
"password": "Password/PIN",
"tiers": [{
"tierCode": "1",
"tierName": "Member",
"qualifyLevels": []
}, {
"tierCode": "8",
"tierName": "Altitude Prestige 25K",
"qualifyLevels": [{
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 25000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 3000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 25000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 1500
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 25
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 3000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 25
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 1500
}]
}]
}, {
"tierCode": "16",
"tierName": "Altitude Elite 35K",
"qualifyLevels": [{
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 35000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 4000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 35000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 2000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 35
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 4000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 35
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 2000
}]
}]
}, {
"tierCode": "24",
"tierName": "Altitude Elite 50K",
"qualifyLevels": [{
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 50000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 6000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 50000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 3000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 50
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 6000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 50
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 3000
}]
}]
}, {
"tierCode": "32",
"tierName": "Altitude Elite 75K",
"qualifyLevels": [{
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 75000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 9000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 75000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 4500
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 75
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 9000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 75
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 4500
}]
}]
}, {
"tierCode": "33",
"tierName": "Altitude Super Elite 100K",
"qualifyLevels": [{
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 100000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 20000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 100000
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 0
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 10000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": ["CA"],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 95
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 20000
}]
}, {
"login": "Qualification Period: January 1 to December 31",
"geography": [],
"thresholds": [{
"metricCode": "2",
"metricName": "Altitude Qualifying Miles",
"value": 0
}, {
"metricCode": "3",
"metricName": "Altitude Qualifying Segments",
"value": 95
}, {
"metricCode": "5",
"metricName": "Altitude Qualifying Dollars",
"value": 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.uniqueId | string | Yes | Unique id for every request. |
Value.count | integer | Yes | Number of returned frequent flyer programs. |
Value.providers[] | array | Yes | Collection of all supported frequent flyer programs. |
Value.providers.programCode | string | Yes | Frequent flyer program 3-letter code, that you can find in Appendix: Frequent flyer programs. |
Value.providers.login | 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.providers.password | 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.providers.extraParam | 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.providers.options[] | array | No | Collection of options for the input field with extraParam . 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.providers.options[].code | string | Yes | Code of extraParam option, that needs to be included in CheckAccounts request to properly authenticate the user. |
Value.providers.options[].value | string | Yes | Name of extraParam option intended to be displayed on end-user interface. |
Value.providers.tiers[] | array | Yes | Collection of status tier objects for the frequent flyer program. |
Value.providers.tiers[].tierCode | integer | Yes | Code of status tier as in Appendix: Status tiers. |
Value.providers.tiers[].tierName | string | Yes | Program-specific name of status tier intended for end-user interface usage. |
Value.providers.tiers[].qualifyLevels | array | No | Collection of status tier level objects with qualification options (conditions a member has to meet to qualify for particular status tier). |
Value.providers.tiers[].qualifyLevels. login | string | No | Conditions to qualify for particular status tier intended for end-user interface. |
Value.providers.tiers[].qualifyLevels. geography[] | 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.providers.tiers[].qualifyLevels. thresholds[] | 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.providers.tiers[].qualifyLevels.thresholds[]. metricCode | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value.providers.tiers[].qualifyLevels.thresholds[]. metricName | string | Yes | Program-specific name of accrual (type of miles) intended for end-user interface usage. |
Value.providers.tiers[].qualifyLevels.thresholds[]. value | double | Yes | Threshold required to qualify for particular status tier. |
Value.providers.tiers[].renewLevels | array | No | Collection of status tier level objects with renewal options (conditions a member has to meet to renew his status tier). |
Value.providers.tiers[].renewLevels. login | string | No | Conditions to re-qualify for particular status tier intended for end-user interface. |
Value.providers.tiers[].renewLevels. geography[] | 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.providers.tiers[].renewLevels. thresholds[] | 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.providers.tiers[].renewLevels.thresholds[]. metricCode | integer | Yes | Code of accrual (type of earned miles) as listed in Appendix: Accrual types. |
Value.providers.tiers[].renewLevels.thresholds[]. metricName | string | Yes | Program-specific name of accrual (type of miles) intended for end-user interface usage. |
Value.providers.tiers[].renewLevels.thresholds[]. value | double | Yes | Threshold required to re-qualify for particular status tier. |
Value.errors[] | 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.2
- Abbrivations in properties has been replaced with full names,
- Instead returning programs, that support automatic connection now Providers method returns all frequent flyer programs supported in API.
- Added user credentials encryption. See Credentials encryption section and CheckAccounts method.
Version 1.1
- Added AccountsManualInput and DeleteMembership methods,
- Modified CheckAccounts method with new required fields,
- Updated list of supported frequent flyer programs: AKB, ETC, MSP (see Appendix: Frequent flyer programs.