Transaction

Retrieve transactions on a card

GET https://api.krezypay.com/v1/sandbox/card/card_transaction?card_id=c451ad689f414827abb0b6dc6ea96edb

This endpoint allows you to retrieve transactions on a Visa or Mastercard card

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Body

NameTypeDescription

card_id

string

The card identifier

Response


{
    "status": "success",
    "transactions": [
        {
            "reference": "b0f6c1d480ca4a3d93c83cca7e9a9b55",
            "amount": "+4.03",
            "date": "2024-10-21 07:23:29",
            "merchant": "AUTHORIZATION",
            "website": "None",
            "logo": "https://logos.ntropy.com/consumer_icons-ATM_bank_deposit",
            "description": "Mastercard Virtual dollar card funding"
        },
        {
            "reference": "a25cde08cff04e4ebef6bf2583150999",
            "amount": "+2.00",
            "date": "2024-10-21 07:18:04",
            "merchant": "AUTHORIZATION",
            "website": "None",
            "logo": "https://logos.ntropy.com/consumer_icons-ATM_bank_deposit",
            "description": "Mastercard Virtual dollar card funding"
        },
        {
            "reference": "08e42cdc02d141ebbf7c4ef5ed3916b8",
            "amount": "+10.00",
            "date": "2024-10-21 06:22:24",
            "merchant": "AUTHORIZATION",
            "website": "None",
            "logo": "https://logos.ntropy.com/consumer_icons-ATM_bank_deposit",
            "description": "Mastercard Virtual dollar card funding"
        },
        {
            "reference": "eb0162321322450196b7e931169f5f52",
            "amount": "+2.00",
            "date": "2024-10-20 14:32:24",
            "merchant": "AUTHORIZATION",
            "website": "None",
            "logo": "https://logos.ntropy.com/consumer_icons-ATM_bank_deposit",
            "description": "Mastercard Virtual dollar card funding"
        }
    ]
}

See Examples Below

const cardId = 'c451ad689f414827abb0b6dc6ea96edb'; // Replace with your card ID
const bearerToken = 'YOUR_BEARER_TOKEN'; // Replace with your Bearer token

const url = `https://api.krezypay.com/v1/sandbox/card/card_transaction?card_id=${cardId}`;

fetch(url, {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${bearerToken}`,
        'Content-Type': 'application/json'
    }
})
.then(response => {
    // Check if the response is okay (status in the range 200-299)
    if (!response.ok) {
        throw new Error(`HTTP error! Status: ${response.status}`);
    }
    return response.json(); // Parse the JSON from the response
})
.then(data => {
    console.log('Success:', data); // Log the successful response data
})
.catch(error => {
    console.error('Error:', error); // Log any errors that occurred
});

Last updated