Skip to content

Sandbox API

Overview

The Sandbox API consists of pre-defined responses that allow you to interact with and test your offer content prior to going into production. The Sandbox API serves as a modified version of the production environment in your development workflow. The ads you create in this environment do not actually serve.

Connectivity

Access to the CDLX Sandbox APIs is controlled by whitelist and each partner is required to provide a range of IP addresses for exposure.

Sandbox Endpoints

You can use any Source Customer Identifier to create a Security token for Sandbox API calls.

Example Calls

Below you'll find the current set of calls that are available via the Sandbox API, with supporting links for more information on specific calls.

Important

Reach out to your account manager if you need any additional endpoints.

Security API

1
2
3
4
{
    "token":
        "~k-aXcOWkhfZDmuCkhxewl_rtujsw1QckcIzNKvz__0oRTkAeABCd123dWecapXWw"
}
See the section on how to Start a Session & Specify Scopes to interact with APIs for more details.

Customers API – Customer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  "isOptedIn": true,
  "pageLoadBeacon": "https://images.cardlytics.com?lt2=OtGHxAB20CiLv1eQ81mruWKNc4oRrifRGuXdn3NGfC8MYfhOMCBNESwmrBnZ0FAk&ot=6227k99bky8gfc3lz65j",
  "totalEarned": 0,
  "showTransactionAds": false,
  "accounts": [
    {
      "accountId": 123456,
      "sourceAccountId": "55555555",
      "name": "John Tester",
      "isPrimary": true,
      "portfolioName": "Cardlytics Deals",
      "portfolioId": 12376
    },
    {
      "accountId": 14067000,
      "sourceAccountId": "666666666",
      "name": "John Tester",
      "isPrimary": false,
      "portfolioName": "Cardlytics Deals",
      "portfolioId": 12376
    }
  ],
  "program": {
    "currencyExchangeRate": 1,
    "currencyUnit": "cash back",
    "isCashAccount": true,
    "cultureName": "en-US",
    "title": "Cardlytics Bank",
    "name": "Cardlytics Deals",
    "tagline": "",
    "description": "Deals Program"
  }
}
See the sections on Customers, Data and Events for more details.

Customers API – Start Customer’s Session

1
2
3
4
5
6
7
8
9
{
  "error": {
    "message": "Please see the server logs for more details",
    "code": "MethodNotAllowed",
    "innerError": null
  },
  "clientSessionId": "",
  "serverSessionId": null
}

See the sections on Customers, Data and Events for more details.

Customers API – Opt Customer In/Out

1
2
3
4
5
6
7
8
9
{
  "error": {
    "message": "Please see the server logs for more details",
    "code": "MethodNotAllowed",
    "innerError": null
  },
  "clientSessionId": "",
  "serverSessionId": null
}
See the sections on Customers, Data and Events for more details.

Ads API - GET Ads

See the Ads API for details.

Ads API – GET Rewards

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  "yearToDate": {
    "redemptionCount": 0,
    "redeemedOfferCount": 0,
    "rewardAmount": 0,
    "redeemingTransactionAmount": 0
  },
  "previousYear": {
    "redemptionCount": 0,
    "redeemedOfferCount": 0,
    "rewardAmount": 0,
    "redeemingTransactionAmount": 0
  },
  "previousMonth": {
    "redemptionCount": 0,
    "redeemedOfferCount": 0,
    "rewardAmount": 0,
    "redeemingTransactionAmount": 0
  },
  "rollingTwelveMonths": {
    "redemptionCount": 0,
    "redeemedOfferCount": 0,
    "rewardAmount": 0,
    "redeemingTransactionAmount": 0
  },
  "currentMonth": {
    "redemptionCount": 0,
    "redeemedOfferCount": 0,
    "rewardAmount": 0,
    "redeemingTransactionAmount": 0
  },
  "pending": {
    "redemptionCount": 3,
    "redeemedOfferCount": 3,
    "rewardAmount": 5.43,
    "redeemingTransactionAmount": 127.68
  }
}
See the Ads API for details.

