Your Accounts Payable Payment Processing Data Template
Your Accounts Payable Payment Processing Data Template
- Essential data fields for Sage Intacct
- Standardized process milestones
- Specific extraction instructions
Accounts Payable Payment Processing Attributes
| Name | Description | ||
|---|---|---|---|
| Activity Name ActivityName | The specific action or event occurring in the invoice lifecycle. | ||
| Description This attribute captures the name of the step being performed, such as 'Invoice Created', 'Invoice Approved', or 'Payment Posted'. It is essential for reconstructing the process flow and visualizing the sequence of events in the End to End Cycle Time Distribution dashboard. Why it matters Defines the steps in the process map and is mandatory for any process mining analysis. Where to get Audit trail logs or system transaction history tables Examples Invoice Draft CreatedInvoice ApprovedPayment Generated | |||
| Event Timestamp EventTime | The specific date and time when an activity occurred. | ||
| Description This attribute records the exact moment an event took place. It is the basis for all time-based calculations, including Average Invoice Cycle Time and Average Approval Duration. Accurate timestamps are critical for identifying bottlenecks in the Approval Workflow Performance dashboard. Why it matters Required to sequence events and calculate durations between process steps. Where to get Transaction creation or modification timestamps in the source tables Examples 2023-10-12T08:30:00Z2023-10-12T14:45:12Z2023-10-15T09:15:00Z | |||
| Invoice Number InvoiceNumber | The unique identifier for the vendor invoice document. | ||
| Description The Invoice Number serves as the definitive case identifier for this process. It uniquely groups all events pertaining to a single vendor invoice, allowing for a comprehensive analysis of its journey from reception to settlement. In Sage Intacct, this usually corresponds to the Document Number or Record Number within the AP Bill object. Why it matters It is the fundamental key for linking all process activities to a single case instance. Where to get Sage Intacct AP Bill object, field DOCNUMBER or RECORDNO Examples INV-2023-001988722-AFEB-23-991 | |||
| Last Data Update LastDataUpdate | The timestamp of when the record was last extracted or refreshed. | ||
| Description This attribute tracks when the data was last synchronized with the process mining platform. It helps users understand the freshness of the data presented in dashboards like Payment Batch Optimization and ensures that the analysis reflects the most current state of the AP ledger. Why it matters Technical field required for incremental loads and data currency checks. Where to get System time at the moment of data extraction Examples 2023-11-01T12:00:00Z2023-11-02T01:00:00Z | |||
| Source System SourceSystem | The name of the system where the event originated. | ||
| Description This attribute identifies the origin of the data, which is typically 'Sage Intacct' for this process. However, if invoices are ingested from OCR tools or external procurement platforms, this field helps differentiate data sources in the Compliance and Risk Overview. Why it matters Ensures data lineage traceability, especially in multi-system environments. Where to get Hardcoded during extraction or derived from connection settings Examples Sage IntacctBill.comExpensify | |||
| Created By User CreatedBy | The user ID of the person who entered the invoice. | ||
| Description This attribute identifies the initiator of the process case. It is used in the Manual Intervention and Touchpoints analysis to identify training needs for specific users who frequently require data correction or generate duplicates. Why it matters Enables resource performance analysis and identifies training opportunities. Where to get Sage Intacct AP Bill object, field CREATEDBY Examples jsmithap_automation_botmdoe | |||
| Department Department | The internal department responsible for the expense. | ||
| Description This attribute categorizes the invoice by cost center or business function. It supports the Process Variation Analysis dashboard by highlighting which departments struggle with approval delays or high rework rates compared to the organizational average. Why it matters Allows for organizational drill-down and root cause analysis. Where to get Sage Intacct AP Bill object, field DEPTID or DEPTNAME Examples IT ServicesMarketingOperations | |||
| Due Date DueDate | The contractual deadline for payment. | ||
| Description This attribute indicates when the payment must be made to avoid penalties. It is the denominator for the On-Time Payment Percentage KPI. Analyzing payments executed after this date reveals compliance gaps and potential damage to vendor relationships. Why it matters Baseline for determining on-time performance and SLA adherence. Where to get Sage Intacct AP Bill object, field WHENDUE Examples 2023-11-012023-11-15 | |||
| Invoice Amount InvoiceAmount | The total monetary value of the invoice. | ||
| Description This attribute represents the total financial liability for the specific case. It is used in the Duplicate Submission Detection dashboard to identify invoices with identical amounts and vendor IDs. It also allows for filtering analysis by high-value versus low-value transactions. Why it matters Essential for financial impact analysis and risk scoring. Where to get Sage Intacct AP Bill object, field TOTALENTERED or TOTALDUE Examples 1500.00250.5010000.00 | |||
| Invoice Date InvoiceDate | The date the invoice was issued by the vendor. | ||
| Description This attribute reflects the document date stated on the physical invoice. It is used in conjunction with the Payment Date to calculate the End to End Cycle Time. Significant gaps between Invoice Date and entry date can indicate mailroom or scanning delays. Why it matters The starting point for aging analysis and payment term calculations. Where to get Sage Intacct AP Bill object, field WHENTOCREATE or DATECREATED Examples 2023-10-012023-10-05 | |||
| Invoice Status InvoiceStatus | The current lifecycle state of the invoice in the system. | ||
| Description This attribute reflects the current system status (e.g., Posted, Paid, Draft). It helps filter the dataset for active versus completed cases in the End to End Cycle Time Distribution dashboard. Why it matters Quickly identifies the state of the case. Where to get Sage Intacct AP Bill object, field STATE Examples PostedPaidDraftPartially Paid | |||
| Payment Date PaymentDate | The date the payment was executed. | ||
| Description This attribute records the final timestamp of the financial settlement. It is used to calculate the cycle time and is compared against the Due Date for the On-Time Payment Percentage KPI. Why it matters Marks the completion of the core process cycle. Where to get Sage Intacct AP Payment Detail, field WHENPAID Examples 2023-11-052023-11-10 | |||
| Purchase Order Number PurchaseOrderNumber | The reference number of the related purchase order. | ||
| Description This attribute links the invoice to an upstream procurement document. It is the key driver for the Three Way Match Efficiency dashboard and the PO Compliance and Non PO Spend analysis. Cases with a null value here indicate non-PO spend. Why it matters Distinguishes between PO-backed and non-PO invoices for compliance analysis. Where to get Sage Intacct AP Bill object, field PONUMBER or related document link Examples PO-9912PO-1002null | |||
| Vendor Name VendorName | The name of the supplier or service provider issuing the invoice. | ||
| Description This attribute identifies the external entity to whom payment is owed. It is a primary dimension for the Vendor Payment Predictability dashboard, allowing analysts to group performance metrics by supplier and identify high-risk vendor relationships or frequent manual touchpoints. Why it matters Critical for segmenting analysis by supplier performance and behavior. Where to get Sage Intacct AP Bill object, field VENDORNAME Examples Acme CorpGlobal Services IncOffice Depot | |||
| Business Unit BusinessUnit | The legal entity or location associated with the invoice. | ||
| Description This attribute differentiates between different subsidiaries or office locations. It is crucial for the Compliance and Risk Overview to compare process adherence across different geographical or legal entities within the organization. Why it matters Essential for multi-entity benchmarks. Where to get Sage Intacct AP Bill object, field LOCATIONID or ENTITY Examples USA-HQEMEA-LondonAPAC-Singapore | |||
| Cycle Time (Days) CycleTimeDays | The number of days from invoice receipt to payment. | ||
| Description This metric quantifies the speed of the process for each case. It feeds directly into the Average Invoice Cycle Time KPI and allows for histogram analysis in the End to End Cycle Time Distribution dashboard. Why it matters Standard performance metric for efficiency. Where to get Calculated: Days between InvoiceDate and PaymentDate Examples 15.530.05.2 | |||
| Hold Status HoldStatus | Indicates if the invoice is currently on payment hold. | ||
| Description This attribute flags cases that are suspended from payment processing. It supports the Payment Block Impact Monitor dashboard by identifying cases stuck in a blocked state. Why it matters Identifies immediate bottlenecks requiring intervention. Where to get Sage Intacct AP Bill object, field ONHOLD Examples truefalse | |||
| Is Paid Late IsPaidLate | Flag indicating if the payment date exceeded the due date. | ||
| Description This boolean attribute is calculated by comparing the Payment Date to the Due Date. It serves as a direct filter for the On-Time Payment Percentage KPI and helps isolate problem cases in the Vendor Payment Predictability dashboard. Why it matters Simplifies filtering for SLA violations. Where to get Calculated: PaymentDate > DueDate Examples truefalse | |||
| Is PO Backed IsPOBacked | Flag indicating if the invoice is associated with a Purchase Order. | ||
| Description This attribute identifies whether the invoice followed standard procurement procedures. It is the primary filter for the Purchase Order Compliance Rate KPI and helps separate ad-hoc spend from managed spend. Why it matters Key differentiator for process path analysis. Where to get Calculated: PurchaseOrderNumber is not null Examples truefalse | |||
| Payment Terms PaymentTerms | The agreed-upon conditions for payment timing and discounts. | ||
| Description This attribute describes the rule used to calculate the due date and discount date (e.g., Net 30, 2/10 Net 30). It is vital for the Early Payment Discount Analysis dashboard to identify which invoices were eligible for savings that were missed. Why it matters Context for analyzing cash flow strategies and lost discount opportunities. Where to get Sage Intacct AP Bill object, field TERMNAME Examples Net 30Due Upon Receipt2/10 Net 30 | |||
Accounts Payable Payment Processing Activities
| Activity | Description | ||
|---|---|---|---|
| Invoice Approved | A distinct approval action recorded within the designated approval workflow. This signifies that a user with sufficient authority has authorized the bill for payment. | ||
| Why it matters Critical for 'Average Approval Duration' KPI and identifying bottlenecks in management sign-off. Where to get Query the 'Examine Approval History' log associated with the AP Bill to find 'Approved' actions. Capture Logged when approval action is executed Event type explicit | |||
| Invoice Draft Created | The initial creation of the AP Bill record in Sage Intacct, usually in a Draft state. This captures the entry point of the invoice data before it enters approval or posting workflows. | ||
| Why it matters Establishes the earliest timestamp for the process cycle time and identifies the start of the liability recording. Where to get Query the APBILL object audit trail for the 'Create' action or the initial timestamp of the record creation. Capture Logged when APBILL record is first created Event type explicit | |||
| Invoice Matched to PO | Identifies when a vendor invoice is created by converting or linking a Purchase Order or Receiver. This activity validates the 3-way match efficiency. | ||
| Why it matters Critical for the 'First-Pass Match Rate' KPI and determining PO compliance versus non-PO spend. Where to get Check the APBILL object for a non-null value in the 'createdfrom' or 'source_id' fields indicating linkage to a Purchasing transaction. Capture Compare Record ID to Source Transaction ID Event type inferred | |||
| Invoice Posted | The point where the invoice is committed to the General Ledger. In systems without approval workflows, this may happen simultaneously with submission. | ||
| Why it matters Indicates the financial liability is officially recognized in the accounting books. Where to get Query the APBILL audit trail for the state change to 'Posted'. Capture Logged when transaction posts to GL Event type explicit | |||
| Invoice Submitted | The transition of the invoice from a Draft state to a Submitted state, triggering the approval workflow. This marks the end of data entry and the start of the approval cycle. | ||
| Why it matters Essential for segmenting 'Data Entry' duration from 'Approval' duration in cycle time analysis. Where to get Infer from the APBILL audit trail where the State field changes from 'Draft' to 'Submitted' or 'Pending Approval'. Capture Compare status field before/after Event type inferred | |||
| Payment Generated | The creation of the Payment (Check, ACH, EFT) record linked to the invoice. This is the moment the funds transfer is initiated in the system. | ||
| Why it matters The primary timestamp for 'Average Invoice Cycle Time' and 'On-Time Payment Percentage'. Where to get Identify the creation of an APPYMT record linked to the APBILL. Use the creation date of the payment object. Capture Logged when APPYMT record is created Event type explicit | |||
| Invoice Declined | Records when an approver rejects the invoice, returning it to a Draft or partially approved state. This indicates a process loop or data quality issue. | ||
| Why it matters Highlights friction points in the workflow and contributes to rework metrics. Where to get Query the 'Examine Approval History' log associated with the AP Bill for 'Declined' or 'Rejected' actions. Capture Logged when decline action is executed Event type explicit | |||
| Invoice Placed on Hold | The application of a payment block or 'On Hold' status to the invoice. This prevents the invoice from being selected for payment processing. | ||
| Why it matters Directly impacts 'Payment Block Resolution Time' and visualizes delays in the payment pipeline. Where to get Infer from the APBILL audit trail where the 'On Hold' boolean or status field transitions to true. Capture Compare status field before/after Event type inferred | |||
| Invoice Released from Hold | The removal of the payment block, allowing the invoice to proceed to payment selection. This marks the resolution of the dispute or issue. | ||
| Why it matters Marks the end of a bottleneck period and resumption of the standard process flow. Where to get Infer from the APBILL audit trail where the 'On Hold' boolean or status field transitions to false. Capture Compare status field before/after Event type inferred | |||
| Invoice Selected for Payment | The inclusion of the invoice in a payment batch or selection run. The status typically changes to 'Selected', locking it from other payment runs. | ||
| Why it matters Analyzes 'Payment Batch Optimization' and the lag between deciding to pay and actually cutting the check. Where to get Infer from APBILL status change to 'Selected' or equivalent via the 'Pay Bills' screen action. Capture Compare status field before/after Event type inferred | |||
| Invoice Updated | Records modifications to the invoice header or line items after initial creation. High frequency of this activity indicates manual rework or data extraction errors. | ||
| Why it matters Key for calculating 'Touchless Processing Rate' and identifying inefficient manual data correction loops. Where to get Query the APBILL audit history for 'Update' actions performed by a user prior to posting. Capture Logged when transaction is modified Event type explicit | |||
| Payment Reconciled | The confirmation that the payment has cleared the bank, marked during the bank reconciliation process in Cash Management. | ||
| Why it matters Provides the 'End to End Cycle Time' from a cash flow perspective, confirming funds actually left the account. Where to get Check the Reconciliation status or 'Cleared Date' field on the APPYMT object or linked Cash Management transaction. Capture Compare reconciliation status Event type inferred | |||
| Payment Voided | The cancellation of a previously generated payment. This re-opens the invoice liability and requires the payment process to restart. | ||
| Why it matters Identify severe downstream process failures where payments are generated but retracted. Where to get Query the APPYMT object for status 'Void' or 'Voided' and the associated timestamp. Capture Logged when void transaction occurs Event type explicit | |||
Extraction Guides
Steps
Prepare the AP Bills View Log in to Sage Intacct and navigate to Accounts Payable > All tab > Bills. Select 'Create New View'. Name the view 'Process Mining - Bills Extraction'. Select the following columns in order: Invoice Number (Doc Number), Vendor Name, Date Created, Date Posted, Due Date, Total Amount, State, Currency, PO Number, Department, Created By, On Hold, Description, Record No (System ID). Set filters to exclude 'Draft' bills if you only want posted data, or leave open to capture the full lifecycle. Ensure the date range covers your analysis period (e.g., Date Created = Last 365 Days). Save the view.
Export AP Bills Data Open the 'Process Mining - Bills Extraction' view. Click the 'Export' button and select 'CSV' format. Save the file as 'AP_Bills.csv'.
Prepare the Posted Payments View Navigate to Accounts Payable > All tab > Posted Payments. Create a new view named 'Process Mining - Payments'. Select columns: Check/Payment Number, Payment Date, Vendor Name, Transaction Amount, Payment Method, State (Void/Cleared), Date Reconciled, Bill Number (Reference), Record No. Save the view.
Export Payments Data Open the 'Process Mining - Payments' view. Click 'Export' and select 'CSV'. Save the file as 'AP_Payments.csv'.
Optional: Audit Trail for Workflow History Standard custom views in Intacct only show the current state and the last modification date. To capture historical events like 'Invoice Declined' or specific approval timestamps, you must export the Audit History. Navigate to Reports > Setup > Audit Trail. Configure the audit trail to look at the 'AP Bill' object. Select Action types: Add, Modify, Approve, Decline. Export this report as 'AP_Audit_History.csv'.
Run Transformation Script Use the Python script provided in the Query section to merge these files. The script ingests the 'AP_Bills.csv', 'AP_Payments.csv', and optional 'AP_Audit_History.csv' to generate the required Event Log structure.
Verify and Format Open the resulting 'Event_Log_Output.csv'. Ensure 'EventTime' is in ISO 8601 format (YYYY-MM-DD HH:MM:SS). Verify that 'InvoiceNumber' is populated for all rows. Upload the final CSV to ProcessMind.
Configuration
- View Configuration: Ensure 'Number of records' in the view settings is set high enough to capture all transactions, or use the 'Next Page' export feature if limits apply.
- Date Handling: Intacct exports dates in the user's local format (e.g., MM/DD/YYYY). The transformation script assumes a standard US format; adjust the script if your user profile uses DD/MM/YYYY.
- Field Permissions: Ensure the user creating the view has 'List' and 'View' permissions on Accounts Payable Bills and Posted Payments.
- Historical Granularity: Without the Audit Trail export, activities like 'Invoice Approved' will rely on the 'Date Posted' proxy, and 'Invoice Updated' will only reflect the last modification time.
- Filtering: Apply a filter on 'Date Created' >= [Start Date] to limit data volume. Avoid filtering by 'State' unless you specifically want to exclude Voided or Historical records.
a Sample Query config
import pandas as pd
import numpy as np
from datetime import datetime
# CONFIGURATION
# Update these filenames to match your exported files
FILE_BILLS = 'AP_Bills.csv'
FILE_PAYMENTS = 'AP_Payments.csv'
# Set to None if Audit History is unavailable
FILE_AUDIT = 'AP_Audit_History.csv'
# COLUMNS MAPPING (Adjust based on your View column headers)
COL_BILL_NUM = 'Invoice Number'
COL_VENDOR = 'Vendor Name'
COL_AMOUNT = 'Total Amount'
COL_CREATED = 'Date Created'
COL_POSTED = 'Date Posted'
COL_DUE = 'Due Date'
COL_STATE = 'State'
COL_PO = 'PO Number'
COL_HOLD = 'On Hold'
COL_PAY_DATE = 'Payment Date'
COL_PAY_REF = 'Check/Payment Number'
COL_PAY_BILL_REF = 'Bill Number'
COL_PAY_STATE = 'State'
# OUTPUT STRUCTURE
event_log_columns = [
'InvoiceNumber', 'ActivityName', 'EventTime', 'SourceSystem',
'LastDataUpdate', 'VendorName', 'InvoiceAmount', 'PurchaseOrderNumber',
'InvoiceDate', 'DueDate', 'InvoiceStatus'
]
def run_extraction():
events = []
current_time = datetime.now().isoformat()
# 1. LOAD BILLS
try:
df_bills = pd.read_csv(FILE_BILLS)
# Clean formatting (remove currency symbols if present)
df_bills[COL_AMOUNT] = df_bills[COL_AMOUNT].replace('[\\$,]', '', regex=True).astype(float)
except FileNotFoundError:
print('Bills file not found.')
return
# 2. LOAD PAYMENTS
try:
df_pay = pd.read_csv(FILE_PAYMENTS)
except FileNotFoundError:
print('Payments file not found.')
df_pay = pd.DataFrame()
# PROCESSING BILLS
for index, row in df_bills.iterrows():
invoice_num = str(row[COL_BILL_NUM])
vendor = row[COL_VENDOR]
amount = row[COL_AMOUNT]
po_num = str(row[COL_PO]) if pd.notna(row[COL_PO]) else None
due_date = row[COL_DUE]
status = row[COL_STATE]
# Common attributes for this invoice
base_attr = {
'InvoiceNumber': invoice_num,
'SourceSystem': 'Sage Intacct',
'LastDataUpdate': current_time,
'VendorName': vendor,
'InvoiceAmount': amount,
'PurchaseOrderNumber': po_num,
'DueDate': due_date,
'InvoiceStatus': status
}
# Activity: Invoice Draft Created
if pd.notna(row[COL_CREATED]):
events.append({**base_attr,
'ActivityName': 'Invoice Draft Created',
'EventTime': row[COL_CREATED],
'InvoiceDate': row[COL_CREATED]})
# Activity: Invoice Matched to PO
if po_num and pd.notna(row[COL_CREATED]):
events.append({**base_attr,
'ActivityName': 'Invoice Matched to PO',
'EventTime': row[COL_CREATED],
'InvoiceDate': row[COL_CREATED]})
# Activity: Invoice Posted
if pd.notna(row[COL_POSTED]):
events.append({**base_attr,
'ActivityName': 'Invoice Posted',
'EventTime': row[COL_POSTED]})
# In standard views, Posted often implies Submission and Approval if no audit trail
# We generate proxy events if Audit Trail is missing
if not FILE_AUDIT:
events.append({**base_attr,
'ActivityName': 'Invoice Submitted',
'EventTime': row[COL_POSTED]})
events.append({**base_attr,
'ActivityName': 'Invoice Approved',
'EventTime': row[COL_POSTED]})
# Activity: Invoice Placed on Hold
if str(row[COL_HOLD]).lower() in ['true', 'yes', 'on hold']:
# Time is approximate (Last Modified) as View doesn't track hold time
events.append({**base_attr,
'ActivityName': 'Invoice Placed on Hold',
'EventTime': row.get('Date Modified', row[COL_CREATED])})
# PROCESSING PAYMENTS
# Intacct payment export might list multiple bills per check line or require join logic
# Assuming direct link via Bill Number
if not df_pay.empty:
for index, row in df_pay.iterrows():
bill_ref = str(row[COL_PAY_BILL_REF])
# Only process if this payment links to a bill we know
# (In a real scenario, merge on Bill Number)
pay_attr = {
'InvoiceNumber': bill_ref,
'SourceSystem': 'Sage Intacct',
'LastDataUpdate': current_time,
'ActivityName': 'Payment Generated',
'EventTime': row[COL_PAY_DATE]
}
events.append(pay_attr)
if str(row[COL_PAY_STATE]).lower() == 'void':
events.append({**pay_attr, 'ActivityName': 'Payment Voided', 'EventTime': row[COL_PAY_DATE]})
if 'Date Reconciled' in row and pd.notna(row['Date Reconciled']):
events.append({**pay_attr, 'ActivityName': 'Payment Reconciled', 'EventTime': row['Date Reconciled']})
# 3. OUTPUT
df_events = pd.DataFrame(events)
# Ensure dates are ISO format
df_events['EventTime'] = pd.to_datetime(df_events['EventTime']).dt.strftime('%Y-%m-%d %H:%M:%S')
# Final Select
df_final = df_events[event_log_columns]
df_final.to_csv('Event_Log_Output.csv', index=False)
print(f'Successfully exported {len(df_final)} events.')
if __name__ == '__main__':
run_extraction() Steps
Establish Web Services Session: Authenticate to the Sage Intacct Web Services 3.0 endpoint using your Sender ID, Password, Company ID, User ID, and User Password to obtain a session ID.
Identify Required Objects: You must extract data from three primary objects to capture the full lifecycle:
APBILL(Invoice Headers),APPYMTDETAIL(Payment Details linked to Bills), andAUDITTRAIL(Workflow history).Extract Invoice Header Data: Use the
readByQuerymethod on theAPBILLobject. Select fieldsRECORDNO,DOCNUMBER,WHENCREATED,WHENPOSTED,STATE,VENDORNAME,TOTALENTERED,PONUMBER,DUE_DATE. Filter by date range usingWHENCREATED.Extract Payment Data: Use
readByQueryonAPPYMTDETAIL. SelectRECORDNO,WHENCREATED,PAYMENTDATE,TRX_AMOUNT,DOCNUMBER(Payment Ref), andBILLRECORDNO(Foreign Key to APBILL). Ensure you pull theCLEAREDstatus or date if available for reconciliation.Extract Audit History: Use
readByQueryon theAUDITTRAILobject. Filter whereOBJECTTYPE= 'APBILL'. This is critical for capturing approval, decline, hold, and void events which are not persisted as timestamps on the header table. SelectOBJECTKEY,LOGTYPE,MESSAGE,WHENDOCCURRED, andUSERID.Stage Data: Load the XML/JSON responses from these three API calls into a staging database (SQL Server, Snowflake, Postgres, etc.). The API does not support complex joins or unions in a single call, so transformation must occur post-extraction.
Execute Transformation Script: Run the SQL script provided in the Query section against your staged tables. This script unifies the static header data with the transactional audit log to create the single event log.
Validate Activity Types: Check the output for specific keywords found in the Audit Trail messages (like Approved, Declined) and ensure your string matching logic covers the specific wording of your Intacct configuration.
Format Dates: Ensure the
EventTimecolumn is formatted to ISO 8601 (YYYY-MM-DD THH:MM:SS) standards during the final export.Export Event Log: Export the result of the SQL query as a CSV or Parquet file for upload to ProcessMind.
Configuration
- API Endpoint: https://api.intacct.com/ia/xml/xmlgw.phtml
- Method:
readByQuery(Web Services 3.0) - Page Size: Set
pagesizeto 1000 (maximum recommended) to minimize HTTP overhead. Implement a loop using theresultIdto fetch subsequent pages. - Date Filtering: Use standard SQL operators (>=, <, AND) in your query string for
WHENCREATEDcolumns to limit the extraction window (e.g., Last 365 Days). - Permissions: The extraction user requires 'List' and 'View' permissions on Accounts Payable and the 'Audit Trail' permission (often found in Platform Services or Company Admin settings).
- Object Linking:
APBILL.RECORDNOis the primary key used to join withAPPYMTDETAIL.BILLRECORDNOandAUDITTRAIL.OBJECTKEY.
a Sample Query sql
/*
PROCESSMIND TRANSFORMATION SCRIPT
Prerequisite: Data from APBILL, APPYMTDETAIL, and AUDITTRAIL
must be extracted via API and staged in tables with those names.
*/
/* 1. Invoice Draft Created */
SELECT
H.DOCNUMBER AS InvoiceNumber,
'Invoice Draft Created' AS ActivityName,
H.WHENCREATED AS EventTime,
'Sage Intacct' AS SourceSystem,
GETDATE() AS LastDataUpdate,
H.VENDORNAME AS VendorName,
H.TOTALENTERED AS InvoiceAmount,
H.PONUMBER AS PurchaseOrderNumber,
H.WHENCREATED AS InvoiceDate,
H.DUE_DATE AS DueDate,
NULL AS Department,
H.CREATEDBY AS CreatedBy,
H.STATE AS InvoiceStatus,
NULL AS PaymentDate
FROM APBILL H
UNION ALL
/* 2. Invoice Matched to PO (Derived from existence of PO Number at creation) */
SELECT
H.DOCNUMBER,
'Invoice Matched to PO',
H.WHENCREATED, -- Occurs effectively at creation if PO links
'Sage Intacct',
GETDATE(),
H.VENDORNAME,
H.TOTALENTERED,
H.PONUMBER,
H.WHENCREATED,
H.DUE_DATE,
NULL,
H.CREATEDBY,
H.STATE,
NULL
FROM APBILL H
WHERE H.PONUMBER IS NOT NULL AND H.PONUMBER <> ''
UNION ALL
/* 3. Invoice Posted (Header Timestamp) */
SELECT
H.DOCNUMBER,
'Invoice Posted',
H.WHENPOSTED,
'Sage Intacct',
GETDATE(),
H.VENDORNAME,
H.TOTALENTERED,
H.PONUMBER,
H.WHENCREATED,
H.DUE_DATE,
NULL,
H.CREATEDBY,
H.STATE,
NULL
FROM APBILL H
WHERE H.WHENPOSTED IS NOT NULL
UNION ALL
/* 4. Payment Generated */
SELECT
H.DOCNUMBER,
'Payment Generated',
P.WHENCREATED,
'Sage Intacct',
GETDATE(),
H.VENDORNAME,
P.TRX_AMOUNT,
H.PONUMBER,
H.WHENCREATED,
H.DUE_DATE,
NULL,
P.CREATEDBY,
H.STATE,
P.PAYMENTDATE
FROM APPYMTDETAIL P
JOIN APBILL H ON P.BILLRECORDNO = H.RECORDNO
UNION ALL
/* 5. Payment Reconciled */
SELECT
H.DOCNUMBER,
'Payment Reconciled',
P.WHENCLEARED,
'Sage Intacct',
GETDATE(),
H.VENDORNAME,
P.TRX_AMOUNT,
H.PONUMBER,
H.WHENCREATED,
H.DUE_DATE,
NULL,
P.CREATEDBY,
H.STATE,
P.PAYMENTDATE
FROM APPYMTDETAIL P
JOIN APBILL H ON P.BILLRECORDNO = H.RECORDNO
WHERE P.WHENCLEARED IS NOT NULL
UNION ALL
/* 6. Workflow Activities from Audit Trail */
/* Covers: Updated, Submitted, Approved, Declined, Hold, Released, Voided, Selected */
SELECT
H.DOCNUMBER,
CASE
WHEN A.MESSAGE LIKE '%Submitted%' THEN 'Invoice Submitted'
WHEN A.MESSAGE LIKE '%Approved%' THEN 'Invoice Approved'
WHEN A.MESSAGE LIKE '%Declined%' THEN 'Invoice Declined'
WHEN A.MESSAGE LIKE '%Hold%' AND A.LOGTYPE = 'Add' THEN 'Invoice Placed on Hold'
WHEN A.MESSAGE LIKE '%Hold%' AND A.LOGTYPE = 'Remove' THEN 'Invoice Released from Hold'
WHEN A.MESSAGE LIKE '%Voided%' THEN 'Payment Voided'
WHEN A.MESSAGE LIKE '%Selected for payment%' THEN 'Invoice Selected for Payment'
WHEN A.MESSAGE LIKE '%Modified%' THEN 'Invoice Updated'
ELSE 'System Activity'
END AS ActivityName,
A.WHENDOCCURRED AS EventTime,
'Sage Intacct' AS SourceSystem,
GETDATE() AS LastDataUpdate,
H.VENDORNAME,
H.TOTALENTERED,
H.PONUMBER,
H.WHENCREATED,
H.DUE_DATE,
NULL,
A.USERID AS CreatedBy,
H.STATE,
NULL
FROM AUDITTRAIL A
JOIN APBILL H ON A.OBJECTKEY = CAST(H.RECORDNO AS VARCHAR(50))
WHERE A.OBJECTTYPE = 'APBILL'
AND (
A.MESSAGE LIKE '%Submitted%'
OR A.MESSAGE LIKE '%Approved%'
OR A.MESSAGE LIKE '%Declined%'
OR A.MESSAGE LIKE '%Hold%'
OR A.MESSAGE LIKE '%Voided%'
OR A.MESSAGE LIKE '%Selected for payment%'
OR A.MESSAGE LIKE '%Modified%'
)
/* Exclude creation updates to avoid duplication with Invoice Draft Created */
AND NOT (A.MESSAGE LIKE '%Modified%' AND ABS(DATEDIFF(second, A.WHENDOCCURRED, H.WHENCREATED)) < 60)