Pennylane API Client
    Preparing search index...

    Variable SupplierInvoicesApiConst

    SupplierInvoicesApi: {
        getSupplierInvoice: (
            id: number,
        ) => Effect<
            {
                accounting_status: | "archived"
                | "draft"
                | "entry"
                | "validation_needed"
                | "complete";
                amount: string;
                archived_at: string
                | null;
                categories: { url: string };
                created_at: string;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                date: string | null;
                deadline: string | null;
                e_invoicing:
                    | {
                        electronic_billing_address: string
                        | null;
                        flow: { id: string } | null;
                        reason: string | null;
                        source_file_url: string | null;
                        status: string | null;
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                import_source: { path: string; source: "dropbox" | "gdrive" } | null;
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payment_method_ledger_account: { id: number; url: string } | null;
                payment_status:
                    | "partially_paid"
                    | "to_be_processed"
                    | "to_be_paid"
                    | "payment_error"
                    | "payment_scheduled"
                    | "payment_in_progress"
                    | "payment_emitted"
                    | "payment_found"
                    | "paid_offline"
                    | "fully_paid";
                payments: { url: string };
                performance_date: string | null;
                public_file_url: string | null;
                reconciled: boolean;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                supplier: { id: number; url: string } | null;
                tax: string;
                transaction_reference:
                    | {
                        banking_provider: string;
                        provider_field_name: string;
                        provider_field_value: string;
                    }
                    | null;
                updated_at: string;
            },
            GetSupplierInvoiceError,
            PennylaneClient,
        >;
        getSupplierInvoiceMatchedTransactions: (
            supplierInvoiceId: number,
            params?: GetSupplierInvoiceMatchedTransactionsQueryParams,
        ) => 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;
                    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;
                    supplier: { id: number; url: string }
                    | null;
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetSupplierInvoiceMatchedTransactionsError,
            PennylaneClient,
        >;
        getSupplierInvoices: (
            params?: GetSupplierInvoicesQueryParams,
        ) => Effect<
            {
                has_more: boolean;
                items: readonly {
                    accounting_status: | "archived"
                    | "draft"
                    | "entry"
                    | "validation_needed"
                    | "complete";
                    amount: string;
                    archived_at: string
                    | null;
                    categories: { url: string };
                    created_at: string;
                    currency: string;
                    currency_amount: string;
                    currency_amount_before_tax: string;
                    currency_tax: string;
                    date: string | null;
                    deadline: string | null;
                    e_invoicing:
                        | {
                            electronic_billing_address: string
                            | null;
                            flow: { id: string } | null;
                            reason: string | null;
                            source_file_url: string | null;
                            status: string | null;
                        }
                        | null;
                    exchange_rate: string;
                    external_reference: string;
                    filename: string
                    | null;
                    id: number;
                    import_source: { path: string; source: "dropbox" | "gdrive" } | null;
                    invoice_lines: { url: string };
                    invoice_number: string;
                    label: string | null;
                    ledger_entry: { id: number };
                    matched_transactions: { url: string };
                    paid: boolean;
                    payment_method_ledger_account: { id: number; url: string } | null;
                    payment_status:
                        | "partially_paid"
                        | "to_be_processed"
                        | "to_be_paid"
                        | "payment_error"
                        | "payment_scheduled"
                        | "payment_in_progress"
                        | "payment_emitted"
                        | "payment_found"
                        | "paid_offline"
                        | "fully_paid";
                    payments: { url: string };
                    performance_date: string | null;
                    public_file_url: string | null;
                    reconciled: boolean;
                    remaining_amount_with_tax: string | null;
                    remaining_amount_without_tax: string | null;
                    supplier: { id: number; url: string } | null;
                    tax: string;
                    transaction_reference:
                        | {
                            banking_provider: string;
                            provider_field_name: string;
                            provider_field_value: string;
                        }
                        | null;
                    updated_at: string;
                }[];
                next_cursor?: string
                | null;
            },
            GetSupplierInvoicesError,
            PennylaneClient,
        >;
        importSupplierInvoice: (
            body: ImportSupplierInvoiceBody,
        ) => Effect<
            {
                accounting_status: | "archived"
                | "draft"
                | "entry"
                | "validation_needed"
                | "complete";
                amount: string;
                archived_at: string
                | null;
                categories: { url: string };
                created_at: string;
                currency: string;
                currency_amount: string;
                currency_amount_before_tax: string;
                currency_tax: string;
                date: string | null;
                deadline: string | null;
                e_invoicing:
                    | {
                        electronic_billing_address: string
                        | null;
                        flow: { id: string } | null;
                        reason: string | null;
                        source_file_url: string | null;
                        status: string | null;
                    }
                    | null;
                exchange_rate: string;
                external_reference: string;
                filename: string
                | null;
                id: number;
                import_source: { path: string; source: "dropbox" | "gdrive" } | null;
                invoice_lines: { url: string };
                invoice_number: string;
                label: string | null;
                ledger_entry: { id: number };
                matched_transactions: { url: string };
                paid: boolean;
                payment_method_ledger_account: { id: number; url: string } | null;
                payment_status:
                    | "partially_paid"
                    | "to_be_processed"
                    | "to_be_paid"
                    | "payment_error"
                    | "payment_scheduled"
                    | "payment_in_progress"
                    | "payment_emitted"
                    | "payment_found"
                    | "paid_offline"
                    | "fully_paid";
                payments: { url: string };
                performance_date: string | null;
                public_file_url: string | null;
                reconciled: boolean;
                remaining_amount_with_tax: string | null;
                remaining_amount_without_tax: string | null;
                supplier: { id: number; url: string } | null;
                tax: string;
                transaction_reference:
                    | {
                        banking_provider: string;
                        provider_field_name: string;
                        provider_field_value: string;
                    }
                    | null;
                updated_at: string;
            },
            ImportSupplierInvoiceError,
            PennylaneClient,
        >;
        matchSupplierInvoiceTransaction: (
            supplierInvoiceId: number,
            transactionId: number,
        ) => Effect<void, MatchSupplierInvoiceTransactionError, PennylaneClient>;
        unmatchSupplierInvoiceTransaction: (
            supplierInvoiceId: number,
            transactionId: number,
        ) => Effect<void, UnmatchSupplierInvoiceTransactionError, PennylaneClient>;
    } = ...

    Service containing methods for the "supplier_invoices" endpoints.

    Type Declaration

    • getSupplierInvoice: (
          id: number,
      ) => Effect<
          {
              accounting_status: | "archived"
              | "draft"
              | "entry"
              | "validation_needed"
              | "complete";
              amount: string;
              archived_at: string
              | null;
              categories: { url: string };
              created_at: string;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              date: string | null;
              deadline: string | null;
              e_invoicing:
                  | {
                      electronic_billing_address: string
                      | null;
                      flow: { id: string } | null;
                      reason: string | null;
                      source_file_url: string | null;
                      status: string | null;
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              import_source: { path: string; source: "dropbox" | "gdrive" } | null;
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payment_method_ledger_account: { id: number; url: string } | null;
              payment_status:
                  | "partially_paid"
                  | "to_be_processed"
                  | "to_be_paid"
                  | "payment_error"
                  | "payment_scheduled"
                  | "payment_in_progress"
                  | "payment_emitted"
                  | "payment_found"
                  | "paid_offline"
                  | "fully_paid";
              payments: { url: string };
              performance_date: string | null;
              public_file_url: string | null;
              reconciled: boolean;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              supplier: { id: number; url: string } | null;
              tax: string;
              transaction_reference:
                  | {
                      banking_provider: string;
                      provider_field_name: string;
                      provider_field_value: string;
                  }
                  | null;
              updated_at: string;
          },
          GetSupplierInvoiceError,
          PennylaneClient,
      >

      Retrieves a single supplier invoice by its identifier.

      Possible errors:

      • GetSupplierInvoiceBadRequest (400): Invalid request
      • GetSupplierInvoiceUnauthorized (401): Invalid or missing API key
      • GetSupplierInvoiceForbidden (403): Insufficient permissions for this operation
      • GetSupplierInvoiceNotFound (404): Supplier invoice not found
    • getSupplierInvoiceMatchedTransactions: (
          supplierInvoiceId: number,
          params?: GetSupplierInvoiceMatchedTransactionsQueryParams,
      ) => 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;
                  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;
                  supplier: { id: number; url: string }
                  | null;
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetSupplierInvoiceMatchedTransactionsError,
          PennylaneClient,
      >

      Retrieves the bank transactions matched to a supplier invoice.

      Uses cursor-based pagination.

      Possible errors:

      • GetSupplierInvoiceMatchedTransactionsBadRequest (400): Missing or invalid query parameters
      • GetSupplierInvoiceMatchedTransactionsUnauthorized (401): Invalid or missing API key
      • GetSupplierInvoiceMatchedTransactionsForbidden (403): Insufficient permissions for this operation
      • GetSupplierInvoiceMatchedTransactionsNotFound (404): Supplier invoice not found
    • getSupplierInvoices: (
          params?: GetSupplierInvoicesQueryParams,
      ) => Effect<
          {
              has_more: boolean;
              items: readonly {
                  accounting_status: | "archived"
                  | "draft"
                  | "entry"
                  | "validation_needed"
                  | "complete";
                  amount: string;
                  archived_at: string
                  | null;
                  categories: { url: string };
                  created_at: string;
                  currency: string;
                  currency_amount: string;
                  currency_amount_before_tax: string;
                  currency_tax: string;
                  date: string | null;
                  deadline: string | null;
                  e_invoicing:
                      | {
                          electronic_billing_address: string
                          | null;
                          flow: { id: string } | null;
                          reason: string | null;
                          source_file_url: string | null;
                          status: string | null;
                      }
                      | null;
                  exchange_rate: string;
                  external_reference: string;
                  filename: string
                  | null;
                  id: number;
                  import_source: { path: string; source: "dropbox" | "gdrive" } | null;
                  invoice_lines: { url: string };
                  invoice_number: string;
                  label: string | null;
                  ledger_entry: { id: number };
                  matched_transactions: { url: string };
                  paid: boolean;
                  payment_method_ledger_account: { id: number; url: string } | null;
                  payment_status:
                      | "partially_paid"
                      | "to_be_processed"
                      | "to_be_paid"
                      | "payment_error"
                      | "payment_scheduled"
                      | "payment_in_progress"
                      | "payment_emitted"
                      | "payment_found"
                      | "paid_offline"
                      | "fully_paid";
                  payments: { url: string };
                  performance_date: string | null;
                  public_file_url: string | null;
                  reconciled: boolean;
                  remaining_amount_with_tax: string | null;
                  remaining_amount_without_tax: string | null;
                  supplier: { id: number; url: string } | null;
                  tax: string;
                  transaction_reference:
                      | {
                          banking_provider: string;
                          provider_field_name: string;
                          provider_field_value: string;
                      }
                      | null;
                  updated_at: string;
              }[];
              next_cursor?: string
              | null;
          },
          GetSupplierInvoicesError,
          PennylaneClient,
      >

      Retrieves a list of supplier invoices.

      Uses cursor-based pagination.

      Possible errors:

      • GetSupplierInvoicesBadRequest (400): Missing or invalid query parameters
      • GetSupplierInvoicesUnauthorized (401): Invalid or missing API key
      • GetSupplierInvoicesForbidden (403): Insufficient permissions for this operation
      • GetSupplierInvoicesNotFound (404): Resource not found
    • importSupplierInvoice: (
          body: ImportSupplierInvoiceBody,
      ) => Effect<
          {
              accounting_status: | "archived"
              | "draft"
              | "entry"
              | "validation_needed"
              | "complete";
              amount: string;
              archived_at: string
              | null;
              categories: { url: string };
              created_at: string;
              currency: string;
              currency_amount: string;
              currency_amount_before_tax: string;
              currency_tax: string;
              date: string | null;
              deadline: string | null;
              e_invoicing:
                  | {
                      electronic_billing_address: string
                      | null;
                      flow: { id: string } | null;
                      reason: string | null;
                      source_file_url: string | null;
                      status: string | null;
                  }
                  | null;
              exchange_rate: string;
              external_reference: string;
              filename: string
              | null;
              id: number;
              import_source: { path: string; source: "dropbox" | "gdrive" } | null;
              invoice_lines: { url: string };
              invoice_number: string;
              label: string | null;
              ledger_entry: { id: number };
              matched_transactions: { url: string };
              paid: boolean;
              payment_method_ledger_account: { id: number; url: string } | null;
              payment_status:
                  | "partially_paid"
                  | "to_be_processed"
                  | "to_be_paid"
                  | "payment_error"
                  | "payment_scheduled"
                  | "payment_in_progress"
                  | "payment_emitted"
                  | "payment_found"
                  | "paid_offline"
                  | "fully_paid";
              payments: { url: string };
              performance_date: string | null;
              public_file_url: string | null;
              reconciled: boolean;
              remaining_amount_with_tax: string | null;
              remaining_amount_without_tax: string | null;
              supplier: { id: number; url: string } | null;
              tax: string;
              transaction_reference:
                  | {
                      banking_provider: string;
                      provider_field_name: string;
                      provider_field_value: string;
                  }
                  | null;
              updated_at: string;
          },
          ImportSupplierInvoiceError,
          PennylaneClient,
      >

      Imports a supplier invoice with a previously uploaded file attached.

      Upload the file first with FileAttachmentsApi.uploadFileAttachment, then pass its id as file_attachment_id.

      Possible errors:

      • ImportSupplierInvoiceBadRequest (400): Missing or invalid request body
      • ImportSupplierInvoiceUnauthorized (401): Invalid or missing API key
      • ImportSupplierInvoiceForbidden (403): Insufficient permissions (supplier_invoices:all scope required)
      • ImportSupplierInvoiceNotFound (404): Supplier or file attachment not found
      • ImportSupplierInvoiceConflict (409): File attachment not available yet, retry after a few seconds
      • ImportSupplierInvoiceUnprocessableEntity (422): Request rejected by business validation
    • matchSupplierInvoiceTransaction: (
          supplierInvoiceId: number,
          transactionId: number,
      ) => Effect<void, MatchSupplierInvoiceTransactionError, PennylaneClient>

      Matches a bank transaction to a supplier invoice (justifies the transaction).

      Possible errors:

      • MatchSupplierInvoiceTransactionBadRequest (400): Missing or invalid request body
      • MatchSupplierInvoiceTransactionUnauthorized (401): Invalid or missing API key
      • MatchSupplierInvoiceTransactionForbidden (403): Insufficient permissions (supplier_invoices:all scope required)
      • MatchSupplierInvoiceTransactionNotFound (404): Supplier invoice or transaction not found
      • MatchSupplierInvoiceTransactionUnprocessableEntity (422): Matching rejected by business validation
    • unmatchSupplierInvoiceTransaction: (
          supplierInvoiceId: number,
          transactionId: number,
      ) => Effect<void, UnmatchSupplierInvoiceTransactionError, PennylaneClient>

      Unmatches a bank transaction from a supplier invoice.

      Possible errors:

      • UnmatchSupplierInvoiceTransactionBadRequest (400): Invalid request
      • UnmatchSupplierInvoiceTransactionUnauthorized (401): Invalid or missing API key
      • UnmatchSupplierInvoiceTransactionForbidden (403): Insufficient permissions (supplier_invoices:all scope required)
      • UnmatchSupplierInvoiceTransactionNotFound (404): Supplier invoice or matched transaction not found
      • UnmatchSupplierInvoiceTransactionUnprocessableEntity (422): Unmatching rejected by business validation