# API Reference

> [← Back to README](../README.md) | [Interfaces](./interfaces.md) | [Program Structure](./program-structure.md)

## CICS Transaction APIs

### CC00 — Sign-on
- **Program:** COSGN00C | **Map:** COSGN00
- **Input:** User ID (8 chars), Password (8 chars)
- **Output:** Session established, XCTL to menu
- **VSAM:** READ USRSEC file by SEC-USR-ID

### CM00 — Main Menu
- **Program:** COMEN01C | **Map:** COMEN01
- **Input:** Menu option number (1-11)
- **Output:** XCTL to selected function program
- **State:** COMMAREA carries user session context

### CAVW — Account View
- **Program:** COACTVWC | **Map:** COACTVW
- **Input:** Account number
- **Output:** Account details, card info, customer info
- **VSAM:** READ ACCTDAT, CARDDAT, CUSTDAT, CCXREF

### CAUP — Account Update
- **Program:** COACTUPC | **Map:** COACTUP
- **Input:** Account fields (status, limits, dates, address)
- **Output:** Updated account record
- **VSAM:** READ/REWRITE ACCTDAT, READ CUSTDAT, READ CCXREF

### CT02 — Transaction Add
- **Program:** COTRN02C | **Map:** COTRN02
- **Input:** Card number, transaction type, amount, description
- **Output:** New transaction written to TRANSACT
- **VSAM:** READ ACCTDAT, READ CCXREF, WRITE TRANSACT
- **Validation:** Card cross-reference verified, account active status checked

### CB00 — Bill Payment
- **Program:** COBIL00C | **Map:** COBIL00
- **Input:** Account number, payment amount
- **Output:** Payment transaction recorded
- **VSAM:** READ ACCTDAT, READ CCXREF, READ/WRITE TRANSACT

### CR00 — Transaction Report
- **Program:** CORPT00C | **Map:** CORPT00
- **Input:** Report parameters (date range, account)
- **Output:** Report submitted to batch via TD queue JOBS
- **CICS:** WRITEQ TD to INREADER

## Batch Job APIs

### POSTTRAN (CBTRN02C)
- **Input:** DALYTRAN sequential file
- **Output:** Updated TRANSACT, ACCTDAT, TCATBALF; rejected transactions
- **Logic:** Validate xref → update balances → write to transaction master

### INTCALC (CBACT04C)
- **Input:** PARM field (date parameter)
- **Output:** Interest transactions in TRANSACT; updated ACCTDAT and TCATBALF
- **Logic:** For each account, lookup disclosure group rates, calculate interest per category balance

### CREASTMT (CBSTM03A → CBSTM03B)
- **Input:** XREFDAT, CUSTDAT, ACCTDAT
- **Output:** Statement report file
- **Logic:** Join xref/customer/account data, call CBSTM03B for page formatting

## MQ Message APIs (Optional)

### Authorization Request (COPAUA0C)
- **Request Format:** CCPAURQY.cpy — Card number, transaction amount, merchant info
- **Reply Format:** CCPAURLY.cpy — Approval code, reason code, status
- **Error Format:** CCPAUERY.cpy — Error code, description

### Date Inquiry (CODATE01)
- **Request:** System date inquiry message
- **Reply:** Current system date/time

### Account Inquiry (COACCT01)
- **Request:** Account number
- **Reply:** Full ACCOUNT-RECORD (CVACT01Y layout, 300 bytes)

---

*See also: [Interfaces](./interfaces.md) | [Business Logic](../behavior/business-logic.md) | [Workflows](../behavior/workflows.md)*
