Collector Request
Retrieve the transaction history for a logged in Collector.
GET
/transaction-history/cards
Take a look at our OpenAPI (Swagger-Spec) schema to learn more about the API calls.
Important
This API call is not intended for manual search queries, it only retrieves the transaction history for a Collector who is logged in.This endpoint is used to retrieve the transaction history for a Collector who is logged in to the website or the mobile application. A date range must be provided (with a start and end-date), and this will return results for all sponsors the Collector has transacted with during this time period.
Note
The Collector number is embedded in the Bearer access token automatically and therefore does not need to be included in the request itself.Sample request
curl -X GET \
https://cert.airmilesapis.ca/transaction-history/cards?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=0&size=2&sort=transactionDate,desc&sort=sponsorCode,asc \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCI...' \
--header 'Channel-Code: MOBAPP' \
--header 'Accept-Language: EN'
Header parameters
Parameter | Description |
---|---|
Content-Type | Default value: application/json |
Authorization | Token from authentication.
Example: |
Channel-Code | Channel by which the transaction is called. The response will differ for different channels.
Example: |
Accept-Language | Language parameters, either “EN” for English or “FR” for French.
Example: |
Query parameters
Parameter | Description |
---|---|
from |
The start of the search date range.
Example: |
to |
The end of the search date range.
Example: |
page |
The results page to start with.
Example: |
size |
The number of transactions per page.
Example: |
sort |
Sort by field, ascending or descending. You can include up to 3 sequential sort parameters.
Example: |
Sample response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 29 Oct 2019 15:27:34 GMT
{
"_embedded": {
"genericActivityDtoList": [
{
"transactionId": "bfc52daa-b1ec-44fb-b8e2-babc6f93395e",
"memberId": 80000000001,
"cardNumber": "80000000001",
"activityType": "ISSUANCE",
"transactionDate": "2019-01-20T13:15:57.000Z",
"postingDate": "2019-03-20T13:15:57.000Z",
"transactionDescription": "P&S Goodwill",
"transactionValue": 50,
"cashMiles": 44,
"dreamMiles": 6,
"cashRatio": 0.88,
"dreamRatio": 0.12,
"externalReferenceNumber": "07753481468",
"externalReferenceType": null,
"channel": "ETS",
"initiatorId": "ETSets_user",
"sponsorCode": "AIRI",
"sponsorDescriptionEnglish": "AIR MILE TRAVEL INSURANCE",
"sponsorDescriptionFrench": "ASSURANCE VOYAGE AIR MILES",
"offerClass": "BONUS",
"offerCode": "GOODWILL",
"offerDescriptionEnglish": "P&S Goodwill",
"offerDescriptionFrench": "AJUSTEMENT",
"locationCode": "",
"locationDescription": "",
"redemptionStatus": null
},
{
"transactionId": "a27c7827-a865-4425-a407-d1969b3ddfc5",
"memberId": 80000000001,
"cardNumber": "80000000001",
"activityType": "ISSUANCE",
"transactionDate": "2019-01-07T17:03:49.000Z",
"postingDate": "2019-03-01T17:03:49.000Z",
"transactionDescription": "AIR MILES Travel Insurance",
"transactionValue": 50,
"cashMiles": 14,
"dreamMiles": 36,
"cashRatio": 0.29,
"dreamRatio": 0.71,
"externalReferenceNumber": "96561512670",
"externalReferenceType": null,
"channel": "ETS",
"initiatorId": "ETSets_user",
"sponsorCode": "AIRI",
"sponsorDescriptionEnglish": "AIR MILE TRAVEL INSURANCE",
"sponsorDescriptionFrench": "ASSURANCE VOYAGE AIR MILES",
"offerClass": "BONUS",
"offerCode": "TSRTRIPC",
"offerDescriptionEnglish": "AIR MILES Travel Insurance",
"offerDescriptionFrench": "RECLAMATION D'ASSURANCE",
"locationCode": "",
"locationDescription": "",
"redemptionStatus": null
}
]
},
"_links": {
"first": {
"href": "https://cert.airmilesapis.ca/transaction-history/cards?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=0&size=2&sort=transactionDate,desc&sort=sponsorCode,asc"
},
"self": {
"href": "https://cert.airmilesapis.ca/transaction-history/cards?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=0&size=2&sort=transactionDate,desc&sort=sponsorCode,asc"
},
"next": {
"href": "https://cert.airmilesapis.ca/transaction-history/cards?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=1&size=2&sort=transactionDate,desc&sort=sponsorCode,asc"
},
"last": {
"href": "https://cert.airmilesapis.ca/transaction-history/cards?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=22&size=2&sort=transactionDate,desc&sort=sponsorCode,asc"
}
},
"page": {
"size": 2,
"totalElements": 45,
"totalPages": 23,
"number": 0
}
}
Status codes
Status Code | Description |
---|---|
200 |
The transaction was successful. |
401 |
The Collector account is not active. |
408 |
The transaction timed out. |
401 |
The Collector number is invalid. |
400 |
A mistake was made when submitting the request. Please correct the error and try again. |
503 |
The system is unavailable due to scheduled maintenance. No requests can be sent. |
500 |
An unknown error occurred. |
none | No valid Bearer token present. Please generate a valid Bearer token and submit to continue. |