Retrieve Transactions API Documentation
The Retrieve Transactions endpoint provides a partner with the ability to retrieve Avios transactions (credits and debits) for an identified member’s account. A partner consuming this service will be able to return either the most recent transactions, or a subset of any of the transactions for the account in question.
The Retrieve Transactions API requires the Partner to have generated an access token for the member prior to invocation. This access token must be included in any request message along with other data elements relating to the partner’s configuration. The remainder of this document describes the request and response messages, the correct use of the service and possible exceptions and error states that may present in the response.
Business Context
Here’s the process flow:
- An identified member, for whom the partner has a valid access token, initiates a journey in the partner application that requires the member’s Avios transaction data.
- The partner receives the member’s request and invokes the Retrieve Transactions endpoint, providing a request that contains the member’s access token, membership number and data elements that identify the partner.
- The Retrieve Transactions endpoint receives and processes the request, returning an appropriate response or error.
- Partner finalises processing of transactions, presenting these in an appropriate manner to the member.
- Member continues their journey in the partner application.
Technical Context
Important Technical Notes
- Request elements are not stored.
- All enumerated values must be upper case.
- Elements in the response message will always be returned in upper case ASCII.
- All query parameters must be supplied in lower case.
Pre-conditions
- An Access Token, generated at the point of Member login via Create Token endpoint must be supplied in the request when invoking this service.
- Partner needs a valid API key to access this endpoint.
Post-conditions
Success outcome: Transaction details are returned in the endpoint response message.
Error outcome: Service error is returned.
Service Details
URI Parameters
Production Endpoint:
'GET https://api.avios.com/{version}/programmes/{programme-identifier}/accounts/{account-identifier}/transactions?api_key={api_key}'
Example URI
https://api.avios.com/v1/programmes/ATRP/accounts/3081470000000000/transactions?api_key=abcdef
Name | 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 Required | String | The identifier for the loyalty programme to which the member belongs. This will have been provided to the member as part of the Loyalty Programme API partner on-boarding process along with your API key and Mashery credentials. Format: Currently restricted to ATRP. | ATRP |
account-identifier Required | Numeric | Unique Identifier of the member of the loyalty programme. Example: membership number Format: Min length = 1.Max Length = 24. Numeric only. | 3081470000000000 |
api_key Required | String | The partner API Key provided during initial partner configuration within Loyalty Programme systems as part of the standard partner on-boarding process. Format: Alphanumeric. Min length = 24. Max Length = 24. | abcdef |
Request Headers
Name | Type | Description | Example |
---|---|---|---|
Accept Optional | String | The Accept request-header field specifies certain media types, which are acceptable for the response. Format: Currently restricted to application/json | application/json |
Authorization Required | String | The Access Token returned from a successful Create Token API call. The Access Token is issued on a per Partner, per Member basis at the point of successful Member Identification. Format: JWT Token | |
X-Forwarded- For Optional | String | Identifies the originating IP address of a consumer. Format: IP address | 172.128.25.24 |
Request Elements
The following shows examples of request calls to the Retrieve Transactions endpoint:
Without Query Parameters:
https://api.avios.com/test/v1/programmes/ATRP/accounts/3081471017300186/transactions?api_key=xxx
With Range Filter:
https://api.avios.com/test/v1/programmes/ATRP/accounts/3081471017300186/transactions?api_key=xxx&start-record=1&end-record=10&date-made-from=2016-01-01&date-made-to=2016-09-01
With Range and match Filter:
https://api.avios.com/test/v1/programmes/ATRP/accounts/3081471017300186/transactions?api_key=xxx&start-record=1&end-record=10&date-made-from=2016-01-01&date-made-to=2016-09-02&external-source=Lloy
Name | Type | Description |
---|---|---|
start-record Optional | Integer | Index of the first item in the range of transactions returned in the service response. Filters from the latest transaction. Example: 1 Format: Numeric only. Max numeric value = 99999, min numeric value = 1. |
end-record Optional | Integer | Index of the last item in the range of transactions returned in the service response. Filters from the latest transaction. Example: 6 Format: Numeric only. Max numeric value = 99999, min numeric value = 1. |
date-made-from Optional | Date | The date of the first item in the range of transactions returned in the service response. Example: 2016-01-04 Format: format (YYYY-MM-DD) |
date-made-to Optional | Date | The date of the last item in the range of transactions returned in the service response. Won't include last day transactions. Example: 2016-02-02, transactions only till period 2016-02-01 23:59:59 will be returned. Format: format (YYYY-MM-DD) |
external-source Optional | String | The partner name related to the transaction. This is case insensitive. Currently doesn't filter by partner name. API returns all transactions and ignores value supplied. Format: String of max length 10 |
Response Elements
Example Response:
Without Query Parameters:
{
"transaction": [
{
"creditTransaction": {
"identifier": "6965162461003",
With Range Filter:
{
"transaction": [
{
"debitTransaction": {
"identifier": "395079D03F46027BE050A8C0020A62BD",
With range and match filter:
{
"transaction": [
{
"creditTransaction": {
"identifier": "6965162461003",
Name | Type | Description |
---|---|---|
transaction Conditional | Array of Complex type | A complex type that acts as a container for a number of credit transactions and debit transactions, which in turn express the results of the request including the applied filter parameters. Will not be present if member won’t contain any transactions or transactions are filtered out by the request elements. |
Transaction. Conditional | Array of Complex type | A complex type that represents a member’s debit transaction, there may be many of these returned within a single response. Will not be present if member won’t contain any debit transactions or transactions are filtered out by the request elements. API won’t return debit transaction details which debit amount exceeds value of 6 digits. E.g. if debit transaction amount is 1000000 it will not be returned. |
Transaction. Present | String | The unique identifier of the debit transaction within Avios systems. Format: Alphanumeric. Max length: 32 |
Transaction. Present | Date | The date that has been stored against the transaction. Example: 2016-10-20T10:23:23.000Z Format: YYYY-MM-DDThh:mm:ss.sTZD |
transaction. Present | String | A description of the debit transaction. Example: DESC ERI Format: Alphanumeric with special characters~!@#\$%^& |
transaction. Present | String | The Avios internal transaction reference related to this debit transaction. It is randomly generated by AVIOS system. Example: 14426D Format: Alphanumeric only. Max length: 10 |
transaction. Present | Complex type | A Complex Type, which represents the transaction amount. |
Transaction. Present | Big decimal | The transaction amount, in Avios, expressed as a numeric. Example: 1 Format: Numeric. Max length: 6 |
transaction. Present | String | The transaction amount formatted as specified by the currency code as a String value. Will contain only numbers. Format: Alphanumeric. Max length: 6 |
Transaction. Present | Complex type | A complex type, which represents the specific currency of a transaction. |
Transaction. Present | String | Loyalty programme currency identifier. At present only ‘AVIOS’ is supported. Example: AVIOS Format: Enumeration |
transaction. Conditional | Array of Complex type | A complex type that represents a member’s credit transaction, there may be many of these returned within a single response. Will be present if member contains credit transactions or transactions are filtered out by the request elements. |
Transaction. Present | String | The unique identifier of the credit transaction within Avios systems. Format: Alpha numeric. Max length: 32 |
Transaction. Present | Date | This is the date that has been stored against the transaction. Example: 2016-10-20T10:23:23.000Z Format: YYYY-MM-DDThh:mm:ss.sTZD |
transaction. Present | String | A description of the credit transaction. Example: JKL Format: Alphanumeric with special characters. Min length: 1 Max length: 51 & . - |
transaction. Present | String | The partner name related to the transaction. Format: Alphanumeric with special characters. Max length: 10 & . - |
Transaction. Present | String | The partner’s reference for the credit transaction. Example: 14426D Format: Alphanumeric with special characters. Max length: 10 & . - |
transaction. Present | Complex type | A Complex Type, which represents the transaction amount. |
Transaction. Present | Big decimal | The transaction amount, in Avios, expressed as a numeric. Example: 999999 Format: Max length: 6 Numeric |
transaction. Present | String | The transaction amount formatted as specified by the currency code as a String value. Contains only numeric values. Format: Max length: 6 Alphanumeric |
Transaction. Present | Complex type | A complex type, which represents the specific currency of a transaction. |
Transaction. Present | String | Loyalty programme currency identifier. At present only ‘AVIOS’ is supported. Example: AVIOS Format: Enumeration |
Exception Message Elements
Error Response:
{
"error": {
"code": "REQUEST_INVALID",
"businessMessage": "Request Invalid",
"developerLink": "https://developer.iagloyalty.com/docs",
Name | Type | Description |
---|---|---|
error Conditional | Complex Type | Will only be present if an error has been detected and reported by the API. |
error. Present | String | Error code. Example: REQUEST_INVALID Format: Alphabetic plus under- score . |
error. Present | String | A business level message describing the error, which has occurred. Example: Request invalid Format: Alphabetic |
error. Conditional | String | Developer message will be present when detailed technical description is required for the error, which has occurred by the API. If no specific developer message is required, developer message will be as business message. Format: Alphabetic |
error. Present | String | A URL link to a web page containing more detailed information about the error code. Example: https://developer.iagloyalty.com/docs Format: Alphabetic plus colon (:), forward slash (/), dash (-), underscore or period (.). |
error. Conditional | Array of complex type | Present for certain errors (e.g. validation) where one or more child error may have occurred. |
error. Present | String | The unique code for this error, described in section 5.3 of this document. Example: DATA_INVALID Format: Alphabetic plus under- score . |
error. Conditional | String | Path of the node on which error occurred. This will not come in case of any of the authorisation header elements are invalid or missing. Example: member.person.name.firstName Format: Alphabetic plus period (.), forward slash (/), open bracket ( |
error. Present | String | A business level message describing the error, which has occurred. Example: Data invalid Format: Alphabetic |
error. Conditional | String | Developer message will be present when detailed technical description is required for the child error, which has occurred, by the API. E.g. in case of REQUEST_INVALID DATA_INVALID, it is required which data is invalid and what is invalid in the data.If no specific developer message is required, developer message will be as business message. Format: Alphabetic |
error. Present | String | A URL link to a web page containing more detailed information about the error code. Example: https://developer.iagloyalty.com/docs Format: Alphabetic plus colon (:), forward slash (/), dash (-), underscore or period (.). |
Error Codes
The elements that make up the error messages are detailed in the following table:
HTTP Status Code | Description |
---|---|
400 REQUEST_INVALID DATA_INVALID | Request element doesn’t follow the request contract. For example the end-date is provided in bad format. |
400 REQUEST_INVALID DATE_RANGE_INVALID | When from date is greater than to date. |
400 REQUEST_INVALID RECORD_RANGE_INVALID | End record should be greater than start record. |