createInvoiceNote function
POST /api/{api_version}/invoices/{invoice_id}/notes
Sent as a form, the text as the note field, and as multipart with any
files beside it: the endpoint reads no JSON body.
Implementation
Future<ApiResponse<InvoiceNote>> createInvoiceNote(
ExsitedClient client,
Object invoiceId,
String note, {
Map<String, Object?>? files,
bool? raiseOnError,
String? responseFormat,
}) {
if (note.isEmpty) {
throw SdkUsageError(
'note is required: the note text is the body of this request');
}
return client.sendPostRequest(InvoicesUrls.invoiceNotes,
pathParams: {'invoice_id': invoiceId},
formData: {'note': note},
files: files,
raiseOnError: raiseOnError,
responseFormat: responseFormat,
dtoDecoder: InvoiceNote.fromMap);
}