Pennylane API Client
    Preparing search index...

    Variable CustomerInvoicesApiConst

    CustomerInvoicesApi: {
        categorizeCustomerInvoice: (
            customerInvoiceId: number,
            body: CategorizeCustomerInvoiceBody,
        ) => Effect<
            readonly {
                analytical_code: string
                | null;
                category_group: { id: number };
                created_at: string;
                id: number;
                label: string;
                updated_at: string;
                weight: string;
            }[],
            CategorizeCustomerInvoiceError,
            PennylaneClient,
        >;
        createCustomerInvoice: (
            body: CreateCustomerInvoiceBody,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            CreateCustomerInvoiceError,
            PennylaneClient,
        >;
        createCustomerInvoiceFromQuote: (
            body: CreateCustomerInvoiceFromQuoteBody,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            CreateCustomerInvoiceFromQuoteError,
            PennylaneClient,
        >;
        deleteCustomerInvoice: (
            invoiceId: number,
        ) => Effect<void, DeleteCustomerInvoiceError, PennylaneClient>;
        finalizeCustomerInvoice: (
            invoiceId: number,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            FinalizeCustomerInvoiceError,
            PennylaneClient,
        >;
        getCustomerInvoice: (
            customerInvoiceId: number,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            GetCustomerInvoiceError,
            PennylaneClient,
        >;
        getCustomerInvoiceAppendices: (
            customerInvoiceId: number,
            params?: GetCustomerInvoiceAppendicesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    created_at: string;
                    filename: string;
                    id: number;
                    updated_at: string;
                    url: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoiceAppendicesError,
            PennylaneClient,
        >;
        getCustomerInvoiceCategories: (
            customerInvoiceId: number,
            params?: GetCustomerInvoiceCategoriesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    analytical_code: string
                    | null;
                    category_group: { id: number };
                    created_at: string;
                    id: number;
                    label: string;
                    updated_at: string;
                    weight: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoiceCategoriesError,
            PennylaneClient,
        >;
        getCustomerInvoiceCustomHeaderFields: (
            customerInvoiceId: number,
            params?: GetCustomerInvoiceCustomHeaderFieldsQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    created_at: string;
                    id: number;
                    rank: number;
                    title: string;
                    updated_at: string;
                    value: string
                    | null;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoiceCustomHeaderFieldsError,
            PennylaneClient,
        >;
        getCustomerInvoiceInvoiceLines: (
            customerInvoiceId: number,
            params?: GetCustomerInvoiceInvoiceLinesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    amount: string;
                    created_at: string;
                    currency_amount: string;
                    currency_amount_before_tax: string;
                    currency_tax: string;
                    description: string;
                    discount: { type: "absolute"
                    | "relative"; value: string };
                    id: number;
                    imputation_dates: { end_date: string; start_date: string } | null;
                    label: string;
                    product: { id: number; url: string } | null;
                    quantity: string;
                    raw_currency_unit_price: string;
                    section_rank: number | null;
                    tax: string;
                    unit: string | null;
                    updated_at: string;
                    vat_rate: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoiceInvoiceLinesError,
            PennylaneClient,
        >;
        getCustomerInvoiceInvoiceLineSections: (
            customerInvoiceId: number,
            params?: GetCustomerInvoiceInvoiceLineSectionsQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    created_at: string;
                    description: string
                    | null;
                    id: number;
                    rank: number;
                    title: string | null;
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoiceInvoiceLineSectionsError,
            PennylaneClient,
        >;
        getCustomerInvoiceMatchedTransactions: (
            customerInvoiceId: number,
            params?: GetCustomerInvoiceMatchedTransactionsQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    amount: string;
                    archived_at: string
                    | null;
                    attachment_required: boolean;
                    bank_account: { id: number; url: string };
                    categories: readonly {
                        analytical_code: string | null;
                        category_group: { id: number };
                        created_at: string;
                        id: number;
                        label: string;
                        updated_at: string;
                        weight: string;
                    }[];
                    created_at: string;
                    currency: string
                    | null;
                    currency_amount: string;
                    currency_fee: string | null;
                    customer: { id: number; url: string } | null;
                    date: string;
                    fee: string | null;
                    id: number;
                    journal: { id: number };
                    label: string | null;
                    outstanding_balance: string | null;
                    pro_account_expense:
                        | {
                            card_masked_number: string;
                            employee: { first_name: string; id: number; last_name: string }
                            | null;
                        }
                        | null;
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoiceMatchedTransactionsError,
            PennylaneClient,
        >;
        getCustomerInvoicePayments: (
            customerInvoiceId: number,
            params?: GetCustomerInvoicePaymentsQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    created_at: string;
                    currency: string
                    | null;
                    currency_amount: string;
                    id: number;
                    label: string;
                    status:
                        | "error"
                        | "submitted"
                        | "cancelled"
                        | "initiated"
                        | "pending"
                        | "emitted"
                        | "found"
                        | "not_found"
                        | "aborted"
                        | "refunded"
                        | "prepared"
                        | "pending_customer_approval"
                        | "pending_submission"
                        | "confirmed"
                        | "paid_out"
                        | "customer_approval_denied"
                        | "failed"
                        | "charged_back"
                        | "resubmission_requested";
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoicePaymentsError,
            PennylaneClient,
        >;
        getCustomerInvoices: (
            params?: GetCustomerInvoicesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    amount: string;
                    appendices: { url: string };
                    archived_at: string | null;
                    billing_subscription: { id: number } | null;
                    categories: { url: string };
                    created_at: string;
                    credited_invoice: { id: number; url: string } | null;
                    currency: string;
                    currency_amount: string;
                    currency_amount_before_tax: string;
                    currency_tax: string;
                    custom_header_fields: { url: string };
                    customer: { id: number; url: string } | null;
                    customer_invoice_template: { id: number } | null;
                    date: string | null;
                    deadline: string | null;
                    discount: { type: "absolute" | "relative"; value: string };
                    draft: boolean;
                    e_invoicing:
                        | {
                            reason: string
                            | null;
                            status:
                                | "accepted"
                                | "approved"
                                | "collected"
                                | "in_dispute"
                                | "partially_collected"
                                | "refused"
                                | "rejected"
                                | "sent"
                                | "submitted";
                        }
                        | null;
                    exchange_rate: string;
                    external_reference: string;
                    filename: string
                    | null;
                    id: number;
                    invoice_line_sections: { url: string };
                    invoice_lines: { url: string };
                    invoice_number: string;
                    label: string | null;
                    language: "fr_FR" | "en_GB";
                    ledger_entry: { id: number };
                    matched_transactions: { url: string };
                    paid: boolean;
                    payments: { url: string };
                    pdf_description: string | null;
                    pdf_invoice_free_text: string;
                    pdf_invoice_subject: string;
                    public_file_url: string | null;
                    quote: { id: number } | null;
                    remaining_amount_with_tax: string | null;
                    remaining_amount_without_tax: string | null;
                    special_mention: string | null;
                    status:
                        | "paid"
                        | "archived"
                        | "incomplete"
                        | "cancelled"
                        | "partially_paid"
                        | "partially_cancelled"
                        | "upcoming"
                        | "late"
                        | "draft"
                        | "credit_note";
                    tax: string;
                    transaction_reference: | {
                        banking_provider: string;
                        provider_field_name: string;
                        provider_field_value: string;
                    }
                    | null;
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetCustomerInvoicesError,
            PennylaneClient,
        >;
        importCustomerInvoice: (
            body: ImportCustomerInvoiceBody,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            ImportCustomerInvoiceError,
            PennylaneClient,
        >;
        linkCreditNote: (
            customerInvoiceId: number,
            body: LinkCreditNoteBody,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            LinkCreditNoteError,
            PennylaneClient,
        >;
        markAsPaid: (
            invoiceId: number,
        ) => Effect<void, MarkCustomerInvoiceAsPaidError, PennylaneClient>;
        sendCustomerInvoiceByEmail: (
            customerInvoiceId: number,
            body?: SendCustomerInvoiceByEmailBody,
        ) => Effect<void, SendCustomerInvoiceByEmailError, PennylaneClient>;
        updateCustomerInvoice: (
            invoiceId: number,
            body: UpdateCustomerInvoiceBody,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            UpdateCustomerInvoiceError,
            PennylaneClient,
        >;
        updateImportedCustomerInvoice: (
            invoiceId: number,
            body: UpdateImportedCustomerInvoiceBody,
        ) => Effect<
            {
                amount: string;
                appendices: { url: string };
                archived_at: string | null;
                billing_subscription: { id: number } | null;
                categories: { url: string };
                created_at: string;
                credited_invoice: { id: number; url: string } | null;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                custom_header_fields: { url: string };
                customer: { id: number; url: string } | null;
                customer_invoice_template: { id: number } | null;
                date: string | null;
                deadline: string | null;
                discount: { type: "absolute" | "relative"; value: string };
                draft: boolean;
                e_invoicing:
                    | {
                        reason: string
                        | null;
                        status:
                            | "accepted"
                            | "approved"
                            | "collected"
                            | "in_dispute"
                            | "partially_collected"
                            | "refused"
                            | "rejected"
                            | "sent"
                            | "submitted";
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                invoice_line_sections: { url: string };
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                language: "fr_FR" | "en_GB";
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payments: { url: string };
                pdf_description: string | null;
                pdf_invoice_free_text: string;
                pdf_invoice_subject: string;
                public_file_url: string | null;
                quote: { id: number } | null;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                special_mention: string | null;
                status:
                    | "paid"
                    | "archived"
                    | "incomplete"
                    | "cancelled"
                    | "partially_paid"
                    | "partially_cancelled"
                    | "upcoming"
                    | "late"
                    | "draft"
                    | "credit_note";
                tax: string;
                transaction_reference: | {
                    banking_provider: string;
                    provider_field_name: string;
                    provider_field_value: string;
                }
                | null;
                updated_at: string;
            },
            UpdateImportedCustomerInvoiceError,
            PennylaneClient,
        >;
        uploadCustomerInvoiceAppendix: (
            customerInvoiceId: number,
            body: UploadCustomerInvoiceAppendixBody,
        ) => Effect<
            {
                created_at: string;
                filename: string;
                id: number;
                updated_at: string;
                url: string;
            },
            UploadCustomerInvoiceAppendixError,
            PennylaneClient,
        >;
    } = ...

    Service containing methods for the "customer_invoices" endpoints.

    Type Declaration

    • categorizeCustomerInvoice: (
          customerInvoiceId: number,
          body: CategorizeCustomerInvoiceBody,
      ) => Effect<
          readonly {
              analytical_code: string
              | null;
              category_group: { id: number };
              created_at: string;
              id: number;
              label: string;
              updated_at: string;
              weight: string;
          }[],
          CategorizeCustomerInvoiceError,
          PennylaneClient,
      >

      Categorizes a customer invoice.

      This endpoint is not applicable for draft invoices.

      Possible errors:

      • CategorizeCustomerInvoiceBadRequest (400): Missing or invalid request parameters
      • CategorizeCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • CategorizeCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • CategorizeCustomerInvoiceNotFound (404): Invoice not found
      • CategorizeCustomerInvoiceUnprocessableEntity (422): Request rejected by business validation
    • createCustomerInvoice: (
          body: CreateCustomerInvoiceBody,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          CreateCustomerInvoiceError,
          PennylaneClient,
      >

      Creates a draft or finalized customer invoice (or credit note).

      Possible errors:

      • CreateCustomerInvoiceBadRequest (400): Missing or invalid request body
      • CreateCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • CreateCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • CreateCustomerInvoiceNotFound (404): Related resource not found
      • CreateCustomerInvoiceUnprocessableEntity (422): Request rejected by business validation
    • createCustomerInvoiceFromQuote: (
          body: CreateCustomerInvoiceFromQuoteBody,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          CreateCustomerInvoiceFromQuoteError,
          PennylaneClient,
      >

      Creates a customer invoice from an existing quote.

      The invoice will inherit the quote's data (customer, lines, etc.).

      Possible errors:

      • CreateCustomerInvoiceFromQuoteBadRequest (400): Missing or invalid request parameters
      • CreateCustomerInvoiceFromQuoteUnauthorized (401): Invalid or missing API key
      • CreateCustomerInvoiceFromQuoteForbidden (403): Insufficient permissions for this operation
      • CreateCustomerInvoiceFromQuoteNotFound (404): Quote not found
      • CreateCustomerInvoiceFromQuoteUnprocessableEntity (422): Request rejected by business validation
    • deleteCustomerInvoice: (invoiceId: number) => Effect<void, DeleteCustomerInvoiceError, PennylaneClient>

      Deletes a draft customer invoice or draft credit note.

      Possible errors:

      • DeleteCustomerInvoiceBadRequest (400): Bad request
      • DeleteCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • DeleteCustomerInvoiceForbidden (403): Insufficient permissions
      • DeleteCustomerInvoiceNotFound (404): Resource not found
      • DeleteCustomerInvoiceUnprocessableEntity (422): Unprocessable content
    • finalizeCustomerInvoice: (
          invoiceId: number,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          FinalizeCustomerInvoiceError,
          PennylaneClient,
      >

      Turns a draft customer invoice or credit note into a finalized one.

      Once finalized, the resource can no longer be edited.

      Possible errors:

      • FinalizeCustomerInvoiceBadRequest (400): Missing or invalid request parameters
      • FinalizeCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • FinalizeCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • FinalizeCustomerInvoiceNotFound (404): Invoice not found
      • FinalizeCustomerInvoiceUnprocessableEntity (422): Request rejected by business validation
    • getCustomerInvoice: (
          customerInvoiceId: number,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          GetCustomerInvoiceError,
          PennylaneClient,
      >

      Retrieves a single customer invoice or credit note by ID.

      Possible errors:

      • GetCustomerInvoiceBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceNotFound (404): Invoice not found
    • getCustomerInvoiceAppendices: (
          customerInvoiceId: number,
          params?: GetCustomerInvoiceAppendicesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  created_at: string;
                  filename: string;
                  id: number;
                  updated_at: string;
                  url: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoiceAppendicesError,
          PennylaneClient,
      >

      Retrieves a list of appendices for a specific customer invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetCustomerInvoiceAppendicesBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceAppendicesUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceAppendicesForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceAppendicesNotFound (404): Invoice not found
    • getCustomerInvoiceCategories: (
          customerInvoiceId: number,
          params?: GetCustomerInvoiceCategoriesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  analytical_code: string
                  | null;
                  category_group: { id: number };
                  created_at: string;
                  id: number;
                  label: string;
                  updated_at: string;
                  weight: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoiceCategoriesError,
          PennylaneClient,
      >

      Retrieves a list of categories for a specific customer invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetCustomerInvoiceCategoriesBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceCategoriesUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceCategoriesForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceCategoriesNotFound (404): Invoice not found
    • getCustomerInvoiceCustomHeaderFields: (
          customerInvoiceId: number,
          params?: GetCustomerInvoiceCustomHeaderFieldsQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  created_at: string;
                  id: number;
                  rank: number;
                  title: string;
                  updated_at: string;
                  value: string
                  | null;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoiceCustomHeaderFieldsError,
          PennylaneClient,
      >

      Lists custom header fields for a customer invoice.

      Possible errors:

      • GetCustomerInvoiceCustomHeaderFieldsBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceCustomHeaderFieldsUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceCustomHeaderFieldsForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceCustomHeaderFieldsNotFound (404): Invoice not found
    • getCustomerInvoiceInvoiceLines: (
          customerInvoiceId: number,
          params?: GetCustomerInvoiceInvoiceLinesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  amount: string;
                  created_at: string;
                  currency_amount: string;
                  currency_amount_before_tax: string;
                  currency_tax: string;
                  description: string;
                  discount: { type: "absolute"
                  | "relative"; value: string };
                  id: number;
                  imputation_dates: { end_date: string; start_date: string } | null;
                  label: string;
                  product: { id: number; url: string } | null;
                  quantity: string;
                  raw_currency_unit_price: string;
                  section_rank: number | null;
                  tax: string;
                  unit: string | null;
                  updated_at: string;
                  vat_rate: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoiceInvoiceLinesError,
          PennylaneClient,
      >

      Retrieves a list of invoice lines for a specific customer invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetCustomerInvoiceInvoiceLinesBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceInvoiceLinesUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceInvoiceLinesForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceInvoiceLinesNotFound (404): Invoice not found
    • getCustomerInvoiceInvoiceLineSections: (
          customerInvoiceId: number,
          params?: GetCustomerInvoiceInvoiceLineSectionsQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  created_at: string;
                  description: string
                  | null;
                  id: number;
                  rank: number;
                  title: string | null;
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoiceInvoiceLineSectionsError,
          PennylaneClient,
      >

      Retrieves a list of invoice line sections for a specific customer invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetCustomerInvoiceInvoiceLineSectionsBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceInvoiceLineSectionsUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceInvoiceLineSectionsForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceInvoiceLineSectionsNotFound (404): Invoice not found
      // Get first page of invoice line sections
      yield* CustomerInvoicesApi.getCustomerInvoiceInvoiceLineSections(1234, { limit: 20 })

      // Get next page using cursor
      yield* CustomerInvoicesApi.getCustomerInvoiceInvoiceLineSections(1234, {
      cursor: "MjAyNS0wMS0wOVQwODoyNDozOC44MTI0NTha"
      })

      // Sort by ID in descending order
      yield* CustomerInvoicesApi.getCustomerInvoiceInvoiceLineSections(1234, { sort: "-id" })
    • getCustomerInvoiceMatchedTransactions: (
          customerInvoiceId: number,
          params?: GetCustomerInvoiceMatchedTransactionsQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  amount: string;
                  archived_at: string
                  | null;
                  attachment_required: boolean;
                  bank_account: { id: number; url: string };
                  categories: readonly {
                      analytical_code: string | null;
                      category_group: { id: number };
                      created_at: string;
                      id: number;
                      label: string;
                      updated_at: string;
                      weight: string;
                  }[];
                  created_at: string;
                  currency: string
                  | null;
                  currency_amount: string;
                  currency_fee: string | null;
                  customer: { id: number; url: string } | null;
                  date: string;
                  fee: string | null;
                  id: number;
                  journal: { id: number };
                  label: string | null;
                  outstanding_balance: string | null;
                  pro_account_expense:
                      | {
                          card_masked_number: string;
                          employee: { first_name: string; id: number; last_name: string }
                          | null;
                      }
                      | null;
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoiceMatchedTransactionsError,
          PennylaneClient,
      >

      Retrieves a list of matched transactions for a specific customer invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetCustomerInvoiceMatchedTransactionsBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoiceMatchedTransactionsUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoiceMatchedTransactionsForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoiceMatchedTransactionsNotFound (404): Invoice not found
    • getCustomerInvoicePayments: (
          customerInvoiceId: number,
          params?: GetCustomerInvoicePaymentsQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  created_at: string;
                  currency: string
                  | null;
                  currency_amount: string;
                  id: number;
                  label: string;
                  status:
                      | "error"
                      | "submitted"
                      | "cancelled"
                      | "initiated"
                      | "pending"
                      | "emitted"
                      | "found"
                      | "not_found"
                      | "aborted"
                      | "refunded"
                      | "prepared"
                      | "pending_customer_approval"
                      | "pending_submission"
                      | "confirmed"
                      | "paid_out"
                      | "customer_approval_denied"
                      | "failed"
                      | "charged_back"
                      | "resubmission_requested";
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoicePaymentsError,
          PennylaneClient,
      >

      Retrieves a list of payments for a specific customer invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetCustomerInvoicePaymentsBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoicePaymentsUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoicePaymentsForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoicePaymentsNotFound (404): Invoice not found
    • getCustomerInvoices: (
          params?: GetCustomerInvoicesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  amount: string;
                  appendices: { url: string };
                  archived_at: string | null;
                  billing_subscription: { id: number } | null;
                  categories: { url: string };
                  created_at: string;
                  credited_invoice: { id: number; url: string } | null;
                  currency: string;
                  currency_amount: string;
                  currency_amount_before_tax: string;
                  currency_tax: string;
                  custom_header_fields: { url: string };
                  customer: { id: number; url: string } | null;
                  customer_invoice_template: { id: number } | null;
                  date: string | null;
                  deadline: string | null;
                  discount: { type: "absolute" | "relative"; value: string };
                  draft: boolean;
                  e_invoicing:
                      | {
                          reason: string
                          | null;
                          status:
                              | "accepted"
                              | "approved"
                              | "collected"
                              | "in_dispute"
                              | "partially_collected"
                              | "refused"
                              | "rejected"
                              | "sent"
                              | "submitted";
                      }
                      | null;
                  exchange_rate: string;
                  external_reference: string;
                  filename: string
                  | null;
                  id: number;
                  invoice_line_sections: { url: string };
                  invoice_lines: { url: string };
                  invoice_number: string;
                  label: string | null;
                  language: "fr_FR" | "en_GB";
                  ledger_entry: { id: number };
                  matched_transactions: { url: string };
                  paid: boolean;
                  payments: { url: string };
                  pdf_description: string | null;
                  pdf_invoice_free_text: string;
                  pdf_invoice_subject: string;
                  public_file_url: string | null;
                  quote: { id: number } | null;
                  remaining_amount_with_tax: string | null;
                  remaining_amount_without_tax: string | null;
                  special_mention: string | null;
                  status:
                      | "paid"
                      | "archived"
                      | "incomplete"
                      | "cancelled"
                      | "partially_paid"
                      | "partially_cancelled"
                      | "upcoming"
                      | "late"
                      | "draft"
                      | "credit_note";
                  tax: string;
                  transaction_reference: | {
                      banking_provider: string;
                      provider_field_name: string;
                      provider_field_value: string;
                  }
                  | null;
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetCustomerInvoicesError,
          PennylaneClient,
      >

      Retrieves a list of customer invoices and credit notes.

      Uses v2026 cursor-based pagination.

      Possible errors:

      • GetCustomerInvoicesBadRequest (400): Missing or invalid query parameters
      • GetCustomerInvoicesUnauthorized (401): Invalid or missing API key
      • GetCustomerInvoicesForbidden (403): Insufficient permissions for this operation
      • GetCustomerInvoicesNotFound (404): Not found
      // Get first page of invoices
      yield* CustomerInvoicesApi.getCustomerInvoices({ limit: 20 })

      // Get next page using cursor
      yield* CustomerInvoicesApi.getCustomerInvoices({ cursor: "MjAyNS0wMS0wOVQwODoyNDozOC44MTI0NTha" })

      // Filter invoices by customer and status
      yield* CustomerInvoicesApi.getCustomerInvoices({
      filter: [
      { field: "customer_id", operator: "eq", value: "123" },
      { field: "draft", operator: "eq", value: "false" }
      ]
      })
    • importCustomerInvoice: (
          body: ImportCustomerInvoiceBody,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          ImportCustomerInvoiceError,
          PennylaneClient,
      >

      Imports a customer invoice with a previously uploaded attached file.

      Possible errors:

      • ImportCustomerInvoiceBadRequest (400): Missing or invalid request body
      • ImportCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • ImportCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • ImportCustomerInvoiceNotFound (404): Related resource not found
      • ImportCustomerInvoiceConflict (409): Conflict with current resource state
      • ImportCustomerInvoiceUnprocessableEntity (422): Request rejected by business validation
    • linkCreditNote: (
          customerInvoiceId: number,
          body: LinkCreditNoteBody,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          LinkCreditNoteError,
          PennylaneClient,
      >

      Links a credit note to a customer invoice.

      Possible errors:

      • LinkCreditNoteBadRequest (400): Missing or invalid request parameters
      • LinkCreditNoteUnauthorized (401): Invalid or missing API key
      • LinkCreditNoteForbidden (403): Insufficient permissions for this operation
      • LinkCreditNoteNotFound (404): Invoice or credit note not found
      • LinkCreditNoteUnprocessableEntity (422): Request rejected by business validation
    • markAsPaid: (
          invoiceId: number,
      ) => Effect<void, MarkCustomerInvoiceAsPaidError, PennylaneClient>

      Marks a customer invoice as paid. No automatic reconciliation will be done once the invoice is marked as paid.

    • sendCustomerInvoiceByEmail: (
          customerInvoiceId: number,
          body?: SendCustomerInvoiceByEmailBody,
      ) => Effect<void, SendCustomerInvoiceByEmailError, PennylaneClient>

      Sends a customer invoice or credit note by email.

      Possible errors:

      • SendCustomerInvoiceByEmailBadRequest (400): Missing or invalid request body
      • SendCustomerInvoiceByEmailUnauthorized (401): Invalid or missing API key
      • SendCustomerInvoiceByEmailForbidden (403): Insufficient permissions for this operation
      • SendCustomerInvoiceByEmailNotFound (404): Invoice not found
      • SendCustomerInvoiceByEmailConflict (409): Invoice PDF is not ready yet, retry later
      • SendCustomerInvoiceByEmailUnprocessableEntity (422): Request rejected by business validation
    • updateCustomerInvoice: (
          invoiceId: number,
          body: UpdateCustomerInvoiceBody,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          UpdateCustomerInvoiceError,
          PennylaneClient,
      >

      Updates a customer invoice.

      Supports two modes depending on the invoice state:

      • Draft invoice: update customer, dates, lines (create/update/delete), currency, etc.
      • Finalized invoice: update transaction reference, update line imputation dates.

      Possible errors:

      • UpdateCustomerInvoiceBadRequest (400): Missing or invalid request body
      • UpdateCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • UpdateCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • UpdateCustomerInvoiceNotFound (404): Invoice not found
      • UpdateCustomerInvoiceUnprocessableEntity (422): Request rejected by business validation
    • updateImportedCustomerInvoice: (
          invoiceId: number,
          body: UpdateImportedCustomerInvoiceBody,
      ) => Effect<
          {
              amount: string;
              appendices: { url: string };
              archived_at: string | null;
              billing_subscription: { id: number } | null;
              categories: { url: string };
              created_at: string;
              credited_invoice: { id: number; url: string } | null;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              custom_header_fields: { url: string };
              customer: { id: number; url: string } | null;
              customer_invoice_template: { id: number } | null;
              date: string | null;
              deadline: string | null;
              discount: { type: "absolute" | "relative"; value: string };
              draft: boolean;
              e_invoicing:
                  | {
                      reason: string
                      | null;
                      status:
                          | "accepted"
                          | "approved"
                          | "collected"
                          | "in_dispute"
                          | "partially_collected"
                          | "refused"
                          | "rejected"
                          | "sent"
                          | "submitted";
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              invoice_line_sections: { url: string };
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              language: "fr_FR" | "en_GB";
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payments: { url: string };
              pdf_description: string | null;
              pdf_invoice_free_text: string;
              pdf_invoice_subject: string;
              public_file_url: string | null;
              quote: { id: number } | null;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              special_mention: string | null;
              status:
                  | "paid"
                  | "archived"
                  | "incomplete"
                  | "cancelled"
                  | "partially_paid"
                  | "partially_cancelled"
                  | "upcoming"
                  | "late"
                  | "draft"
                  | "credit_note";
              tax: string;
              transaction_reference: | {
                  banking_provider: string;
                  provider_field_name: string;
                  provider_field_value: string;
              }
              | null;
              updated_at: string;
          },
          UpdateImportedCustomerInvoiceError,
          PennylaneClient,
      >

      Updates an imported customer invoice or credit note.

      This endpoint is not applicable for draft invoices.

      Possible errors:

      • UpdateImportedCustomerInvoiceBadRequest (400): Missing or invalid request body
      • UpdateImportedCustomerInvoiceUnauthorized (401): Invalid or missing API key
      • UpdateImportedCustomerInvoiceForbidden (403): Insufficient permissions for this operation
      • UpdateImportedCustomerInvoiceNotFound (404): Invoice not found
      • UpdateImportedCustomerInvoiceUnprocessableEntity (422): Request rejected by business validation
    • uploadCustomerInvoiceAppendix: (
          customerInvoiceId: number,
          body: UploadCustomerInvoiceAppendixBody,
      ) => Effect<
          {
              created_at: string;
              filename: string;
              id: number;
              updated_at: string;
              url: string;
          },
          UploadCustomerInvoiceAppendixError,
          PennylaneClient,
      >

      Uploads an appendix file for a specific customer invoice.

      Possible errors:

      • UploadCustomerInvoiceAppendixBadRequest (400): Missing or invalid request body
      • UploadCustomerInvoiceAppendixUnauthorized (401): Invalid or missing API key
      • UploadCustomerInvoiceAppendixForbidden (403): Insufficient permissions for this operation
      • UploadCustomerInvoiceAppendixNotFound (404): Invoice not found
      • UploadCustomerInvoiceAppendixUnprocessableEntity (422): Upload rejected by business validation