API Reference
Customers
Manage FedaPay customers.
CustomersRepository
Access via FedaFlutter.instance.customers.
Methods
getCustomers()
Returns a list of customers.
final res = await repo.getCustomers();
// res.data → List<Customer>
getCustomer(int id)
Returns a single customer by ID.
final res = await repo.getCustomer(1);
print(res.data?.email);
createCustomer(dynamic data)
Creates a new customer. Accepts a CustomerCreate DTO or a raw Map.
final res = await repo.createCustomer(CustomerCreate(
firstname: 'Jane',
lastname: 'Doe',
email: 'jane@example.com',
phoneNumber: PhoneNumber(number: '97000000', country: 'BJ'),
));
updateCustomer(int id, dynamic data)
Updates an existing customer.
await repo.updateCustomer(1, CustomerCreate(
firstname: 'Jane',
lastname: 'Smith',
email: 'jane.smith@example.com',
phoneNumber: PhoneNumber(number: '97000000', country: 'BJ'),
));
deleteCustomer(int id)
Deletes a customer.
await repo.deleteCustomer(1);
DTOs
CustomerCreate
| Field | Type | Required |
|---|---|---|
firstname | String | ✅ |
lastname | String | ✅ |
email | String | ✅ |
phoneNumber | PhoneNumber | ✅ |
PhoneNumber
| Field | Type | Description |
|---|---|---|
number | String | Phone number |
country | String | ISO 2-letter country code (e.g. 'BJ') |