Backend Solution

Swift Reports HMRC

Production-ready Swift server for HMRC RTI submissions with IRmark calculation and GovTalk XML handling

EPSEmployer Payment Summary
FPSFull Payment Submission
IRmarkAutomatic Calculation
$15one-time + 1 year updates
EPSSender.swift
func sendEpsHandler(_ req: Request) async throws -> Response {
    let i = try req.content.decode(EPSInput.self)
    let epsSender = EPSSender()

    // Step 1: Build IRenvelope WITHOUT IRmark
    let envelopeNoIR = epsSender.buildIRenvelopeForIRmark(i)
    
    // Step 2: Build complete GovTalk message
    let govtalkNoIR = epsSender.buildGovTalkForIRmark(i, irEnvelopeWithoutIRmark: envelopeNoIR)
    
    // Step 3: Calculate IRmark from canonicalized content
    let irmark = try epsSender.computeIRmarkFromGovTalkBody(govtalkXML: govtalkNoIR, logger: req.logger)
    
    // Step 4: Insert IRmark into final document
    let govtalkFinal = try epsSender.injectIRmarkIntoGovTalk(govtalkNoIR, irmarkB64: irmark, taxYear: i.relatedTaxYear, logger: req.logger)
    
    // Step 5: Submit to HMRC
    return try await EPSSender.postToHMRC(xml: govtalkFinal, urlString: endpoint, logger: req.logger)
}

Key Features

Everything you need for HMRC RTI submissions

EPS Submissions

Complete Employer Payment Summary processing with automatic IRmark calculation and validation

FPS Submissions

Full Payment Submission with employee payment details and comprehensive data validation

IRmark Calculation

Automatic SHA-1 hash generation and Base64 encoding following HMRC specifications

XML Canonicalization

C14N 1.0 compliant XML processing using libxml2 for perfect HMRC compatibility

GovTalk Integration

Full GovTalk message envelope handling with proper namespace management

Polling Support

Status checking for submitted reports with correlation ID tracking

API Documentation

Simple REST API for HMRC submissions

POST/reports/eps

Submit Employer Payment Summary

curl -X POST http://localhost:8080/reports/eps \
  -H "Content-Type: application/json" \
  -d '{
    "senderID": "your-sender-id",
    "senderPassword": "your-password",
    "officeNo": "120",
    "payeRef": "FE94467",
    "periodEnd": "2026-04-05",
    "relatedTaxYear": "25-26"
  }'
POST/reports/fps/poll

Poll submission status

curl -X POST http://localhost:8080/reports/fps/poll \
  -H "Content-Type: application/json" \
  -d '{
    "correlationId": "your-correlation-id"
  }'
POST/reports/fps

Submit Full Payment Submission

curl -X POST http://localhost:8080/reports/fps \
  -H "Content-Type: application/json" \
  -d '{
    "senderID": "your-sender-id",
    "senderPassword": "your-password",
    "officeNo": "120",
    "payeRef": "FE94467",
    "employees": [{
      "details": {
        "forename": "John",
        "surname": "Smith",
        "birthDate": "1980-01-01"
      },
      "employment": {
        "payId": "EMP001",
        "figuresToDate": {
          "taxablePay": "50000.00",
          "totalTax": "10000.00"
        }
      }
    }]
  }'
POST/reports/eps/poll

Poll submission status

curl -X POST http://localhost:8080/reports/eps/poll \
  -H "Content-Type: application/json" \
  -d '{
    "correlationId": "your-correlation-id"
  }'

Technology Stack

Built with modern Swift technologies

Swift 5.9+

Modern, safe, and fast programming language

Vapor Framework

Server-side Swift web framework

libxml2

Robust XML processing and canonicalization

Crypto

SHA-1 hash generation for IRmark

Fluent ready

Ready to use with Fluent and Postgres

HTTP Client

Built-in HTTP client for HMRC API communication

Get Started Today

One-time payment, lifetime access

$15
one-time payment
Complete source code
1 year of updates
Email support

What You Get

Everything you need to integrate HMRC reporting

Complete Source Code

Full Swift Vapor project with all HMRC integration code

1 Year Updates

Receive updates and bug fixes for a full year

Documentation

Comprehensive docs and code examples

How It Works

Get access in 3 simple steps

Make Payment

Complete the $15 one-time payment

Provide GitHub

Enter your GitHub username in the order form

Get Access

Repository access within a few minutes

Ready to Get Started?

Join developers who are already using our HMRC integration