Retrieve Programme API Documentation
The Retrieve Programme endpoint enables a Partner to retrieve programmes supported by the Avios currency. The endpoint returns programme information as part of successful response.
The objectives of this service are:
- To retrieve the complete list of programmes supported by Avios currency.
- To retrieve a programme by specifying the programme identifier.
- To retrieve the list of programmes which belongs to provided location identifier.
- To retrieve the list of programmes by specifying a membership identifier, e.g. return the list of programmes associated with a membership.
For Partners attempting to simply return the details of one programme, the only URI parameter that is required is the programme-identifier.
For Partners that want all programmes associated with a certain area code, they can include the specific area code in the endpoint.
Partners that want to return a list of programmes associated with a certain member, they simply include the membership-identifier in the endpoint.
Business Context
A summary of the process flow is as follows:
- The Partner calls the Retrieve Membership endpoint to retrieve membership details.
- The details of the membership are returned along with additional links to retrieve associated programme information.
- Partner clicks the provided link to retrieve programme information.
- Retrieve Programme endpoint is called and the programme details are returned.
Important Technical Notes
- All enumerated values must be upper case.
Pre-conditions
- The partner must have a valid API key to access the Retrieve Programme API
Post-conditions
Success outcome: HTTP status code 200 is returned along with details of the programme.
Error outcome: An error is returned.
Service Details
URI Parameters
Making a call to the API using only programme-identifier:
'GET https://api.avios.com/{version}/programmes/{programme-identifier}?api_key={api_key}'
Example
https://api.avios.com/v1/programmes/ATRP?api_key=abcdefabcdefabcdefabcdef
Making a call to the API using location-identifier to narrow the search:
'GET https://api.avios.com/{version}/programmes?location-identifier={location-identifier}&api_key={api_key}'
Example
https://api.avios.com/test/v1/programmes?location-identifier=GB&api_key=Abcdefabcdefabcdefabcdef
Making a call to the API using only the membership-identifier:
'GET https://api.avios.com/{version}/programmes?membership-identifier={membership-identifier}&api_key={api_key}'
Example
https://api.avios.com/v1/programmes?membership-identifier=3081470000000000&api_key=Abcdefabcdefabcdefabcdef
Name | Data type | Description | Example |
---|---|---|---|
version Required | String | The version of the API which will be confirmed during the on-boarding process. Format: Alphanumeric | v1 |
programme-identifier Optional | String | The identifier for the loyalty programme for which detailed information needs to be fetched. Format: Alphabetic with max length: 20 | ATRP, BAEC |
location-identifier Optional | String | Represents the location (Country), the programmes for which have to be retrieved. API doesn’t validate if country code conforms with ISO 3166 standard. Format: Min length = 2 Max length = 2 ISO 3166 Country code | GB |
membership-identifier Optional | String | The 16-digit membership number starting with 308147. Format: Numeric only. Min length = 16 Max Length = 24 | 3081471234567891 |
api_key Required | String | The API key provided during the partner configuration which takes place as part of the partner on-boarding process. Format: Alphanumeric only. Min length= 24, Max length= 24 | abcdefabcdefabcdefabcdef |
Request Headers
Name | Data type | Description | Example |
---|---|---|---|
Accept Optional | String | The Accept request header is used to specify media types which are acceptable for the response. Currently this API only supports application/json Format: application/json | application/json |
X-Forwarded-For Optional | String | The IP address of the end customer. Format: Comma separated Valid IP addresses | 172.17.1.1, 172.17.1.2 |
Response Message Elements
The following are examples of successful responses from the Retrieve Programme API:
{
"name": "AVIOS AGL",
"_links": {
"self": {
"href": "https://api.avios.com/test/v1/programmes/ATRP"
{
"size": "2",
"programmes": [
{
"identifier": "ATRP",
A response from the API containing only a singular programme will have the following response elements:
Name | Data type | Description |
---|---|---|
name Present | String | The name of the loyalty programme. This element is present only when the retrieval of programme is based on programme identifier. Format: Alphabets with space Max length: 100 |
programmePartner Conditional | Complex Type | Represents the partner associated with the programme. This element is present only when the retrieval of programme is based on programme identifier. This element won’t be visible if programme isn’t associated with any partner. |
programmePartner. Present | Complex Type | Represents the organisation information of the partner. This element is present only when the retrieval of programme is based on programme identifier |
programmePartner. Present | String | Partner identifier Format: Alphanumeric with max length 20 |
programmePartner. Present | String | Partner organisation name Format: Alphanumeric with max length 100 |
links Present | Complex Type | Represents the HATEOAS link |
links. Present | Complex type | Contains the self-link, the complete request URL |
links. Present | String | Contains link to self. Format: Alphanumeric plus colon (:), forward slash (/), dash (-), underscore , question mark (?) or period (.) and ampersand (&) |
And for responses containing multiple programmes:
Name | Type | Description |
---|---|---|
programmes Present | Array of Complex Type | Represents the programme information. This element is present when all programmes are retrieved or programmes are retrieved based on location identifier and/or membership identifier. |
programmes. Conditional | String | The identifier of the loyalty programme. Possible values could be: (ATRP, BAEC). Won’t be visible if location identifier was not passed in request or there aren’t any programmes associated with that country or if membership identifier membership isn't associated with any programme. Format: Enumeration |
programmes. Conditional | String | The name of the loyalty programme. Won’t be visible if not existing location identifier was passed in request or there aren’t any programmes associated with that country or programme isn’t associated with membership identifier. Format: Alphabets with space. Max length: 100 |
programmes. Conditional | Complex Type | Represents the partner details associated with the programme. Won’t be visible if not existing location identifier was passed in request or there aren’t any programmes associated with that country or programme isn’t associated with membership identifier. |
programmes. Present | Complex Type | Represents the organisation information of the partner. |
programmes. Present | String | Partner identifier. Format: Alphanumeric. Max length: 20 |
programmes. Present | String | Partner organisation name. Format: Alphanumeric with with special symbol space ( ). Max length: 100 |
size Present | Integer | Present only when the retrieval of programmes is not based on programme identifier. This represents the number of programmes retrieved. Format: Numeric. Max length: 2 Max value: 99 |
links Present | Complex Type | Represents the HATEOAS link. |
links. Present | Complex Type | Contains the self-link, the complete request URL. |
links. Present | String | Contains the self-link. Format: Alphanumeric plus colon (:), forward slash (/), dash (-), underscore , question mark (?) or period (.) and ampersand (&) |
Exception Message Elements
The following is an example of an unsuccessful response from the Retrieve Programme API:
{
"code": "PROGRAMME_NOT_FOUND",
"businessMessage": "Programme Not Found",
"developerMessage": "Programme Not Found",
"developerLink": "https://developer.iagloyalty.com/docs"
Name | Data type | Description |
---|---|---|
code Present | String | Error code. E.g: PROGRAMME_NOT_FOUND Format: Alphabet plus underscore |
businessMessage Present | String | Error message to business. E.g.: Programme Not Found Format: Alphabets with space |
developerMessage Conditional | String | Error message specific to client developer Format: Alphabets with space |
developerLink Present | String | A URL link to a web page containing more detailed information about the error code.E.g. : https://developer.iagloyalty.com/docs Format: Alphabets plus colon (:), forward slash (/), dash (-), underscore , question mark (?) or period (.). |
childError Conditional | Array of complex type | Will only be present if an error has been detected and reported by the API. |
childError. Present | String | Error code. E.g: DATA_INVALID Format: Alphabet plus underscore |
childError. Conditional | String | Path of the node on which error occurred. Format: Alphabets plus period (.), forward slash (/), open bracket ( |
childError. Present | String | Error message to business. E.g: Data Invalid Format: Alphabets with space |
childError. Conditional | String | Error message specific to client developer. Format: Alphabets with space |
childError. Present | String | A URL link to a web page containing more detailed information about the error code. e.g.: https://developer.iagloyalty.com/docs Format: Alphabetic plus colon (:), forward slash (/), dash (-), underscore , question mark (?) or period (.). |
Error Codes
HTTP Status Code | Description |
---|---|
400 PROGRAMME_NOT_FOUND PROGRAMME_NOT_FOUND | Invalid Programme-Identifier length. |
400 REQUEST_INVALID DATA_INVALID | 'ProgrammeIdentifier' can't contain numbers or special characters. Invalid length for 'ProgrammeIdentifier'.Invalid length for 'MembershipIdentifier'.Invalid format (no spaces allowed in value for header). |
400 REQUEST_INVALID MEMBERSHIP_IDENTIFIER_INVALID | Invalid length for 'MembershipIdentifier' (max length is 24 characters).Invalid format for 'MembershipIdentifier' - can only contain numeric characters.Invalid 'MembershipIdentifier' with valid 'LocationIdentifier' for Retrieve Programme.Fraudulent membership number. |
400 REQUEST_INVALID METHOD_NOT_SUPPORTED | This method is not supported. |