/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { creditNotesCreateCreditNote } from "../funcs/credit-notes-create-credit-note.js"; import { creditNotesGetCreditNote } from "../funcs/credit-notes-get-credit-note.js"; import { creditNotesProcessCreditNote } from "../funcs/credit-notes-process-credit-note.js"; import { creditNotesVoidCreditNote } from "../funcs/credit-notes-void-credit-note.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class CreditNotes extends ClientSDK { /** * Create credit note * * @remarks * Use when issuing a refund or adjustment (e.g. customer dispute or proration). Links to an invoice; create as draft then finalize. */ async createCreditNote( request: models.CreateCreditNoteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(creditNotesCreateCreditNote( this, request, options, )); } /** * Get credit note * * @remarks * Use when you need to load a single credit note (e.g. for display or reconciliation). */ async getCreditNote( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(creditNotesGetCreditNote( this, id, options, )); } /** * Finalize credit note * * @remarks * Use when locking a draft credit note and applying the credit (e.g. after approval). Once finalized, applied per billing provider. */ async processCreditNote( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(creditNotesProcessCreditNote( this, id, options, )); } /** * Void credit note * * @remarks * Use when cancelling a draft credit note (e.g. created by mistake). Only draft credit notes can be voided. */ async voidCreditNote( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(creditNotesVoidCreditNote( this, id, options, )); } }