{"openapi":"3.1.0","info":{"title":"Forms 5472 & 1120 PDF API","version":"1.0.0","description":"Versioned API for generating filled Forms 5472 and 1120 PDFs from structured filing data."},"servers":[{"url":"https://5472-1120.com"}],"paths":{"/api/v1/openapi.json":{"get":{"summary":"Get the OpenAPI document","operationId":"getOpenApi","responses":{"200":{"description":"OpenAPI JSON document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/fill-pdf":{"post":{"summary":"Generate a filled Forms 5472 and 1120 PDF","operationId":"fillPdf","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillPdfRequest"}}}},"responses":{"200":{"description":"Filled PDF stored in R2","headers":{"x-updated-placeholders":{"schema":{"type":"string"}},"x-missing-placeholders":{"schema":{"type":"string"}},"x-unused-input-keys":{"schema":{"type":"string"}},"x-pdf-baked":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FillPdfResponse"}}}}}},"options":{"summary":"CORS preflight for fill-pdf","operationId":"fillPdfPreflight","responses":{"204":{"description":"No content"}}}},"/api/v1/files/{fileId}":{"get":{"summary":"Download a previously generated PDF","operationId":"getGeneratedPdf","parameters":[{"name":"fileId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"PDF file","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Not found"}}}}},"components":{"schemas":{"FillPdfResponse":{"type":"object","required":["url","key","filename"],"properties":{"url":{"type":"string"},"key":{"type":"string"},"filename":{"type":"string"},"updatedPlaceholders":{"type":"number"},"missingPlaceholders":{"type":"number"},"unusedKeys":{"type":"number"},"baked":{"type":"boolean"}}},"FillPdfRequest":{"type":"object","required":["filing"],"properties":{"filename":{"type":"string"},"includeSignature":{"type":"boolean","default":false},"bake":{"type":"boolean","default":true},"filing":{"$ref":"#/components/schemas/FilingPayload"}}},"FilingPayload":{"type":"object","required":["taxYear","status","filingName","companyData","ownerData","financialData","transactionData","part7Data","form1120Data","generatedStatements","signatureData","stepProgress"],"properties":{"taxYear":{"type":"integer"},"status":{"type":"string","enum":["draft","complete"]},"filingName":{"type":"string"},"companyData":{"$ref":"#/components/schemas/CompanyData"},"ownerData":{"$ref":"#/components/schemas/OwnerData"},"financialData":{"$ref":"#/components/schemas/FinancialData"},"transactionData":{"$ref":"#/components/schemas/TransactionData"},"part7Data":{"$ref":"#/components/schemas/Part7Data"},"form1120Data":{"$ref":"#/components/schemas/Form1120Data"},"generatedStatements":{"$ref":"#/components/schemas/GeneratedStatements"},"signatureData":{"$ref":"#/components/schemas/SignatureData"},"stepProgress":{"type":"object","additionalProperties":{"type":"string","enum":["empty","complete","warning"]}}}},"CompanyData":{"type":"object","properties":{"legalName":{"type":"string"},"ein":{"type":"string"},"streetAddress":{"type":"string"},"roomOrSuite":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"dateOfIncorporation":{"type":"string"},"countryOfIncorporation":{"type":"string"},"principalBusinessActivity":{"type":"string"},"businessActivityCode":{"type":"string"},"countryWhereBusinessConducted":{"type":"string"},"taxYear":{"type":"integer"}}},"OwnerData":{"type":"object","properties":{"ownerType":{"type":"string","enum":["individual","company"]},"fullName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"stateOrProvince":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"countryOfTaxResidence":{"type":"string"},"countryOfCitizenshipOrIncorporation":{"type":"string"},"usIdentifyingNumber":{"type":"string"},"foreignTaxId":{"type":"string"},"ownershipPercentage":{"type":"number"}}},"PersonalExpense":{"type":"object","properties":{"amount":{"type":"number"},"description":{"type":"string"}}},"LoanDetail":{"type":"object","properties":{"amount":{"type":"number"},"direction":{"type":"string","enum":["owner-to-llc","llc-to-owner"]},"interestRate":{"type":"number"}}},"FinancialData":{"type":"object","properties":{"totalIncome":{"type":"number"},"hadPersonalExpenses":{"type":"boolean"},"personalExpenses":{"type":"array","items":{"$ref":"#/components/schemas/PersonalExpense"}},"capitalContributions":{"type":"number"},"distributions":{"type":"number"},"hadLoans":{"type":"boolean"},"loans":{"type":"array","items":{"$ref":"#/components/schemas/LoanDetail"}},"partVReviewed":{"type":"boolean"}}},"TransactionData":{"type":"object","properties":{"servicesProvidedByOwner":{"type":"boolean"},"paymentsForServices":{"type":"boolean"},"paymentsForServicesAmount":{"type":"number"},"commissions":{"type":"boolean"},"commissionsAmount":{"type":"number"},"royalties":{"type":"boolean"},"royaltiesAmount":{"type":"number"},"interest":{"type":"boolean"},"interestAmount":{"type":"number"},"otherAmounts":{"type":"boolean"},"otherAmountsAmount":{"type":"number"},"otherAmountsDescription":{"type":"string"},"partVIReviewed":{"type":"boolean"}}},"Part7Data":{"type":"object","properties":{"importGoods":{"type":"boolean"},"costSharingArrangement":{"type":"boolean"},"interestRoyaltyIssues":{"type":"boolean"},"fdii":{"type":"boolean"},"loans":{"type":"boolean"},"coveredDebt":{"type":"boolean"}}},"Form1120Data":{"type":"object","properties":{"totalAssets":{"type":"number"},"grossReceipts":{"type":"number"},"taxableIncome":{"type":"number"}}},"GeneratedStatements":{"type":"object","properties":{"partVStatement":{"type":"string"},"partVIStatement":{"type":"string"}}},"SignatureCropInsets":{"type":"object","properties":{"top":{"type":"number"},"right":{"type":"number"},"bottom":{"type":"number"},"left":{"type":"number"}}},"SignaturePlacement":{"type":"object","properties":{"leftPercent":{"type":"number"},"topPercent":{"type":"number"}}},"SignatureData":{"type":"object","properties":{"imageDataUrl":{"type":["string","null"]},"originalImageDataUrl":{"type":["string","null"]},"cropInsets":{"$ref":"#/components/schemas/SignatureCropInsets"},"placement":{"$ref":"#/components/schemas/SignaturePlacement"},"brightness":{"type":"number"},"contrast":{"type":"number"},"capturedAt":{"type":["string","null"]},"source":{"type":["string","null"],"enum":["camera","upload",null]}}}}}}