The Archive and Purge program provides three levels of detail for archiving transaction information. You can archive just header level data for your transactions; header and line level data; or header, line, and distribution data.
Archived transactions are stored in the AR_ARCHIVE_HEADER and AR_ARCHIVE_DETAIL tables. The header table stores records of three types: Transactions (Invoices, Credit or Debit Memos, Guarantees, Deposits, Chargebacks, and On-Account Credits), Receipts and Adjustments. Records stored in the detail table relate to these header records.
The following diagrams illustrate the relationships between the records in these two tables.
Note: Regardless of the level of detail you choose to archive, the purge portion of this program will remove all records for the selected transaction and all related transactions.
Archive different levels of transaction data

Notes on the above diagram:
Header records relate to detail records using transaction_class and transaction_id. Detail records are credit memo application(s), transaction line(s) and a distribution of type 'REC'.
Line records in AR_ARCHIVE_DETAIL relate to distributions in the same table using transaction_class, transaction_id and transaction_line_id.
For credit memos, 'related' columns in AR_ARCHIVE_HEADER indicate the credited transaction, or for invoices, they indicate the commitment applied (if applicable).
For transaction lines, 'related' columns in AR_ARCHIVE_DETAIL indicate the credited line and the commitment line applied to the transaction (if applicable).
For credit memo applications, 'related' columns in AR_ARCHIVE_DETAIL indicate the transaction credited
Archive different levels of cash receipt data

Notes on the above diagram:
Header records relate to detail records using transaction_class and transaction_id. Detail records are cash receipt application(s), a cash receipt history record, and miscellaneous cash distributions.
Miscellaneous cash distributions are stored only for a distribution level archive.
No additional records are stored for a line level archive.
For receipt applications, 'related' columns in AR_ARCHIVE_DETAIL indicate the transaction applied to the receipt.
Archive different levels of adjustment data

Notes on the above diagram:
Header records relate to detail records using transaction_class and transaction_id.
'Related' columns in AR_ARCHIVE_DETAIL indicate the adjusted transaction in AR_ARCHIVE_HEADER.
No additional columns records are stored for a distribution level archive.
Depending on the archive level you choose, different types and numbers of records will be stored. Also, for a distribution level archive, additional columns in line level records are populated.
Use the following table to determine which records are created for each archive level:
| Level | Storage Table | Number of Records Archived |
|---|---|---|
| Headers | AR_ARCHIVE_HEADER | 1 record for each transaction, receipt, and adjustment |
| Headers | AR_ARCHIVE_DETAIL | 1 record for each credit memo and receipt application |
| Headers | AR_ARCHIVE_DETAIL | 1 record for the latest AR_CASH_RECEIPT_HISTORY record |
| Headers and Lines | AR_ARCHIVE_DETAIL | 1 record for each transaction line |
| Headers and Lines | AR_ARCHIVE_DETAIL (see Header Level) | 1 record for each adjustment plus the Header level records |
| Header, Lines and Distributions | AR_ARCHIVE_DETAIL | 1 record for each transaction distribution |
| Header, Lines and Distributions | AR_ARCHIVE_DETAIL | 1 record for each miscellaneous cash distribution |
| Header, Lines and Distributions | AR_ARCHIVE_DETAIL (see Header and Line Level) | Additional accounting related columns archived on above line records plus the Header and Line level records |
For a detailed list of all the columns archived for each level, see the Archive Tables.