SAP 10.3 Calculation Service

A RESTful API for calculating energy performance ratings according to the UK's Standard Assessment Procedure (SAP) version 10.3

Version 1.0.0

Service Overview

The SAP 10.3 Calculation Service is a high-performance RESTful API developed by Kaizen Certification Limited for calculating energy performance ratings according to the UK's Standard Assessment Procedure (SAP) version 10.3.

Service Information: This service processes SAP 10.3 XML input files and returns comprehensive energy assessment ratings used for Energy Performance Certificates (EPCs) in the UK.
Service Details
Service URL https://sap10-2-service.kaizencertification.co.uk
API Endpoint https://sap10-2-service.kaizencertification.co.uk/api/rating
Content Type application/xml
Response Format application/json
Authentication Bearer Token (API Key)

Authentication & API Keys

All API requests require a valid API key passed in the Authorization header.

Internal Development Key

API KEY 5ad04212-786f-4265-3693-25cba23cca80
Important: This internal key is for development and testing only. External clients must request their own API key.

For External Companies & Users

  • Unique API Keys: Each external company/user receives a unique API key
  • Key Generation: Contact Kaizen Certification Limited for API key provisioning
  • Usage Tracking: All API calls are logged in our database for monitoring
  • Analytics: Monthly usage reports available upon request

Authentication Header Format

Authorization: Bearer {your-api-key}

Database Tracking

The service automatically logs the following information for each API call:

API Key Used
Identifier for usage tracking
Timestamp
Date and time of request
Request Size
Size of XML payload
Response Status
HTTP status code returned
Calculation Duration
Time taken to process
Client IP
Client IP address (if available)

API Usage

Calculate Ratings Endpoint

POST /api/rating

Request Headers

Content-Type: application/xml
Authorization: Bearer {api-key}

Request Body

Valid SAP 10.3 XML file content (maximum 10MB)

Response Format

{
    "success": true|false,
    "message": "Status message",
    "data": {
        // Ratings object (see below)
    },
    "validationErrors": [],
    "timestamp": "2024-01-15T10:30:00Z"
}

HTTP Status Codes

Code Description
200 Success - Calculation completed
400 Bad Request - Invalid XML format
401 Unauthorized - Invalid or missing API key
422 Unprocessable Entity - Validation errors
500 Internal Server Error
Rate Limiting: 100 requests per minute per API key. Maximum 5 concurrent requests per API key.

Ratings Object

The complete Ratings class returned by the API:

DER
Dwelling Emission Rate
"0.00"
TER
Target Emission Rate
"0.00"
DFEE
Dwelling Fabric Energy Efficiency
"0.00"
TFEE
Target Fabric Energy Efficiency
"0.00"
Dper
Dwelling Primary Energy Rating (%)
"0.00"
Tper
Target Primary Energy Rating (%)
"0.00"
EnergyRatingCurrent
Current SAP Rating (0-100)
"0"
EnergyRatingPotential
Potential SAP Rating (0-100)
"0"
EnvironmentalImpactCurrent
Current Environmental Impact
"0"
EnvironmentalImpactPotential
Potential Environmental Impact
"0"
EnvironmentalImpactAverage
Average (Northern Ireland only)
""
EnergyConsumptionCurrent
Current consumption (kWh/m²/year)
"0"
EnergyConsumptionPotential
Potential consumption (kWh/m²/year)
"0"
CO2EmissionsCurrent
Current CO₂ emissions (tonnes/year)
"0"
CO2EmissionsPotential
Potential CO₂ emissions (tonnes/year)
"0"
CO2EmissionsCurrentPerFloorArea
CO₂ per floor area (kgCO₂/m²/year)
"0"
LightingCostCurrent
Current lighting cost (£/year)
"0"
LightingCostPotential
Potential lighting cost (£/year)
"0"
HeatingCostCurrent
Current heating cost (£/year)
"0"
HeatingCostPotential
Potential heating cost (£/year)
"0"
HotWaterCostCurrent
Current hot water cost (£/year)
"0"
HotWaterCostPotential
Potential hot water cost (£/year)
"0"
LightingCurrent
Current lighting energy (kWh/year)
"0"
LightingPotential
Potential lighting energy (kWh/year)
"0"

Code Examples

C# Example

using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

private async Task CalculateSAPRatingsAsync()
{
    var apiKey = "5ad04212-786f-4265-3693-25cba23cca80";
    var xmlFilePath = @"C:\Path\To\Your\SAP-Report.xml";
    var apiUrl = "https://sap10-2-service.kaizencertification.co.uk/api/rating";
    
    // Read XML file
    var xmlContent = await File.ReadAllTextAsync(xmlFilePath);
    
    using var httpClient = new HttpClient();
    httpClient.DefaultRequestHeaders.Authorization = 
        new AuthenticationHeaderValue("Bearer", apiKey);
    
    var content = new StringContent(xmlContent, Encoding.UTF8, "application/xml");
    var response = await httpClient.PostAsync(apiUrl, content);
    var responseBody = await response.Content.ReadAsStringAsync();
    
    Console.WriteLine($"Status Code: {response.StatusCode}");
    Console.WriteLine($"Response: {responseBody}");
    
    // Parse JSON response
    // var ratingResponse = JsonConvert.DeserializeObject(responseBody);
}

Python Example

import requests

api_key = "your-api-key"
api_url = "https://sap10-2-service.kaizencertification.co.uk/api/rating"

headers = {
    'Content-Type': 'application/xml',
    'Authorization': f'Bearer {api_key}'
}

with open('sap-report.xml', 'r') as file:
    xml_content = file.read()

response = requests.post(api_url, headers=headers, data=xml_content)

if response.status_code == 200:
    ratings = response.json()
    print(f"DER: {ratings['data']['Der']}")
    print(f"TER: {ratings['data']['Ter']}")
else:
    print(f"Error: {response.status_code}")
    print(response.text)

JavaScript Example

const apiKey = "your-api-key";
const apiUrl = "https://sap10-2-service.kaizencertification.co.uk/api/rating";

async function calculateRatings(xmlContent) {
    try {
        const response = await fetch(apiUrl, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/xml',
                'Authorization': `Bearer ${apiKey}`
            },
            body: xmlContent
        });
        
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        
        const data = await response.json();
        console.log('Calculation successful:', data);
        return data;
    } catch (error) {
        console.error('Error calculating ratings:', error);
        throw error;
    }
}

// Usage
const xmlContent = `<?xml version="1.0"?>
<SAP-Report>
    <!-- Your SAP 10.3 XML content -->
</SAP-Report>`;

calculateRatings(xmlContent);

Support & Contact

Technical Support hello@kaizencertification.co.uk
Phone +44 (0)330 223 6278
Website kaizencertification.co.uk

Company Address

Kaizen Certification Limited

Bishops Court
17a The Broadway
Hatfield, Hertfordshire
AL9 5HZ
United Kingdom

Support Hours: Monday-Friday, 9:00-17:00 GMT
Service Availability: 99.5% uptime SLA

Additional Endpoints

Endpoint Method Description
/api/health GET Service status and version information
/api/validate-xml POST Validate XML without performing calculations