findByNumber method
Find an credit by its number
Implementation
Future<Credit?> findByNumber(String number) async {
final response = await WebClient().get(
'${InvoiceNinjaAdmin.url}/api/v1/credits?number=$number',
token: InvoiceNinjaAdmin.token);
final data = CreditList.fromJson(response).data;
return data.isEmpty ? null : data.first;
}