The AP_INVOICES_ALL table is one of the most important tables in Oracle Fusion Financials, particularly within the Payables (AP) module. This table serves as the foundational dataset for storing supplier invoice header information and is frequently referenced in financial reporting, reconciliation processes, and compliance analysis.
In Oracle Fusion environments, supplier invoices represent the primary financial obligation toward vendors. The AP_INVOICES_ALL table therefore becomes central to any reporting or analysis related to accounts payable transactions.
Organizations commonly rely on this table for multiple reporting scenarios including:
| Use Case | Description |
|---|---|
| Supplier invoice reporting | Generating reports for invoices received from vendors. |
| AP reconciliation | Reconciling invoice balances with payments and accounting entries. |
| Audit and compliance extracts | Extracting invoice data for regulatory or audit purposes. |
Common developer challenges when working with AP invoice data:
- Duplicate invoice rows
- Incorrect joins to supplier or purchase order tables
- Confusion between INVOICE_ID and INVOICE_NUM
This article provides a complete technical reference for the AP_INVOICES_ALL table, explaining its structure, key columns, common joins, reporting use cases, and SQL best practices. The goal is to help developers build accurate and performant SQL queries for supplier invoice reporting in Oracle Fusion.
For additional reference on Oracle Payables data structures, Oracle’s official documentation provides a useful overview of the module architecture.
What Is AP_INVOICES_ALL?
The AP_INVOICES_ALL table is the primary table used to store supplier invoice header information in the Oracle Fusion Payables (AP) module. Each record in this table represents a single supplier invoice entered into the system.
The table captures high-level attributes describing the invoice, including the invoice number, supplier reference, invoice date, invoice amount, and the business unit responsible for the transaction.
Oracle Fusion stores invoice data using a header–line data model. In this design, general invoice information is stored separately from detailed transactional information.
The AP_INVOICES_ALL table therefore stores only the invoice header, while detailed invoice line information is stored in a related table.
The relationship between the primary invoice tables can be summarized below.
| Table Name | Purpose |
|---|---|
| AP_INVOICES_ALL | Stores supplier invoice header information |
| AP_INVOICE_LINES_ALL | Stores invoice line details such as items, quantities, and line amounts |
| AP_INVOICE_DISTRIBUTIONS_ALL | Stores accounting distributions associated with invoice lines |
Because the AP_INVOICES_ALL table contains the header-level representation of invoices, it typically serves as the starting point for supplier invoice reporting queries. Developers often join this table with supplier master tables, invoice line tables, and payment tables to produce complete accounts payable reports.
The table also exists within the broader Oracle Fusion Procure-to-Pay data model, where supplier information originates in supplier master tables, procurement transactions are recorded through purchase orders, and invoices are later captured in the Payables module before payments are issued.
Understanding this flow helps developers correctly navigate the relationships between procurement, invoicing, and payment tables. The following diagram illustrates how supplier data, purchase orders, invoices, and payments are connected within the Oracle Fusion data model.

The diagram highlights how supplier records flow through procurement transactions into invoice processing and finally payment settlement. The AP_INVOICES_ALL table occupies a central position in this lifecycle because it represents the official record of supplier invoices within the Payables module.
Key Columns in AP_INVOICES_ALL
Understanding the key columns within the AP_INVOICES_ALL table is essential when building SQL queries for supplier invoice reporting in Oracle Fusion. Each column represents a specific attribute of the supplier invoice and plays a role in joins, filtering conditions, and financial reconciliation queries.
The following columns are commonly used in reporting and integration scenarios.
| Column Name | Description |
|---|---|
| INVOICE_ID | Primary key that uniquely identifies each invoice record in the table |
| INVOICE_NUM | Supplier-provided invoice number used for business reference |
| VENDOR_ID | Identifier that links the invoice to the supplier master record |
| INVOICE_DATE | Date when the supplier issued the invoice |
| INVOICE_AMOUNT | Total monetary amount of the invoice |
| PAYMENT_STATUS_FLAG | Indicates whether the invoice has been paid |
| ORG_ID | Business unit associated with the invoice transaction |
| CREATION_DATE | Timestamp indicating when the invoice record was created |
Among these columns, INVOICE_ID serves as the primary join key used to connect invoice headers with related tables such as invoice lines and distributions.
The following SQL query demonstrates how commonly used invoice attributes can be retrieved from the AP_INVOICES_ALL table.
SELECT
aia.invoice_id invoice_id,
aia.invoice_num invoice_number,
aia.vendor_id vendor_id,
aia.invoice_date invoice_date,
aia.invoice_amount invoice_amount,
aia.payment_status_flag payment_status,
aia.org_id business_unit
FROM
ap_invoices_all aia
WHERE
aia.invoice_date >= DATE '2024-01-01'
;
This query retrieves essential invoice header information and demonstrates the use of table aliases, a recommended SQL practice that improves readability when multiple tables are involved
Understanding INVOICE_ID
INVOICE_ID uniquely identifies each invoice record and acts as the central join key connecting invoice headers with invoice lines and distributions.
The difference between these identifiers can be summarized below.
| Column | Purpose |
|---|---|
| INVOICE_ID | System-generated primary key used to join invoice data across tables |
| INVOICE_NUM | Supplier-provided invoice number used for operational reference |
The INVOICE_ID column acts as the central join key connecting the invoice header table with invoice lines, accounting distributions, and payment records. The relationship between these tables can be visualized as follows.

