# Forms 5472 & 1120 Agent Guide

This site exposes a simple PDF generation API for agents.

Base URL:

- `https://5472-1120.com`

Primary resources:

- OpenAPI spec: `https://5472-1120.com/api/v1/openapi.json`
- Human docs: `https://5472-1120.com/docs/`
- Filing app: `https://5472-1120.com/`

## Goal

One agent action is available:

- submit a structured filing payload and receive a baked PDF URL for Forms 5472 and 1120

The filing PDF output is baked by default, includes the current header treatment, and appends Part V and Part VI statement pages when present.

## Endpoints

- `POST /api/v1/fill-pdf`
- `GET /api/v1/files/:id.pdf`

Request content type:

- `application/json`

Response content type:

- `POST /api/v1/fill-pdf`: `application/json`
- `GET /api/v1/files/:id.pdf`: `application/pdf`

## Current auth model

There is currently no authentication layer on this versioned endpoint.

## Request shape

Top-level JSON fields:

- `filing` required
- `filename` optional
- `includeSignature` optional boolean
- `bake` optional boolean, defaults to `true`

The `filing` object should follow the same structure used by the interactive platform. At minimum, include:

- `taxYear`
- `status`
- `filingName`
- `companyData`
- `ownerData`
- `financialData`
- `transactionData`
- `part7Data`
- `form1120Data`
- `generatedStatements`
- `signatureData`
- `stepProgress`

## Minimal curl example

1) Generate and store the PDF (returns JSON):

```bash
curl -X POST "https://5472-1120.com/api/v1/fill-pdf" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "sample.pdf",
    "includeSignature": false,
    "filing": {
      "taxYear": 2025,
      "status": "draft",
      "filingName": "Sample LLC - 2025",
      "companyData": {
        "legalName": "Sample LLC",
        "ein": "12-3456789",
        "streetAddress": "123 Main St",
        "roomOrSuite": "",
        "city": "Miami",
        "state": "FL",
        "zip": "33101",
        "dateOfIncorporation": "01/15/2025",
        "countryOfIncorporation": "United States",
        "principalBusinessActivity": "Software publishing",
        "businessActivityCode": "513210",
        "countryWhereBusinessConducted": "United States",
        "taxYear": 2025
      },
      "ownerData": {
        "ownerType": "individual",
        "fullName": "Jane Owner",
        "streetAddress": "456 Owner Ave",
        "city": "Toronto",
        "stateOrProvince": "ON",
        "zip": "M5V 2T6",
        "country": "Canada",
        "countryOfTaxResidence": "Canada",
        "countryOfCitizenshipOrIncorporation": "Canada",
        "usIdentifyingNumber": "",
        "foreignTaxId": "CA-123456789",
        "ownershipPercentage": 100
      },
      "financialData": {
        "totalIncome": 0,
        "hadPersonalExpenses": true,
        "personalExpenses": [],
        "capitalContributions": 1000,
        "distributions": 0,
        "hadLoans": false,
        "loans": [],
        "partVReviewed": true
      },
      "transactionData": {
        "servicesProvidedByOwner": false,
        "paymentsForServices": false,
        "paymentsForServicesAmount": 0,
        "commissions": false,
        "commissionsAmount": 0,
        "royalties": false,
        "royaltiesAmount": 0,
        "interest": false,
        "interestAmount": 0,
        "otherAmounts": false,
        "otherAmountsAmount": 0,
        "otherAmountsDescription": "",
        "partVIReviewed": true
      },
      "part7Data": {
        "importGoods": false,
        "costSharingArrangement": false,
        "interestRoyaltyIssues": false,
        "fdii": false,
        "loans": false,
        "coveredDebt": false
      },
      "form1120Data": {
        "totalAssets": 1000,
        "grossReceipts": 0,
        "taxableIncome": 0
      },
      "generatedStatements": {
        "partVStatement": "",
        "partVIStatement": ""
      },
      "signatureData": {
        "imageDataUrl": null,
        "originalImageDataUrl": null,
        "cropInsets": { "top": 0, "right": 0, "bottom": 0, "left": 0 },
        "placement": { "leftPercent": 21.1, "topPercent": 89.8 },
        "brightness": -20,
        "contrast": 120,
        "capturedAt": null,
        "source": null
      },
      "stepProgress": {}
    }
  }'
```

The JSON response includes:

- `url`: a direct download link
- `key`: the file id

2) Download the generated PDF:

```bash
curl -L "<url from the JSON response>" --output filing.pdf
```

## Implementation notes

- `POST /api/v1/fill-pdf` uses the same template and field map as the interactive app.
- Signature data is optional.
- Part V and Part VI statement pages are appended automatically when statement text exists.
- Output is baked by default so the PDF is not form-editable in standard viewers.
