👨Retrieve Customer
Last updated
Last updated
GET
https://api.krezypay.com/v1/sandbox/customer/retrieve_customer
Headers
Name | Value |
---|---|
Body
Name | Type | Description |
---|---|---|
Response
{
"status": "success",
"firstname": "Jhon ",
"lastname": "Doe",
"email": "jhondoe@gmail.com",
"phone": "+18493821569",
"gender": "M",
"country": "UNITED STATES",
"id_type": "ID_CARD",
"id_number": "333",
"face_id_image": "https://business.krezypay.com/dashboard",
"front_id_image": "https://business.krezypay.com/dashboard",
"back_id_image": "https://business.krezypay.com/dashboard",
"date_enreg": "2024-10-17 14:51:09",
"user_status": "Activate",
"mode": "sandbox"
}
{
"error": "Invalid request"
}
See Examples Below
const customerId = '671511168f13e671511168f13f'; // Replace with the actual customer ID
const url = `https://api.krezypay.com/v1/sandbox/customer/retrieve_customer?customer_id=${customerId}`;
const token = 'YOUR_BEARER_TOKEN'; // Replace with your actual bearer token
fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log('Customer data retrieved:', data);
})
.catch(error => {
console.error('Error fetching customer data:', error);
});
<?php
$customerId = '671511168f13e671511168f13f'; // Replace with the actual customer ID
$url = "https://api.krezypay.com/v1/sandbox/customer/retrieve_customer?customer_id=" . urlencode($customerId);
$token = 'YOUR_BEARER_TOKEN'; // Replace with your actual bearer token
// Initialize cURL session
$ch = curl_init($url);
// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $token",
"Content-Type: application/json"
]);
// Execute cURL request
$response = curl_exec($ch);
// Check for errors
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
} else {
// Decode the JSON response
$data = json_decode($response, true);
// Handle the response data as needed
print_r($data);
}
// Close the cURL session
curl_close($ch);
?>
import requests
customer_id = '671511168f13e671511168f13f' # Replace with the actual customer ID
url = f'https://api.krezypay.com/v1/sandbox/customer/retrieve_customer?customer_id={customer_id}'
token = 'YOUR_BEARER_TOKEN' # Replace with your actual bearer token
# Set the headers
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
# Make the GET request
response = requests.get(url, headers=headers)
# Check if the request was successful
if response.status_code == 200:
data = response.json() # Parse the JSON response
print(data) # Handle the response data as needed
else:
print(f'Error: {response.status_code} - {response.text}')
Content-Type
application/json
Authorization
Bearer <token>
customer_id
string
The customer_id of the customer provided during registration