💳Retrieve Card

This endpoint allows to retrieve information of a card associated with a customer registered in the KrezyPay system. It provides details about the card, including its status, type and brand.

Retrieve a card

POST https://api.krezypay.com/v1/sandbox/card/retrieve_card

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

card_id

string

The card identifier

Response


{
    "status": "success",
    "card_status": "active",
    "card_holder": "Antoine Jeff",
    "card_number": "5323 **** **** 217 ",
    "cvv": "***",
    "last4": "9217",
    "exp": "10/28",
    "balance": "0.00",
    "authorization_balance": "2.00",
    "address": {
        "country": "United States",
        "state": "California",
        "city": "San Francisco",
        "zip_code": "94105",
        "line1": "1088 Roosevelt Street"
    }
}

See Examples Below

const endpoint = 'https://api.krezypay.com/v1/sandbox/card/retrieve_card';
const bearerToken = 'YOUR_BEARER_TOKEN'; // Replace with your actual bearer token

// Request body data
const requestBody = {
    card_id: 'c451ad689f414827abb0b6dc6ea96edb'
};

// Make the POST request
fetch(endpoint, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${bearerToken}` // Set the Authorization header with Bearer token
    },
    body: JSON.stringify(requestBody) // Convert the request body to JSON string
})
.then(response => {
    if (!response.ok) {
        throw new Error(`HTTP error! Status: ${response.status}`);
    }
    return response.json(); // Parse the response as JSON
})
.then(data => {
    console.log('Response:', data); // Handle the response data
})
.catch(error => {
    console.error('Error:', error.message); // Handle errors
});

Recovering sensitive card data


Sensitive Card Data Retrieval API

This API allows for the retrieval of sensitive information related to a bank card after proper authentication and validation. These details are essential for ensuring smooth financial operations while maintaining the highest level of security.

Retrieved Information:

  • Card Status: Indicates whether the card is active, suspended, or expired.

  • Cardholder Name: The full name of the cardholder.

  • Card Number: The full card number or just the last four digits.

  • CVV: The security code found on the back of the card.

  • Expiration Date: The date when the card expires.

  • Balance: The current available balance on the card.

  • Authorization Balance: Amount reserved for pending authorizations.

  • Billing Address: Includes country, state, city, postal code, and address line.

Secure Access: Access to these sensitive details is strictly limited to authenticated users with a valid JWT token. This token is verified with each request to ensure user identity and transaction security.

Security Requirements: All data is transmitted over secure channels (HTTPS) and protected using industry-standard cryptographic measures, including PCI-DSS compliance. Information such as the card number and CVV are never stored in plain text and are only accessible for real-time transactions.

API Usage: To use this API, the user must provide:

  • A valid JWT token via the Authorization header.

  • The card identifier (card_id) to retrieve in the request.

Once the request is validated, the API returns a JSON containing the sensitive card information. If the card is not found or the token has expired, the API returns an error with an appropriate message.

Error Handling:

  • If the JWT token is invalid or expired, a response with HTTP status code 401 is returned.

  • If the card is not found, a response with HTTP status code 404 is returned.

  • If an error occurs while retrieving the data, a response with HTTP status code 422 is returned.

Create a new user

POST https://api.krezypay.com/v1/sandbox/card/retrieve_card_details

<Description of the endpoint>

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

card_id

string

The card identifier

Response


{
    "status": "success",
    "card_status": "active",
    "card_holder": "Antoine Jeff",
    "card_number": "5323 8989 2202 9217 ",
    "cvv": "858",
    "last4": "9217",
    "exp": "10/28",
    "balance": "0.00",
    "authorization_balance": "1.00",
    "address": {
        "country": "United States",
        "state": "California",
        "city": "San Francisco",
        "zip_code": "94105",
        "line1": "1088 Roosevelt Street"
    }
}

See Examples Below

const endpoint = 'https://api.krezypay.com/v1/sandbox/card/retrieve_card_details';
const bearerToken = 'YOUR_BEARER_TOKEN'; // Replace with your actual bearer token

// Request body data
const requestBody = {
    card_id: 'c451ad689f414827abb0b6dc6ea96edb'
};

// Make the POST request
fetch(endpoint, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${bearerToken}` // Set the Authorization header with Bearer token
    },
    body: JSON.stringify(requestBody) // Convert the request body to JSON string
})
.then(response => {
    if (!response.ok) {
        throw new Error(`HTTP error! Status: ${response.status}`);
    }
    return response.json(); // Parse the response as JSON
})
.then(data => {
    console.log('Response:', data); // Handle the response data
})
.catch(error => {
    console.error('Error:', error.message); // Handle errors
});

The card data is extremely sensitive and must be handled securely. Please ensure that all precautions are taken to protect this information.

Last updated