Ads API – GET Redemptions

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
  "redemptions": [
    {
      "redemptionId": 11558877,
      "accountId": 105148777,
      "adId": 1000014477,
      "amount": 0.62,
      "date": "0001-01-01T00:00:00",
      "isMyReward": true,
      "paidAccountId": 105148777,
      "redeemingTransactionAmount": 6.2,
      "transactionId": "ce9e6961ab93660c462ea92c22429ccefdb765f3f1cd8143da1fa637815abcd",
      "rewardSettlementRunDate": null
    },
    {
      "redemptionId": 37895246,
      "accountId": 105148777,
      "adId": 1000016677,
      "amount": 0.68,
      "date": "0001-01-01T00:00:00",
      "isMyReward": true,
      "paidAccountId": 105148777,
      "redeemingTransactionAmount": 6.83,
      "transactionId": "cfedce87e22cb0178da0b84681ad7209dcc351b8e084a0bdadfb11c149afabcd",
      "rewardSettlementRunDate": null
    }
  ],
  "ads": [
    {
      "status": 16,
      "redemptions": null,
      "isParked": false,
      "position": 71,
      "activatedDate": null,
      "adId": "1000014477",
      "daysRemaining": -133,
      "endDate": "0001-01-01T00:00:00",
      "isPercentageOffer": true,
      "merchantName": "McDonald's",
      "offerAmount": 10,
      "maxRewardAmount": 2,
      "minSpendAmount": null,
      "adType": 1,
      "isMappable": false,
      "creatives": [
        {
          "creativeId": "1000014477-c",
          "images": {
            "logo": {
              "url": "https://chaseoffers.chase.com/offerimages/1000014477",
              "text": "McDonald's"
            }
          },
          "links": null,
          "impressionToken": "CPeE7NwDIgcI4se9GhACKAUwB0IMMTAwMDAxNDQ1NS1jSEdSEHB1cmNoYXNlLWNoYW5uZWxaBGxvZ29iCwj0yrWu2MLVOxAFaiQ2MWQyNGU0Ni1lZGFmLTQ3ZDEtYWE2MC02YmE2YWM3YTFjYzk",
          "beacons": {
            "preMessageImpression": "https://images.cardlytics.com/?http://prehealthcheck.cardlytics.com&xt=PxMIJCup5vrz26Ui4mOvXC5m3X5rBn3zuNcPGxURmVvYG%2FXyWZK%2Fhctarm94E5K4&ot=1jpjrmrpcp9nd7qi502w",
            "postMessageImpression": "https://images.cardlytics.com/?http://posthealthcheck.cardlytics.com&xt=PxMIJCup5vrz26Ui4mOvXC5m3X5rBn3zuNcPGxURmVvYG%2FXyWZK%2Fhctarm94E5K4&ot=1jpjrmrpcp9nd7qi502w"
          }
        }
      ],
      "tags": [
        {
          "key": "purchase-channel",
          "value": "in-store and online"
        }
      ],
      "purchaseRequirement": null,
      "purchaseChannels": [],
      "offerPromotions": []
    },
    {
      "status": 16,
      "redemptions": null,
      "isParked": false,
      "position": 72,
      "activatedDate": null,
      "adId": "1000016677",
      "daysRemaining": -88,
      "endDate": "0001-01-01T00:00:00",
      "isPercentageOffer": true,
      "merchantName": "McDonald's",
      "offerAmount": 10,
      "maxRewardAmount": 2,
      "minSpendAmount": null,
      "adType": 1,
      "isMappable": false,
      "creatives": [
        {
          "creativeId": "1000016677-c",
          "images": {
            "logo": {
              "url": "https://chaseoffers.chase.com/offerimages/1000016677",
              "text": "McDonald's"
            }
          },
          "links": null,
          "impressionToken": "CJKW7NwDIgcIyqHCGhACKAUwB0IMMTAwMDAxNjY1OC1jSEhSEHB1cmNoYXNlLWNoYW5uZWxaBGxvZ29iCwjK_bWu2MLVOxAFaiQ2MWQyNGU0Ni1lZGFmLTQ3ZDEtYWE2MC02YmE2YWM3YTFjYzk",
          "beacons": {
            "preMessageImpression": "https://images.cardlytics.com/?http://prehealthcheck.cardlytics.com&xt=n2OHlWQ77%2FiDdzc7FzTqLpKB0yV3WOjIxXC6a8ckxFq3lG2zeLLZ1IEDEjRLRTLy&ot=1jpjrmrpcp9nd7qi502w",
            "postMessageImpression": "https://images.cardlytics.com/?http://posthealthcheck.cardlytics.com&xt=n2OHlWQ77%2FiDdzc7FzTqLpKB0yV3WOjIxXC6a8ckxFq3lG2zeLLZ1IEDEjRLRTLy&ot=1jpjrmrpcp9nd7qi502w"
          }
        }
      ],
      "tags": [
        {
          "key": "purchase-channel",
          "value": "in-store and online"
        }
      ],
      "purchaseRequirement": null,
      "purchaseChannels": [],
      "offerPromotions": []
    }
  ]
}
See the Ads API for details.

Ads API – GET Ad Counts

1
2
3
{
  "count": 10
}
See the Ads API for details.

Ads API – GET Ad Counts

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
  "active": {
    "count": 0
  },
  "activeParked": {
    "count": 0
  },
  "notActiveNew": {
    "count": 81
  },
  "notActiveServed": {
    "count": 0
  },
  "notActiveExpired": {
    "count": 262
  },
  "notActiveParked": {
    "count": 0
  }
}
See the Ads API for details.

Ads API – Activate Ad/Ads

1
2
3
4
5
6
7
8
9
{
  "error": {
    "message": "Please see the server logs for more details",
    "code": "MethodNotAllowed",
    "innerError": null
  },
  "clientSessionId": "",
  "serverSessionId": null
}

See the Ads API for details.

Ads API – Mark Ads as Served

1
2
3
4
5
6
7
8
9
{
  "error": {
    "message": "Please see the server logs for more details",
    "code": "MethodNotAllowed",
    "innerError": null
  },
  "clientSessionId": "",
  "serverSessionId": null
}
See the Ads API for details.