👨Create a customer
Create a new customer
POST
https://api.krezypay.com/v1/sanbox/customer/create_customer
Headers
Name
Value
Content-Type
application/json
Authorization
Bearer <token>
Body
Name
Type
Description
firstname
string
Name of the user
lastname
string
Age of the user
gender
string
Customer gender 'M' or 'F'
string
Customer email
phone
string
Customer phone number
id_type
string
The type of customer's identity documents: ID_CARD or PASSPORT
id_number
string
The customer's ID number
face_id_image
string
The url of the selfie image of the customer's ID
front_id_image
string
The URL of the front image of the customer's ID document
back_id_image
string
The url of the image of the back of the customer's ID to send if the ID type is ID_CARD
Response
{
"status": "success",
"customer_id": "670edb909c4c8670edb909c4ca",
"message": "Customer successfully registered"
}
See Examples Below
const url = 'https://api.krezypay.com/v1/sandbox/customer/create_customer';
const data = {
"firstname": "Jhon",
"lastname": "doe",
"email": "[email protected]",
"phone": "+18293857569",
"gender": "M",
"country": "UNITED STATES",
"id_number": "R11770744",
"id_type": "ID_CARD",
"front_id_image": "https://images/document-front-pre_738bbeee-418d-488c-8b52-7d667a6b1f46.png",
"face_id_image": "https://face_86fe1194-e661-4f2a-9268-7cc1429a86df.png",
"back_id_image": "https://face_86fe1194-e661-4f2a-9268-7ccg1429a86df.png"
};
// Bearer token
const token = 'your_bearer_token_here';
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify(data)
})
.then(response => response.json()) // Parse the response as JSON
.then(result => console.log(result)) // Log the JSON result
.catch(error => console.error('Error:', error));
Last updated