applyCreditNote function

Future<ApiResponse<Object?>> applyCreditNote(
  1. ExsitedClient client,
  2. Object creditNoteId,
  3. Object payload, {
  4. bool? raiseOnError,
  5. String? responseFormat,
})

POST /api/{api_version}/credit_notes/{credit_note_id}/apply

Apply a credit note to invoices, under credit_note.invoices; it records a payment against each, and answers the credit note.

No typed view. Read response.map.

Implementation

Future<ApiResponse<Object?>> applyCreditNote(
  ExsitedClient client,
  Object creditNoteId,
  Object payload, {
  bool? raiseOnError,
  String? responseFormat,
}) =>
    client.sendPostRequest(CreditNotesUrls.creditNoteApply,
        pathParams: {'credit_note_id': creditNoteId},
        jsonBody: payload,
        raiseOnError: raiseOnError,
        responseFormat: responseFormat);