findByKey method

Future<Invoice> findByKey(
  1. String key
)

Find an invoice by its invitation key

Implementation

Future<Invoice> findByKey(String key) async {
  final response = await WebClient().get(
      '${InvoiceNinja.url}/api/v1/shop/invoice/$key',
      companyKey: InvoiceNinja.companyKey);

  return InvoiceItem.fromJson(response).data;
}