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.
constendpoint='https://api.krezypay.com/v1/sandbox/card/retrieve_card';constbearerToken='YOUR_BEARER_TOKEN'; // Replace with your actual bearer token// Request body dataconstrequestBody= { card_id:'c451ad689f414827abb0b6dc6ea96edb'};// Make the POST requestfetch(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) {thrownewError(`HTTP error! Status: ${response.status}`); }returnresponse.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});
<?php// Set the endpoint URL$endpoint ='https://api.krezypay.com/v1/sandbox/card/retrieve_card';// Create the request body$requestBody = ['card_id'=>'c451ad689f414827abb0b6dc6ea96edb'];// Convert the request body to JSON format$jsonBody =json_encode($requestBody);// Set your bearer token$bearerToken ='YOUR_BEARER_TOKEN'; // Replace with your actual bearer token// Initialize cURL$ch =curl_init($endpoint);// Set cURL optionscurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the response as a stringcurl_setopt($ch, CURLOPT_POST, true); // Specify that this is a POST requestcurl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json',// Set content type to JSON'Authorization: Bearer '. $bearerToken // Add bearer token to the Authorization header]);curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonBody); // Attach the request body// Execute the request$response =curl_exec($ch);// Check for errorsif (curl_errno($ch)) {echo'Error: '.curl_error($ch);} else {// Decode the response $responseData =json_decode($response, true);// Output the response dataecho'Response: ';print_r($responseData);}// Close cURLcurl_close($ch);?>
import requests# Set the API endpointendpoint ='https://api.krezypay.com/v1/sandbox/card/retrieve_card'# Your Bearer tokenbearer_token ='YOUR_BEARER_TOKEN'# Replace with your actual bearer token# Request body datarequest_body ={'card_id':'c451ad689f414827abb0b6dc6ea96edb'}# Set the headersheaders ={'Content-Type':'application/json','Authorization':f'Bearer {bearer_token}'# Set the Authorization header with Bearer token}# Make the POST requestresponse = requests.post(endpoint, json=request_body, headers=headers)# Check if the request was successfulif response.status_code ==200:# Print the response dataprint('Response:', response.json())else:# Print the error responseprint(f'Error: {response.status_code}, Message: {response.text}')
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.
constendpoint='https://api.krezypay.com/v1/sandbox/card/retrieve_card_details';constbearerToken='YOUR_BEARER_TOKEN'; // Replace with your actual bearer token// Request body dataconstrequestBody= { card_id:'c451ad689f414827abb0b6dc6ea96edb'};// Make the POST requestfetch(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) {thrownewError(`HTTP error! Status: ${response.status}`); }returnresponse.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});
<?php// Set the endpoint URL$endpoint ='https://api.krezypay.com/v1/sandbox/card/retrieve_card_details';// Create the request body$requestBody = ['card_id'=>'c451ad689f414827abb0b6dc6ea96edb'];// Convert the request body to JSON format$jsonBody =json_encode($requestBody);// Set your bearer token$bearerToken ='YOUR_BEARER_TOKEN'; // Replace with your actual bearer token// Initialize cURL$ch =curl_init($endpoint);// Set cURL optionscurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the response as a stringcurl_setopt($ch, CURLOPT_POST, true); // Specify that this is a POST requestcurl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json',// Set content type to JSON'Authorization: Bearer '. $bearerToken // Add bearer token to the Authorization header]);curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonBody); // Attach the request body// Execute the request$response =curl_exec($ch);// Check for errorsif (curl_errno($ch)) {echo'Error: '.curl_error($ch);} else {// Decode the response $responseData =json_decode($response, true);// Output the response dataecho'Response: ';print_r($responseData);}// Close cURLcurl_close($ch);?>
import requests# Set the API endpointendpoint ='https://api.krezypay.com/v1/sandbox/card/create_card_details'# Your Bearer tokenbearer_token ='YOUR_BEARER_TOKEN'# Replace with your actual bearer token# Request body datarequest_body ={'customer_id':'67112de111f2667112de111f28','card_type':'Virtual','card_brand':'Mastercard'}# Set the headersheaders ={'Content-Type':'application/json','Authorization':f'Bearer {bearer_token}'# Set the Authorization header with Bearer token}# Make the POST requestresponse = requests.post(endpoint, json=request_body, headers=headers)# Check if the request was successfulif response.status_code ==200:# Print the response dataprint('Response:', response.json())else:# Print the error responseprint(f'Error: {response.status_code}, Message: {response.text}')
The card data is extremely sensitive and must be handled securely. Please ensure that all precautions are taken to protect this information.