SELECT
aia.invoice_id AS invoice_id,
aia.invoice_num AS invoice_number,
aila.line_number AS invoice_line_number,
aida.invoice_distribution_id AS distribution_id,
aida.amount AS distribution_amount
FROM
ap_invoices_all aia,
ap_invoice_lines_all aila,
ap_invoice_distributions_all aida
WHERE
aia.invoice_id = aila.invoice_id
AND aila.invoice_id = aida.invoice_id
AND aila.line_number = aida.invoice_line_number
;
Developers who frequently work with Oracle Fusion reporting often treat INVOICE_ID as the central reference key when navigating the Payables data model. Proper use of this column ensures that invoice data remains consistent when joining tables across supplier, procurement, and payment datasets.
AP Invoice Data Flow in Oracle Fusion
Supplier invoices in Oracle Fusion Payables exist within a larger Procure-to-Pay (P2P) lifecycle. This lifecycle describes how supplier transactions originate from procurement activities and eventually result in financial payments. Understanding this flow helps developers correctly interpret the relationships between procurement tables, invoice tables, and payment records when writing SQL queries.
The key stages of the Procure-to-Pay flow can be summarized as follows.

Invoices that originate from purchase orders often undergo matching validation before they are approved for payment. Oracle Fusion supports different matching mechanisms that help ensure invoice accuracy.

These validation mechanisms ensure that invoices correspond to legitimate procurement transactions before payments are issued.
From a reporting perspective, understanding this data flow helps developers determine where invoice data originates and how it connects to procurement and payment tables. Queries that analyze supplier spending, procurement efficiency, or payment performance frequently traverse multiple tables across this lifecycle.
Also Read: HZ_CUST_ACCOUNTS Explained
Common AP Invoice Joins
Building meaningful reports in Oracle Fusion Payables requires combining invoice header data with related supplier, procurement, and payment tables. The AP_INVOICES_ALL table typically serves as the starting point for these queries, but additional tables must be joined to obtain invoice lines, accounting distributions, supplier information, and payment details.
Understanding the correct join relationships is important because the invoice data model contains several one-to-many relationships. Improper joins can easily result in duplicate invoice records or incorrect financial totals.
The following diagram illustrates the most common join relationships used when querying invoice data.
The AP_INVOICES_ALL table rarely appears alone in reporting queries. Most invoice reports require joins with supplier tables, invoice line tables, accounting distribution tables, and payment tables. The following diagram illustrates the most common join relationships and the columns used to connect these tables.

