{
  "openapi": "3.0.0",
  "info": {
    "title": "PDF Generation API",
    "description": "",
    "version": "1.0.0"
  },
  "paths": {
    "/pdf": {
      "post": {
        "summary": "PDF Supplier Contract Generation",
        "description": "Returns a PDF contract document for the requested supplier & utility, with Request fields merged in.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePDF"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratePDFResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "GeneratePDFWrapper"
      }
    },
    "/ping": {
      "get": {
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "PingWrapper"
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "Message": {
            "type": "string"
          },
          "ErrorDetail": {
            "type": "string"
          }
        },
        "format": "Error"
      },
      "GeneratePDF": {
        "type": "object",
        "properties": {
          "contractDetails": {
            "type": "object",
            "properties": {
              "Supplier": {
                "type": "string",
                "example": "British Gas"
              },
              "ElectricSupply": {
                "type": "boolean"
              },
              "ID": {
                "type": "integer",
                "format": "int32"
              },
              "DataFields": {
                "type": "array",
                "example": [
                  {
                    "Key": "address 1",
                    "Value": "Address 1"
                  },
                  {
                    "Key": "address 2",
                    "Value": "Address 2"
                  },
                  {
                    "Key": "address 3",
                    "Value": "Address 3"
                  },
                  {
                    "Key": "address 4",
                    "Value": "Address 4"
                  },
                  {
                    "Key": "post code",
                    "Value": "Post code"
                  },
                  {
                    "Key": "billing address1",
                    "Value": "Billing address 1"
                  },
                  {
                    "Key": "billing address2",
                    "Value": "Billing address 2"
                  },
                  {
                    "Key": "billing address3",
                    "Value": "Billing address 3"
                  },
                  {
                    "Key": "billing address4",
                    "Value": "Billing address 4"
                  },
                  {
                    "Key": "billing postcode",
                    "Value": "Billing post code"
                  },
                  {
                    "Key": "email",
                    "Value": "test12345@fake.co.uk"
                  },
                  {
                    "Key": "landline",
                    "Value": "01234567890"
                  },
                  {
                    "Key": "mobile",
                    "Value": "98765432101"
                  },
                  {
                    "Key": "contact name",
                    "Value": "ContactForename ContactSurname"
                  },
                  {
                    "Key": "title",
                    "Value": "Mr"
                  },
                  {
                    "Key": "premises name",
                    "Value": "UD Group"
                  },
                  {
                    "Key": "payment method",
                    "Value": "Direct Debit (Monthly)"
                  },
                  {
                    "Key": "business type",
                    "Value": "LTD"
                  },
                  {
                    "Key": "dd start date",
                    "Value": "2017-05-01T00:00:00"
                  },
                  {
                    "Key": "dayusage",
                    "Value": "20000"
                  },
                  {
                    "Key": "daycharge",
                    "Value": "10"
                  },
                  {
                    "Key": "standing charge",
                    "Value": "20"
                  },
                  {
                    "Key": "ref"
                  },
                  {
                    "Key": "period"
                  },
                  {
                    "Key": "sc"
                  },
                  {
                    "Key": "fits"
                  },
                  {
                    "Key": "creditscore",
                    "Value": "55"
                  },
                  {
                    "Key": "director dob",
                    "Value": "1990-11-24T00:00:00"
                  },
                  {
                    "Key": "company address 1",
                    "Value": "Company address line 1"
                  },
                  {
                    "Key": "company address 2",
                    "Value": "Company address line 2"
                  },
                  {
                    "Key": "company address 3",
                    "Value": "Company address line 3"
                  },
                  {
                    "Key": "company address 4",
                    "Value": "Company address line 4"
                  },
                  {
                    "Key": "company post code",
                    "Value": "M22 4db"
                  },
                  {
                    "Key": "ternancy start date",
                    "Value": "2015-01-01T00:00:00"
                  },
                  {
                    "Key": "date of birth",
                    "Value": "2000-01-01T00:00:00"
                  },
                  {
                    "Key": "bank name",
                    "Value": "Bank Name"
                  },
                  {
                    "Key": "bank account name",
                    "Value": "Bank Account Name"
                  },
                  {
                    "Key": "account number",
                    "Value": "12345678"
                  },
                  {
                    "Key": "sort code",
                    "Value": "666666"
                  },
                  {
                    "Key": "bank post code",
                    "Value": "BL2 6HS"
                  },
                  {
                    "Key": "job title",
                    "Value": "Job Title"
                  },
                  {
                    "Key": "company name",
                    "Value": "company name"
                  },
                  {
                    "Key": "previous address1",
                    "Value": "Previous Address 1"
                  },
                  {
                    "Key": "previous address2",
                    "Value": "Previous Address 2"
                  },
                  {
                    "Key": "previous address3",
                    "Value": "Previous Address 3"
                  },
                  {
                    "Key": "previous postcode",
                    "Value": "Previous Postcode"
                  },
                  {
                    "Key": "company number",
                    "Value": "123456789"
                  },
                  {
                    "Key": "director address1",
                    "Value": "Director Address 1"
                  },
                  {
                    "Key": "director address2",
                    "Value": "Director Address 2"
                  },
                  {
                    "Key": "director postcode",
                    "Value": "Director Postcode"
                  },
                  {
                    "Key": "director forename",
                    "Value": "director forename"
                  },
                  {
                    "Key": "director surname",
                    "Value": "director surname"
                  },
                  {
                    "Key": "elec contract end date",
                    "Value": "2017-04-29T00:00:00"
                  },
                  {
                    "Key": "elec new contract date",
                    "Value": "2017-04-30T00:00:00"
                  },
                  {
                    "Key": "current electric supplier 1",
                    "Value": "British Gas"
                  },
                  {
                    "Key": "mpan top line 1",
                    "Value": "03801131"
                  },
                  {
                    "Key": "mpan bottom line 1",
                    "Value": "1620000428779"
                  },
                  {
                    "Key": "new supplier electricity",
                    "Value": "British Gas"
                  },
                  {
                    "Key": "elec new contract length",
                    "Value": "24"
                  },
                  {
                    "Key": "nightusage",
                    "Value": "20000"
                  },
                  {
                    "Key": "nightcharge",
                    "Value": "23.45"
                  },
                  {
                    "Key": "eveandwendusage",
                    "Value": "30000"
                  },
                  {
                    "Key": "eveandwendcharge",
                    "Value": "34.56"
                  },
                  {
                    "Key": "electric smart meter",
                    "Value": "true"
                  }
                ],
                "items": {
                  "type": "object",
                  "properties": {
                    "Key": {
                      "type": "string"
                    },
                    "Value": {
                      "type": "object"
                    }
                  }
                }
              },
              "OverridableDataFields": {
                "type": "array",
                "example": [
                  {
                    "Key": "sseaccountmanager",
                    "Value": "SSE Account Manager"
                  },
                  {
                    "Key": "brokername",
                    "Value": "Broker Company Name"
                  },
                  {
                    "Key": "fixedterm",
                    "Value": 12
                  },
                  {
                    "Key": "ElectricityAnnualPrice",
                    "Value": 15000
                  },
                  {
                    "Key": "ElectricityAnnualPriceInclusive",
                    "Value": 18000
                  },
                  {
                    "Key": "GasAnnualPriceInclusive",
                    "Value": 12000
                  },
                  {
                    "Key": "GasAnnualPrice",
                    "Value": 10000
                  },
                  {
                    "Key": "CompanySicCode",
                    "Value": "1221"
                  },
                  {
                    "Key": "MpanSerialNumber",
                    "Value": "elecSerial"
                  },
                  {
                    "Key": "MprnSerialNumber",
                    "Value": "gasSerial"
                  },
                  {
                    "Key": "brokername",
                    "Value": "Brokerage name"
                  },
                  {
                    "Key": "agentname",
                    "Value": "Broker agent name"
                  },
                  {
                    "Key": "brokerContactNum",
                    "Value": "1234567"
                  },
                  {
                    "Key": "BrokerageName",
                    "Value": "Brokerage name"
                  },
                  {
                    "Key": "AgentName",
                    "Value": "Broker agent name"
                  },
                  {
                    "Key": "AgentNumber",
                    "Value": "12345671234"
                  },
                  {
                    "Key": "AgentEmail",
                    "Value": "agent.email@xyz.com"
                  },
                  {
                    "Key": "Kva",
                    "Value": "65"
                  },
                  {
                    "Key": "CapacityCharge",
                    "Value": "4.59"
                  },
                  {
                    "Key": "ElectricityNewContractEndDate",
                    "Value": "2020-04-29T00:00:00"
                  },
                  {
                    "Key": "ContactTitle",
                    "Value": "Ms"
                  },
                  {
                    "Key": "BillingLandline",
                    "Value": "0123456789"
                  },
                  {
                    "Key": "BillingEmail",
                    "Value": "billing.email@fakeemail.co.uk"
                  },
                  {
                    "Key": "BillingContactFirstName",
                    "Value": "Bill"
                  },
                  {
                    "Key": "BillingContactLastName",
                    "Value": "Cont"
                  },
                  {
                    "Key": "MicroBusiness",
                    "Value": "false"
                  },
                  {
                    "Key": "YearsAtAddress",
                    "Value": "3"
                  },
                  {
                    "Key": "ElectricityUnitRateUplift",
                    "Value": 0.2
                  },
                  {
                    "Key": "GasUnitRateUplift",
                    "Value": 0.1
                  },
                  {
                    "Key": "ElectricityStandingChargeUplift",
                    "Value": 4
                  },
                  {
                    "Key": "GasStandingChargeUplift",
                    "Value": 5
                  },
                  {
                    "Key": "ElectricityAnnualCommission",
                    "Value": 1234.567
                  },
                  {
                    "Key": "GasAnnualCommission",
                    "Value": 5432.981
                  },
                  {
                    "Key": "CompanyIncorporationDate",
                    "Value": "2010-05-10T00:00:00"
                  },
                  {
                    "Key": "SubBrokerageName",
                    "Value": "Test Sub"
                  },
                  {
                    "Key": "AggregatorBrokerageName",
                    "Value": "Test Agg"
                  },
                  {
                    "Key": "BrokerageAdr",
                    "Value": "ABC001"
                  },
                  {
                    "Key": "SubBrokerageAdr",
                    "Value": "ABC001"
                  },
                  {
                    "Key": "AggregatorBrokerageAdr",
                    "Value": "ABC002"
                  },
                  {
                    "Key": "BankAccountType",
                    "Value": "Business"
                  },
                  {
                    "Key": "MeterOperatorMpid",
                    "Value": "UKDC"
                  },
                  {
                    "Key": "MeterOperatorName",
                    "Value": "IMServ Europe Ltd"
                  },
                  {
                    "Key": "DataAggregatorMpid",
                    "Value": "UKDC"
                  },
                  {
                    "Key": "DataAggregatorName",
                    "Value": "IMServ Europe Ltd"
                  },
                  {
                    "Key": "DataCollectorMpid",
                    "Value": "UKDC"
                  },
                  {
                    "Key": "DataCollectorName",
                    "Value": "IMServ Europe Ltd"
                  },
                  {
                    "Key": "HasCustomMeteringService",
                    "Value": "false"
                  },
                  {
                    "Key": "Kva",
                    "Value": "250"
                  },
                  {
                    "Key": "CapacityCharge",
                    "Value": "3.21"
                  },
                  {
                    "Key": "ExcessCapacityCharge",
                    "Value": "6.54"
                  }
                ],
                "items": {
                  "type": "object",
                  "properties": {
                    "Key": {
                      "type": "string"
                    },
                    "Value": {
                      "type": "object"
                    }
                  }
                }
              },
              "SecurityDetails": {
                "type": "object",
                "properties": {
                  "LicenceCode": {
                    "type": "string",
                    "example": "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
                  },
                  "mascaradeuser": {
                    "type": "string",
                    "example": "Test User"
                  }
                },
                "format": "SecurityDetails"
              },
              "CompanyName": {
                "type": "string"
              },
              "ContractType": {
                "type": "string"
              },
              "TemplateOptions": {
                "type": "object",
                "properties": {
                  "HalfHourly": {
                    "type": "boolean",
                    "default": false
                  },
                  "ChangeOfTenancy": {
                    "type": "boolean",
                    "default": false
                  },
                  "PlanType": {
                    "type": "string",
                    "default": ""
                  }
                },
                "format": "TemplateOptions"
              }
            },
            "format": "ContractDetails"
          }
        },
        "format": "GeneratePDF"
      },
      "GeneratePDFResultWrapper": {
        "type": "object",
        "properties": {
          "GeneratePDFResult": {
            "$ref": "#/components/schemas/PDFResult"
          }
        },
        "format": "GeneratePDFResultWrapper"
      },
      "PingResultWrapper": {
        "type": "object",
        "properties": {
          "PingResult": {
            "type": "string"
          }
        },
        "format": "PingResultWrapper"
      },
      "SecurityDetails": {
        "type": "object",
        "properties": {
          "LicenceCode": {
            "type": "string",
            "example": "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
          },
          "mascaradeuser": {
            "type": "string",
            "example": "Test User"
          }
        },
        "format": "SecurityDetails"
      },
      "ContractDetails": {
        "type": "object",
        "properties": {
          "Supplier": {
            "type": "string",
            "example": "British Gas"
          },
          "ElectricSupply": {
            "type": "boolean"
          },
          "ID": {
            "type": "integer",
            "format": "int32"
          },
          "DataFields": {
            "type": "array",
            "example": [
              {
                "Key": "address 1",
                "Value": "Address 1"
              },
              {
                "Key": "address 2",
                "Value": "Address 2"
              },
              {
                "Key": "address 3",
                "Value": "Address 3"
              },
              {
                "Key": "address 4",
                "Value": "Address 4"
              },
              {
                "Key": "post code",
                "Value": "Post code"
              },
              {
                "Key": "billing address1",
                "Value": "Billing address 1"
              },
              {
                "Key": "billing address2",
                "Value": "Billing address 2"
              },
              {
                "Key": "billing address3",
                "Value": "Billing address 3"
              },
              {
                "Key": "billing address4",
                "Value": "Billing address 4"
              },
              {
                "Key": "billing postcode",
                "Value": "Billing post code"
              },
              {
                "Key": "email",
                "Value": "test12345@fake.co.uk"
              },
              {
                "Key": "landline",
                "Value": "01234567890"
              },
              {
                "Key": "mobile",
                "Value": "98765432101"
              },
              {
                "Key": "contact name",
                "Value": "ContactForename ContactSurname"
              },
              {
                "Key": "title",
                "Value": "Mr"
              },
              {
                "Key": "premises name",
                "Value": "UD Group"
              },
              {
                "Key": "payment method",
                "Value": "Direct Debit (Monthly)"
              },
              {
                "Key": "business type",
                "Value": "LTD"
              },
              {
                "Key": "dd start date",
                "Value": "2017-05-01T00:00:00"
              },
              {
                "Key": "dayusage",
                "Value": "20000"
              },
              {
                "Key": "daycharge",
                "Value": "10"
              },
              {
                "Key": "standing charge",
                "Value": "20"
              },
              {
                "Key": "ref"
              },
              {
                "Key": "period"
              },
              {
                "Key": "sc"
              },
              {
                "Key": "fits"
              },
              {
                "Key": "creditscore",
                "Value": "55"
              },
              {
                "Key": "director dob",
                "Value": "1990-11-24T00:00:00"
              },
              {
                "Key": "company address 1",
                "Value": "Company address line 1"
              },
              {
                "Key": "company address 2",
                "Value": "Company address line 2"
              },
              {
                "Key": "company address 3",
                "Value": "Company address line 3"
              },
              {
                "Key": "company address 4",
                "Value": "Company address line 4"
              },
              {
                "Key": "company post code",
                "Value": "M22 4db"
              },
              {
                "Key": "ternancy start date",
                "Value": "2015-01-01T00:00:00"
              },
              {
                "Key": "date of birth",
                "Value": "2000-01-01T00:00:00"
              },
              {
                "Key": "bank name",
                "Value": "Bank Name"
              },
              {
                "Key": "bank account name",
                "Value": "Bank Account Name"
              },
              {
                "Key": "account number",
                "Value": "12345678"
              },
              {
                "Key": "sort code",
                "Value": "666666"
              },
              {
                "Key": "bank post code",
                "Value": "BL2 6HS"
              },
              {
                "Key": "job title",
                "Value": "Job Title"
              },
              {
                "Key": "company name",
                "Value": "company name"
              },
              {
                "Key": "previous address1",
                "Value": "Previous Address 1"
              },
              {
                "Key": "previous address2",
                "Value": "Previous Address 2"
              },
              {
                "Key": "previous address3",
                "Value": "Previous Address 3"
              },
              {
                "Key": "previous postcode",
                "Value": "Previous Postcode"
              },
              {
                "Key": "company number",
                "Value": "123456789"
              },
              {
                "Key": "director address1",
                "Value": "Director Address 1"
              },
              {
                "Key": "director address2",
                "Value": "Director Address 2"
              },
              {
                "Key": "director postcode",
                "Value": "Director Postcode"
              },
              {
                "Key": "director forename",
                "Value": "director forename"
              },
              {
                "Key": "director surname",
                "Value": "director surname"
              },
              {
                "Key": "elec contract end date",
                "Value": "2017-04-29T00:00:00"
              },
              {
                "Key": "elec new contract date",
                "Value": "2017-04-30T00:00:00"
              },
              {
                "Key": "current electric supplier 1",
                "Value": "British Gas"
              },
              {
                "Key": "mpan top line 1",
                "Value": "03801131"
              },
              {
                "Key": "mpan bottom line 1",
                "Value": "1620000428779"
              },
              {
                "Key": "new supplier electricity",
                "Value": "British Gas"
              },
              {
                "Key": "elec new contract length",
                "Value": "24"
              },
              {
                "Key": "nightusage",
                "Value": "20000"
              },
              {
                "Key": "nightcharge",
                "Value": "23.45"
              },
              {
                "Key": "eveandwendusage",
                "Value": "30000"
              },
              {
                "Key": "eveandwendcharge",
                "Value": "34.56"
              },
              {
                "Key": "electric smart meter",
                "Value": "true"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/DataField"
            }
          },
          "OverridableDataFields": {
            "type": "array",
            "example": [
              {
                "Key": "sseaccountmanager",
                "Value": "SSE Account Manager"
              },
              {
                "Key": "brokername",
                "Value": "Broker Company Name"
              },
              {
                "Key": "fixedterm",
                "Value": 12
              },
              {
                "Key": "ElectricityAnnualPrice",
                "Value": 15000
              },
              {
                "Key": "ElectricityAnnualPriceInclusive",
                "Value": 18000
              },
              {
                "Key": "GasAnnualPriceInclusive",
                "Value": 12000
              },
              {
                "Key": "GasAnnualPrice",
                "Value": 10000
              },
              {
                "Key": "CompanySicCode",
                "Value": "1221"
              },
              {
                "Key": "MpanSerialNumber",
                "Value": "elecSerial"
              },
              {
                "Key": "MprnSerialNumber",
                "Value": "gasSerial"
              },
              {
                "Key": "brokername",
                "Value": "Brokerage name"
              },
              {
                "Key": "agentname",
                "Value": "Broker agent name"
              },
              {
                "Key": "brokerContactNum",
                "Value": "1234567"
              },
              {
                "Key": "BrokerageName",
                "Value": "Brokerage name"
              },
              {
                "Key": "AgentName",
                "Value": "Broker agent name"
              },
              {
                "Key": "AgentNumber",
                "Value": "12345671234"
              },
              {
                "Key": "AgentEmail",
                "Value": "agent.email@xyz.com"
              },
              {
                "Key": "Kva",
                "Value": "65"
              },
              {
                "Key": "CapacityCharge",
                "Value": "4.59"
              },
              {
                "Key": "ElectricityNewContractEndDate",
                "Value": "2020-04-29T00:00:00"
              },
              {
                "Key": "ContactTitle",
                "Value": "Ms"
              },
              {
                "Key": "BillingLandline",
                "Value": "0123456789"
              },
              {
                "Key": "BillingEmail",
                "Value": "billing.email@fakeemail.co.uk"
              },
              {
                "Key": "BillingContactFirstName",
                "Value": "Bill"
              },
              {
                "Key": "BillingContactLastName",
                "Value": "Cont"
              },
              {
                "Key": "MicroBusiness",
                "Value": "false"
              },
              {
                "Key": "YearsAtAddress",
                "Value": "3"
              },
              {
                "Key": "ElectricityUnitRateUplift",
                "Value": 0.2
              },
              {
                "Key": "GasUnitRateUplift",
                "Value": 0.1
              },
              {
                "Key": "ElectricityStandingChargeUplift",
                "Value": 4
              },
              {
                "Key": "GasStandingChargeUplift",
                "Value": 5
              },
              {
                "Key": "ElectricityAnnualCommission",
                "Value": 1234.567
              },
              {
                "Key": "GasAnnualCommission",
                "Value": 5432.981
              },
              {
                "Key": "CompanyIncorporationDate",
                "Value": "2010-05-10T00:00:00"
              },
              {
                "Key": "SubBrokerageName",
                "Value": "Test Sub"
              },
              {
                "Key": "AggregatorBrokerageName",
                "Value": "Test Agg"
              },
              {
                "Key": "BrokerageAdr",
                "Value": "ABC001"
              },
              {
                "Key": "SubBrokerageAdr",
                "Value": "ABC001"
              },
              {
                "Key": "AggregatorBrokerageAdr",
                "Value": "ABC002"
              },
              {
                "Key": "BankAccountType",
                "Value": "Business"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/DataField"
            }
          },
          "SecurityDetails": {
            "$ref": "#/components/schemas/SecurityDetails"
          },
          "CompanyName": {
            "type": "string"
          },
          "ContractType": {
            "type": "string"
          },
          "TemplateOptions": {
            "$ref": "#/components/schemas/TemplateOptions"
          }
        },
        "format": "ContractDetails"
      },
      "PDFResult": {
        "type": "object",
        "properties": {
          "PDFBytes": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "byte"
            }
          },
          "ID": {
            "type": "integer",
            "format": "int32"
          },
          "Error": {
            "$ref": "#/components/schemas/Error"
          }
        },
        "format": "PDFResult",
        "example": {
          "ID": 0,
          "PDFBytes": [
            37,
            80,
            68,
            0,
            45,
            49,
            46,
            55,
            13,
            37,
            200,
            200,
            200,
            200,
            200,
            200,
            200,
            13,
            49,
            32,
            48,
            32,
            111,
            98,
            106,
            10,
            60,
            60,
            47,
            84
          ]
        }
      },
      "DataField": {
        "type": "object",
        "properties": {
          "Key": {
            "type": "string"
          },
          "Value": {
            "type": "object"
          }
        }
      },
      "TemplateOptions": {
        "type": "object",
        "properties": {
          "HalfHourly": {
            "type": "boolean",
            "default": false
          },
          "ChangeOfTenancy": {
            "type": "boolean",
            "default": false
          },
          "PlanType": {
            "type": "string",
            "default": ""
          }
        },
        "format": "TemplateOptions"
      }
    }
  }
}