View Issued Cards

Learn how you can lookup cards you've issued

If you need to search for cards you've issued, you can do so via our List cards endpoint.

Triggering this endpoint without any parameters will retrieve all of the cards that can be seen by the authenticated user, limited to the default pagination limit of 100.

For more details regarding how pagination works, see our Pagination documentation

In most cases, you would want to be more specific about which cards you would like to retrieve. The primary filtering options we provide are:

  • Searching for only a particular type of card (e.g. retrieve only lodged cards)
  • Retrieving cards based on whether they are active or not
  • Retrieving cards by their amount or usage limits, or their limit window
  • Retrieving cards by their expiration or termination dates
  • Only retrieving cards with a particular purchase type

There are some other filters available, these are explained in the reference documentation.

πŸ“˜

Filtering With Dates

Note that when you are using date filters, our systems assume that the date provided is in UTC time. To ensure your queries return the correct results, please check that you provide the correct time format.

Example: Retrieve all cards with a particular amount limit

If you would like to filter cards with a value in a given range, you will need to use a combination of amount limit filters. In this case, we will retrieve the cards with an amount limit between 500 and 1000

import os
import requests

API_URL = "https://api.dba.thepennyinc.com/v1"
ACCESS_TOKEN = os.getenv("PENNY_ACCESS_TOKEN")

headers = {
  "Authorization": f"Bearer {ACCESS_TOKEN}"
}

parameters = {
  "amount_limit_greater_than_equal_to": 500,
  "amount_limit_less_than_equal_to": 1000
}

response = requests.get(API_URL + "/cards", params=parameters, headers=headers)

Example: Retrieve all lodged cards which expire in the next 10 days

You can combine different types of filters to create more complex queries.

Note that when working with date parameters, ensure that they are set to use the UTC timezone, and use supported date-time formats (i.e. YYYY-MM-DDTHH:MM:SS and YYYY-MM-DD

import os
import requests
from datetime import datetime, timedelta, timezone

API_URL = "https://api.dba.thepennyinc.com"
ACCESS_TOKEN = os.getenv("PENNY_ACCESS_TOKEN")

headers = {
  "Authorization": f"Bearer {ACCESS_TOKEN}"
}

current_date = datetime.now(timezone.utc)
max_expiration_date = current_date + timedelta(days=10)

parameters = {
  "type": "lodged",
  "expiration_date_after": current_date.strftime("%Y-%m-%dT%H:%M:%S"),
  "expiration_date_before_or_on": max_expiration_date.strftime("%Y-%m-%dT%H:%M:%S")
}

response = requests.get(API_URL + "/cards", params=parameters, headers=headers)