createItemFulfillmentNote function

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

POST /api/{api_version}/item_fulfillments/{fulfillment_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<ItemFulfillmentNotes>> createItemFulfillmentNote(
  ExsitedClient client,
  Object fulfillmentId,
  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(ItemFulfillmentsUrls.itemFulfillmentNotes,
      pathParams: {'fulfillment_id': fulfillmentId},
      formData: {'note': note},
      files: files,
      raiseOnError: raiseOnError,
      responseFormat: responseFormat,
      dtoDecoder: ItemFulfillmentNotes.fromMap);
}