Joining Invoice Headers to Invoice Lines
The most common relationship in invoice reporting is between the invoice header and the invoice line tables. A single invoice can contain multiple invoice lines, creating a one-to-many relationship between these tables.
| Table | Join Key |
|---|---|
| AP_INVOICES_ALL | INVOICE_ID |
| AP_INVOICE_LINES_ALL | INVOICE_ID |
SELECT
aia.invoice_id AS invoice_id,
aia.invoice_num AS invoice_number,
aila.line_number AS line_number,
aila.amount AS line_amount
FROM
ap_invoices_all aia,
ap_invoice_lines_all aila
WHERE
aia.invoice_id = aila.invoice_id
;
Joining Invoices to Accounting Distributions
Invoice distributions represent the accounting breakdown of invoice lines. Each invoice line may have multiple distributions depending on how expenses are allocated.
| Table | Join Column |
|---|---|
| AP_INVOICE_LINES_ALL | INVOICE_ID |
| AP_INVOICE_DISTRIBUTIONS_ALL | INVOICE_ID |
Example SQL:
SELECT
aia.invoice_id AS invoice_id,
aila.line_number AS line_number,
aida.invoice_distribution_id AS distribution_id,
aida.amount AS distribution_amount
FROM
ap_invoices_all aia,
ap_invoice_lines_all aila,
ap_invoice_distributions_all aida
WHERE
aia.invoice_id = aila.invoice_id
AND aila.invoice_id = aida.invoice_id
AND aila.line_number = aida.invoice_line_number
;
Joining Invoices to Supplier Information
Supplier information associated with invoices is stored in supplier master tables. The VENDOR_ID column connects invoice records with the supplier identity stored in POZ_SUPPLIERS
| Table | Join Column |
|---|---|
| AP_INVOICES_ALL | VENDOR_ID |
| POZ_SUPPLIERS | VENDOR_ID |
Example SQL:
SELECT
aia.invoice_id AS invoice_id,
aia.invoice_num AS invoice_number,
ps.vendor_name AS supplier_name
FROM
ap_invoices_all aia,
poz_suppliers_v ps
WHERE
aia.vendor_id = ps.vendor_id
;
Joining Invoices to Payment Records
Payment information for invoices is primarily stored in AP_PAYMENT_SCHEDULES_ALL and AP_PAYMENT_HISTORY_ALL. Payment schedules track when invoices are due for payment, while payment history records executed payment transactions.
The relationship between invoices and payment records can be summarized below.
| Table | Join Column | Description |
|---|---|---|
| AP_INVOICES_ALL | INVOICE_ID | Stores supplier invoice header information |
| AP_PAYMENT_SCHEDULES_ALL | INVOICE_ID | Stores payment schedules for invoices |
| AP_PAYMENT_HISTORY_ALL | PAYMENT_HISTORY_ID | Stores executed payment transactions |
Example SQL:
SELECT
aia.invoice_id AS invoice_id,
aia.invoice_num AS invoice_number,
aps.payment_num AS payment_number,
aps.due_date AS payment_due_date,
aps.amount_remaining AS remaining_amount
FROM
ap_invoices_all aia,
ap_payment_schedules_all aps
WHERE
aia.invoice_id = aps.invoice_id
;
Correctly understanding these join relationships enables developers to build accurate supplier invoice reports, reconciliation queries, and audit extracts. Queries that combine supplier data, invoice details, and payment transactions typically rely on these join paths.
Building Supplier Invoice Reports in Oracle Fusion
Supplier invoice reporting is a common requirement in Oracle Fusion Payables. Finance teams rely on SQL queries to analyze supplier spending, monitor unpaid invoices, and reconcile invoices with procurement transactions. Most reporting queries begin with the AP_INVOICES_ALL table and expand to include supplier records, payment schedules, and invoice distributions.
The following examples illustrate common reporting queries used in Oracle Fusion environments.
SQL to Find Open Supplier Invoices
Open invoice reports identify invoices that still have outstanding payment balances.
SELECT
ps.vendor_name AS supplier_name,
aia.invoice_num AS invoice_number,
aia.invoice_date AS invoice_date,
aia.invoice_amount AS invoice_amount,
aps.amount_remaining AS outstanding_amount
FROM
ap_invoices_all aia,
poz_suppliers_v ps,
ap_payment_schedules_all aps
WHERE
aia.vendor_id = ps.vendor_id
AND aia.invoice_id = aps.invoice_id
AND aps.amount_remaining > 0
;
SQL to Identify Paid and Unpaid Invoices
Invoice payment status can be analyzed using the PAYMENT_STATUS_FLAG column in the invoice header table.
SELECT
aia.invoice_num AS invoice_number,
aia.invoice_date AS invoice_date,
aia.invoice_amount AS invoice_amount,
aia.payment_status_flag AS payment_status
FROM
ap_invoices_all aia
;
SQL for Invoice Aging Report
Invoice aging reports measure how long invoices have remained unpaid.
SELECT
aia.invoice_num AS invoice_number,
aia.invoice_date AS invoice_date,
aia.invoice_amount AS invoice_amount,
TRUNC (SYSDATE - aia.invoice_date) AS days_outstanding
FROM
ap_invoices_all aia
WHERE
aia.payment_status_flag <> 'Y'
;
SQL to Find PO-Matched Invoices
Invoices linked to procurement transactions can be identified through invoice distribution records.
SELECT
aia.invoice_num AS invoice_number,
aia.invoice_date AS invoice_date,
aia.invoice_amount AS invoice_amount,
pda.po_distribution_id AS po_distribution_id
FROM
ap_invoices_all aia,
ap_invoice_distributions_all aida,
po_distributions_all pda
WHERE
aia.invoice_id = aida.invoice_id
AND aida.po_distribution_id = pda.po_distribution_id
;
Common Developer Mistakes
Developers working with invoice data in Oracle Fusion Payables frequently encounter issues when joining invoice tables or filtering records. The following checklist highlights common mistakes that can lead to inaccurate reporting results.
Joining Invoice Lines Without Aggregation
Invoice headers can contain multiple invoice lines. When developers join AP_INVOICES_ALL with AP_INVOICE_LINES_ALL, each invoice header may appear multiple times in the result set. Queries that calculate totals directly from this join can therefore produce inflated invoice amounts.
Incorrect SQL Example
SELECT
aia.invoice_num,
aia.invoice_amount,
aila.amount
FROM
ap_invoices_all aia,
ap_invoice_lines_all aila
WHERE
aia.invoice_id = aila.invoice_id
;
In this query, the invoice header appears once for each invoice line, which can result in duplicated invoice totals.
Correct SQL Approach
SELECT
aia.invoice_num,
SUM(aila.amount) AS total_line_amount
FROM
ap_invoices_all aia,
ap_invoice_lines_all aila
WHERE
aia.invoice_id = aila.invoice_id
GROUP BY
aia.invoice_num
;
This approach aggregates the invoice line amounts, ensuring that the calculated total reflects the actual invoice value.
Using INVOICE_NUM Instead of INVOICE_ID
The INVOICE_NUM column represents the supplier’s invoice reference and may not be unique across suppliers. The INVOICE_ID column is the system-generated primary key and should always be used for joining invoice-related tables.
Ignoring Business Unit Filters
Invoice tables store records across multiple business units. Queries that do not filter using the ORG_ID column may return invoice data belonging to other business units.
Including Cancelled Invoices
Cancelled invoices remain stored in the database tables. Operational reports should exclude these records to ensure that financial summaries reflect only valid invoice transactions.
Incorrect joins to procurement tables
Invoice records linked to purchase orders are connected through the AP_INVOICE_DISTRIBUTIONS_ALL table. Direct joins between invoice headers and purchase order tables often produce incorrect results.
Suggested Read: HZ_PARTIES Table in Oracle Fusion
Performance & SQL Best Practices
Queries on AP_INVOICES_ALL often operate on large datasets. The following practices help maintain query performance when building invoice reports.
Developers should follow several best practices when querying invoice tables in Oracle Fusion.
Filter by Invoice Date
Invoice tables typically contain several years of historical records. Applying a filter on INVOICE_DATE significantly reduces the number of rows scanned during query execution.
SELECT
aia.invoice_num,
aia.invoice_date,
aia.invoice_amount
FROM
ap_invoices_all aia
WHERE
aia.invoice_date >= DATE '2024-01-01'
;
Filter by Business Unit (ORG_ID)
The ORG_ID column represents the business unit responsible for the invoice transaction. Filtering by this column prevents queries from retrieving invoices belonging to other business units.
SELECT
aia.invoice_num,
aia.invoice_amount
FROM
ap_invoices_all aia
WHERE
aia.org_id = :p_org_id
;
Avoid Using SELECT *
Retrieving unnecessary columns increases data transfer and slows query execution. Queries should select only the columns required for the report.
Use Indexed Join Keys
Columns such as INVOICE_ID, VENDOR_ID, and PO_DISTRIBUTION_ID are commonly used join keys. Using these columns improves join performance when combining invoice tables.
Apply Filters Before Adding Joins
Filtering the base dataset before joining additional tables reduces intermediate result sizes and improves query efficiency.
Validate Results Against the Application
SQL results should always be verified against the Oracle Fusion Payables user interface to confirm that invoice totals and payment statuses match the values displayed in the application.
Advanced Reporting Use Cases
Beyond standard invoice reports, developers and finance teams often build advanced SQL queries on AP_INVOICES_ALL to support reconciliation, compliance reporting, and cross-module analysis. These queries typically combine invoice data with accounting distributions, procurement records, and payment schedules to produce insights required by auditors and financial analysts.
The following examples illustrate several advanced reporting scenarios frequently implemented in Oracle Fusion environments.
Duplicate Invoice Detection
Duplicate supplier invoices can lead to incorrect payments and financial discrepancies. Detecting duplicate invoices is therefore an important control mechanism in accounts payable processes.
Duplicate invoices are often identified by checking whether the same supplier has submitted multiple invoices with the same invoice number.
SELECT
aia.vendor_id,
aia.invoice_num,
COUNT(*) AS duplicate_count
FROM
ap_invoices_all aia
GROUP BY
aia.vendor_id,
aia.invoice_num
HAVING
COUNT(*) > 1
;
Invoice Distribution Reconciliation
Invoice distributions store the accounting breakdown of invoice amounts. Finance teams sometimes reconcile invoice totals with the sum of their distributions to verify accounting consistency.
SELECT
aia.invoice_num,
aia.invoice_amount,
SUM(aida.amount) AS distribution_total
FROM
ap_invoices_all aia,
ap_invoice_distributions_all aida
WHERE
aia.invoice_id = aida.invoice_id
GROUP BY
aia.invoice_num,
aia.invoice_amount
;
Cross-Module Reporting (AP and Procurement)
Invoices originating from procurement transactions can be linked to purchase order distributions. This connection enables procurement and finance teams to analyze invoice amounts in relation to purchase orders.
SELECT
aia.invoice_num,
aia.invoice_amount,
pda.po_distribution_id
FROM
ap_invoices_all aia,
ap_invoice_distributions_all aida,
po_distributions_all pda
WHERE
aia.invoice_id = aida.invoice_id
AND aida.po_distribution_id = pda.po_distribution_id
;
How CloudSQL Simplifies AP Reporting?
Writing SQL queries against Oracle Fusion tables can be challenging because many tables contain a large number of columns and complex relationships. Tables such as AP_INVOICES_ALL, POZ_SUPPLIERS, and HZ_PARTIES often require developers to reference multiple attributes while constructing joins and validating results.
CloudSQL Desktop is designed to support developers during query authoring and data validation, particularly when working with large Oracle Fusion schemas.

