createRefundNote function

Future<ApiResponse<RefundNote>> createRefundNote(
  1. ExsitedClient client,
  2. Object refundId,
  3. String note, {
  4. Map<String, Object?>? files,
  5. bool? raiseOnError,
  6. String? responseFormat,
})

POST /api/{api_version}/refunds/{refund_id}/notes

Attach a note to a refund; a form, the text as the note field, and 201 under note.

Implementation

Future<ApiResponse<RefundNote>> createRefundNote(
  ExsitedClient client,
  Object refundId,
  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(RefundsUrls.refundNotes,
      pathParams: {'refund_id': refundId},
      formData: {'note': note},
      files: files,
      raiseOnError: raiseOnError,
      responseFormat: responseFormat,
      dtoDecoder: RefundNote.fromMap);
}