// Create customer response
const customer = await monei.business.createBusinessCustomer(businessId, {
firstName: "John",
lastName: "Doe",
email: "john@example.com",
phoneNumber: "+2348012345678"
});
console.log(customer.id); // Customer ID
console.log(customer.firstName); // First name
console.log(customer.lastName); // Last name
console.log(customer.email); // Email address
console.log(customer.phoneNumber); // Phone number
console.log(customer.status); // Customer status
console.log(customer.createdAt); // Creation date
// Get business customers response
const customers = await monei.business.getBusinessCustomers(businessId);
customers.data.forEach(customer => {
console.log(customer.id); // Customer ID
console.log(customer.firstName); // First name
console.log(customer.lastName); // Last name
console.log(customer.email); // Email address
console.log(customer.phoneNumber); // Phone number
console.log(customer.status); // Customer status
});
console.log(customers.pagination); // Pagination info
// Get customer details response
const customer = await monei.business.getCustomerDetails(businessId, customerId);
console.log(customer.id); // Customer ID
console.log(customer.firstName); // First name
console.log(customer.lastName); // Last name
console.log(customer.email); // Email address
console.log(customer.phoneNumber); // Phone number
console.log(customer.status); // Customer status
console.log(customer.createdAt); // Creation date
console.log(customer.updatedAt); // Last update date
// Update customer response
const updatedCustomer = await monei.business.updateCustomer(
businessId,
customerId,
{
firstName: "Jane",
lastName: "Doe",
email: "jane@example.com"
}
);
console.log(updatedCustomer.id); // Customer ID
console.log(updatedCustomer.firstName); // Updated first name
console.log(updatedCustomer.lastName); // Updated last name
console.log(updatedCustomer.email); // Updated email
console.log(updatedCustomer.updatedAt); // Update timestamp
// Disable customer response
const response = await monei.business.disableCustomer(businessId, customerId);
console.log(response.message); // Success message
console.log(response.customerId); // Disabled customer ID
console.log(response.status); // New status