Easily integrate with Sudo Africa services, providing a comprehensive API for managing customers.
npm install sudo-africa-node
Firstly, you need to instantiate the SudoAfrica
class:
const SudoAfrica = require('sudoafrica-sdk');
const sudoInstance = new SudoAfrica('YOUR_API_KEY', 'YOUR_BASE_URL');
Create a new customer.
Arguments:
data
: Object - Customer details.
Returns:
- Promise - The created customer data.
Retrieve a list of customers.
Arguments:
page
: Number (default: 0) - Page number.limit
: Number (default: 100) - Number of results per page.
Returns:
- Promise - List of customers.
Retrieve a specific customer.
Arguments:
customerId
: String - The customer's ID.
Returns:
- Promise - The customer's data.
Update an existing customer.
Arguments:
customerId
: String - The customer's ID.customerData
: Object - New data for the customer.
Returns:
- Promise - The updated customer data.
Update a customer's document URL.
Arguments:
customerId
: String - The customer's ID.fileName
: String - Name of the file.fileType
: String - Type of the file (e.g., 'image').
Returns:
- Promise - Response data.