Faster SQL Authoring and Schema Discovery
Authoring SQL queries against wide Oracle Fusion tables frequently requires developers to look up column names and key structures. Switching between documentation and the SQL editor can slow down the query-writing process.
CloudSQL Desktop reduces this friction through auto-completion for table names and column names, allowing developers to write queries more efficiently.
The advanced database browser complements this capability by exposing table structure directly from the schema.
Assisting Query Correction with SQLProAI
Complex SQL queries often contain syntax errors, incorrect aliases, or misplaced join conditions. These issues frequently occur when developers are working with multiple tables or legacy Oracle join syntax.
SQLProAI assists developers by identifying and correcting common SQL syntax issues during query authoring.
It is important to note that SQLProAI focuses on SQL correctness, not on validating Oracle Fusion business logic or table relationships.
By helping resolve syntax problems early, developers can focus on refining joins and verifying query results.
Validating Results Using the Dynamic Result Grid
Many issues with Oracle Fusion SQL queries appear only after the query is executed and the results are returned. This is particularly true when working with one-to-many relationships, where incorrect joins can produce unexpected row multiplication.
CloudSQL Desktop provides a dynamic result grid designed to assist developers during the result validation phase. The grid includes several capabilities that help analyze large result sets.
| Capability | How It Helps |
|---|---|
| Inline filtering | Narrow results to a specific record without modifying the SQL query. |
| Sorting | Identify anomalies by ordering results using dates, identifiers, or descriptive columns. |
| Grouping | Detect duplicate rows or unexpected row multiplication caused by joins. |
| In-grid search | Locate specific values within large result sets quickly. |
| Column navigation | Jump directly to relevant columns in wide tables. |
| Record isolation | Inspect individual records to better understand relationships between rows. |
When to Extend Beyond AP_INVOICES_ALL?
Some reporting requirements require tables beyond AP_INVOICES_ALL, particularly for invoice lines, accounting distributions, and payment schedules. Several related tables are commonly used when expanding invoice reporting queries
| Table | Purpose |
|---|---|
| AP_INVOICE_LINES_ALL | Stores detailed invoice line records associated with each invoice header. |
| AP_INVOICE_DISTRIBUTIONS_ALL | Stores accounting distributions that allocate invoice amounts to expense or asset accounts. |
| AP_PAYMENT_SCHEDULES_ALL | Stores payment schedule information for invoices, including due dates and remaining balances. |
Understanding these related tables helps developers construct more comprehensive financial reports. For example, invoice lines provide item-level detail, distributions reveal accounting allocations, and payment schedules expose the current payment status of invoices.
Developers building advanced reports typically begin with AP_INVOICES_ALL and expand outward depending on the reporting requirement.
Must Read: PER_PERSON_NAMES_F Explained
Conclusion
The AP_INVOICES_ALL table forms the foundation of supplier invoice reporting in Oracle Fusion Payables. It stores the header-level representation of supplier invoices and serves as the starting point for most invoice-related SQL queries. Several key principles are important when working with this table:
| Key Principle | Explanation |
|---|---|
| AP_INVOICES_ALL is the core invoice table | Most supplier invoice reports begin with this table. |
| INVOICE_ID is the primary join key | This column links invoice headers with invoice lines, distributions, and payment schedules. |
| Correct joins prevent reporting errors | Understanding table relationships helps avoid duplicate rows and incorrect totals. |
By combining AP_INVOICES_ALL with related tables such as invoice lines, distributions, and payment schedules, developers can build comprehensive reports that support financial analysis, reconciliation, and audit requirements.
Tools such as CloudSQL Desktop further simplify this process by assisting developers during SQL authoring and result validation when working with large Oracle Fusion schemas.
For developers working with Oracle Fusion reporting, a clear understanding of the invoice data model remains essential for building accurate and reliable SQL queries.
FAQs (Frequently Asked Questions)
What is the difference between AP_INVOICES_ALL and AP_INVOICE_LINES_ALL?
The AP_INVOICES_ALL table stores invoice header-level information such as invoice number, supplier, and total amount. In contrast, AP_INVOICE_LINES_ALL stores detailed line-level data, including item descriptions, quantities, and line amounts. A single invoice in AP_INVOICES_ALL can have multiple related records in AP_INVOICE_LINES_ALL, forming a one-to-many relationship.
Why is INVOICE_ID preferred over INVOICE_NUM in SQL joins?
INVOICE_ID is a system-generated primary key that uniquely identifies each invoice across all tables in Oracle Fusion. On the other hand, INVOICE_NUM is provided by suppliers and may not be unique across vendors. Using INVOICE_NUM in joins can lead to incorrect results or duplicates, whereas INVOICE_ID ensures accurate and consistent joins.
How can duplicate invoice records appear in query results?
Duplicate rows usually occur due to incorrect joins with one-to-many tables, such as invoice lines or distributions. When an invoice header is joined directly with multiple line or distribution records without aggregation, it gets repeated. This can be avoided by using GROUP BY with aggregation functions (like SUM) or by designing joins carefully based on the reporting requirement.
How can you identify open (unpaid) invoices in AP_INVOICES_ALL?
Open invoices can be identified using either the PAYMENT_STATUS_FLAG or the AP_PAYMENT_SCHEDULES_ALL table. While PAYMENT_STATUS_FLAG provides a quick indicator, the most accurate method is to check AMOUNT_REMAINING > 0 in AP_PAYMENT_SCHEDULES_ALL. This approach reflects the actual outstanding balance and is commonly used in financial reporting and reconciliation queries.