Sponsor Request
Take a look at our OpenAPI (Swagger-Spec) schema to learn more about the API calls.
This endpoint is used to retrieve the transaction history for a specified Collector and filtered by sponsor. A date range must be provided (with a start and end-date), and at least one sponsor and a single Collector number. This will return the Collector’s transaction history at the sponsor, for the time period specified above.
Note
To receive a Bearer token and authorize your request, use theclient_id and client_secret provided to you by AIR MILES.
Sample request
curl -X GET \
  https://cert.airmilesapis.ca/transaction-history/sponsors?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=0&size=2&sort=transactionDate,desc&sort=sponsorCode,asc&sponsorList=ABC,CBA&collectorNumber=80000000001 \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCI...' \
  --header 'Channel-Code: MOBAPP' \
  --header 'Accept-Language: EN'
Header parameters
| Parameter | Description | 
|---|---|
| Content-Type | 
 
    Default:   | 
      
| 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:   | 
      
sponsorList | 
          The ID(s) of the sponsor(s) you wish to search by.
 
    Example:   | 
      
collectorNumber | 
          The Collector number you wish to search for.
 
    Example:   | 
      
Sample response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 29 Oct 2018 15:27:34 GMT
{
  "_embedded": {
    "genericActivityDtoList": [
      {
        "transactionId": "a8354c14-6533-4550-b25d-b3e8c07340e3",
        "memberId": 80000000001,
        "cardNumber": "80000000001",
        "activityType": "ISSUANCE",
        "transactionDate": "2018-11-21T21:55:07",
        "postingDate": "2018-12-08T21:55:07",
        "transactionDescription": "MILLES DE RECOMPENSE EN PRIME",
        "transactionValue": 6,
        "cashMiles": 3,
        "dreamMiles": 3,
        "cashRatio": 0.56,
        "dreamRatio": 0.44,
        "externalReferenceNumber": "66367295746",
        "externalReferenceType": null,
        "channel": "WEB",
        "initiatorId": "WEB423672",
        "sponsorCode": "AMXJ",
        "sponsorDescriptionEnglish": "AMEX AIR MILES BUSINESS",
        "sponsorDescriptionFrench": "CARTE POUR ENTREPRISE AMEX",
        "offerClass": "BONUS",
        "offerCode": "MPOOL",
        "offerDescriptionEnglish": "WELCOME BONUS",
        "offerDescriptionFrench": "MILLES DE RECOMPENSE EN PRIME",
        "locationCode": "",
        "locationDescription": null,
        "redemptionStatus": null
      },
      {
        "transactionId": "2cd4b826-6f7a-4e93-87ac-82c215bd8fe5",
        "memberId": 80000000001,
        "cardNumber": "80000000001",
        "activityType": "ISSUANCE",
        "transactionDate": "2018-11-06T20:33:54",
        "postingDate": "2018-11-26T20:33:54",
        "transactionDescription": "GAGNANT(E) DU CONCOURS",
        "transactionValue": 6,
        "cashMiles": 2,
        "dreamMiles": 4,
        "cashRatio": 0.37,
        "dreamRatio": 0.63,
        "externalReferenceNumber": "14493747740",
        "externalReferenceType": null,
        "channel": "BATCH",
        "initiatorId": "BATCH707530",
        "sponsorCode": "AMRP",
        "sponsorDescriptionEnglish": "AIR MILES REWARD PROGRAM",
        "sponsorDescriptionFrench": "PROGRAMME DE RECOMPENSE AIR MILES",
        "offerClass": "BONUS",
        "offerCode": "4352932T",
        "offerDescriptionEnglish": "Contest Winner",
        "offerDescriptionFrench": "GAGNANT(E) DU CONCOURS",
        "locationCode": "0705",
        "locationDescription": "TRANSAT",
        "redemptionStatus": null
      }
    ]
  },
    "_links": {
    "first": {
      "href": "https://cert.airmilesapis.ca/transaction-history/sponsors?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=0&size=2&sort=transactionDate,desc&sort=sponsorCode,asc&sponsorList=ABC,CBA&collectorNumber=80000000001"
    },
    "self": {
      "href": "https://cert.airmilesapis.ca/transaction-history/sponsors?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=0&size=2&sort=transactionDate,desc&sort=sponsorCode,asc&sponsorList=ABC,CBA&collectorNumber=80000000001"
    },
    "next": {
      "href": "https://cert.airmilesapis.ca/transaction-history/sponsors?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=1&size=2&sort=transactionDate,desc&sort=sponsorCode,asc&sponsorList=ABC,CBA&collectorNumber=80000000001"
    },
    "last": {
      "href": "https://cert.airmilesapis.ca/transaction-history/sponsors?from=2018-01-01T00:16:45.052035Z&to=2019-10-01T00:16:45.052035Z&page=9&size=2&sort=transactionDate,desc&sort=sponsorCode,asc&sponsorList=ABC,CBA&collectorNumber=80000000001"
    }
  },
  "page": {
    "size": 2,
    "totalElements": 19,
    "totalPages": 10,
    "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. |