{
  "openapi": "3.0.0",
  "info": {
    "title": "DocuSign Generation API",
    "description": "",
    "version": "1.0.0"
  },
  "paths": {
    "/getdocusignpdf": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetDocusignPDF"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDocusignPDFResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "GetDocusignPDFWrapper"
      }
    },
    "/ping": {
      "get": {
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "PingWrapper"
      }
    },
    "/senddocusign": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendDocusign"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendDocusignResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "SendDocusignWrapper"
      }
    },
    "/sendloa": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendLOA"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendLOAResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "SendLOAWrapper"
      }
    },
    "/signedstatus": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckIfSigned"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckIfSignedResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "CheckIfSignedWrapper"
      }
    },
    "/getembeddedurl": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetEmbeddedUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "default": {
            "description": "not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetEmbeddedUrlResultWrapper"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "GetEmbeddedUrlResultWrapper"
      }
    }
  },
  "components": {
    "schemas": {
      "CheckIfSigned": {
        "type": "object",
        "properties": {
          "docusignDetails": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "CheckIfSigned",
        "example": {
          "docusignDetails": {
            "SecurityDetails": {
              "LicenceCode": "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA",
              "mascaradeuser": "Test User"
            },
            "EnvelopeID": "d98b6f22-f3c8-49f2-aadc-bb482a188d2f",
            "Credentials": {
              "Username": "Docusign_Email",
              "Password": "Docusign_Password"
            }
          }
        }
      },
      "CheckIfSignedResultWrapper": {
        "type": "object",
        "properties": {
          "CheckIfSignedResult": {
            "$ref": "#/components/schemas/DocusignStatus"
          }
        },
        "format": "CheckIfSignedResultWrapper"
      },
      "Error": {
        "type": "object",
        "properties": {
          "Message": {
            "type": "string"
          },
          "ErrorDetail": {
            "type": "string"
          }
        },
        "format": "Error"
      },
      "GetDocusignPDF": {
        "type": "object",
        "properties": {
          "docusignDetails": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "GetDocusignPDF",
        "example": {
          "docusignDetails": {
            "SecurityDetails": {
              "LicenceCode": "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA",
              "mascaradeuser": "Test User"
            },
            "EnvelopeID": "your_envelope_id",
            "Credentials": {
              "Username": "Docusign_Email",
              "Password": "Docusign_Password"
            }
          }
        }
      },
      "GetDocusignPDFResultWrapper": {
        "type": "object",
        "properties": {
          "GetDocusignPDFResult": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "GetDocusignPDFResultWrapper"
      },
      "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"
      },
      "SendDocusign": {
        "type": "object",
        "properties": {
          "docusignDetails": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "SendDocusign"
      },
      "SendDocusignResultWrapper": {
        "type": "object",
        "properties": {
          "SendDocusignResult": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "SendDocusignResultWrapper"
      },
      "SendLOA": {
        "type": "object",
        "properties": {
          "docusignDetails": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "SendLOA"
      },
      "SendLOAResultWrapper": {
        "type": "object",
        "properties": {
          "SendLOAResult": {
            "$ref": "#/components/schemas/DocusignDetails"
          }
        },
        "format": "SendLOAResultWrapper"
      },
      "Credentials": {
        "type": "object",
        "properties": {
          "Username": {
            "type": "string"
          },
          "Password": {
            "type": "string"
          }
        },
        "format": "Credentials"
      },
      "DocusignDetails": {
        "type": "object",
        "properties": {
          "ItsAGasContract": {
            "type": "boolean",
            "example": false
          },
          "ControlCompanyName": {
            "type": "string",
            "example": "test Company"
          },
          "MainDetailsData": {
            "type": "array",
            "example": [
              {
                "Key": "new supplier electricity",
                "Value": "British Gas"
              },
              {
                "Key": "new supplier gas",
                "Value": ""
              },
              {
                "Key": "premises name",
                "Value": "Premises Name"
              },
              {
                "Key": "pub company",
                "Value": "Pub Company"
              },
              {
                "Key": "company name",
                "Value": "Company Name"
              },
              {
                "Key": "business type",
                "Value": "Ltd"
              },
              {
                "Key": "company number",
                "Value": "12345678"
              },
              {
                "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": "test.email@emailtest.co.uk"
              },
              {
                "Key": "landline",
                "Value": "01234567890"
              },
              {
                "Key": "dd start date",
                "Value": "2016-05-02"
              },
              {
                "Key": "payment method",
                "Value": "Quarterly Direct Debit"
              },
              {
                "Key": "current electric supplier 1",
                "Value": "British Gas"
              },
              {
                "Key": "contact name",
                "Value": "Contact Name"
              },
              {
                "Key": "mpan top line 1",
                "Value": "03801131"
              },
              {
                "Key": "mpan bottom line 1",
                "Value": "1620000428779"
              },
              {
                "Key": "mpr 1",
                "Value": "12345678"
              },
              {
                "Key": "elec contract end date",
                "Value": "2020-07-23T00:00:00"
              },
              {
                "Key": "elec new contract end date",
                "Value": "2023-07-23T00:00:00"
              },
              {
                "Key": "elec new contract length",
                "Value": "12"
              },
              {
                "Key": "gas contract end date",
                "Value": "2020-06-23T00:00:00"
              },
              {
                "Key": "gas new contract date",
                "Value": "2020-06-24T00:00:00"
              },
              {
                "Key": "gas new contract end date",
                "Value": "2024-06-23T00:00:00"
              },
              {
                "Key": "gas new contract length",
                "Value": "48"
              },
              {
                "Key": "date of birth",
                "Value": "1993-10-25T00:00:00"
              },
              {
                "Key": "director address1",
                "Value": "dir add 1"
              },
              {
                "Key": "director address2",
                "Value": "dir add 2"
              },
              {
                "Key": "director address3",
                "Value": "dir add 3"
              },
              {
                "Key": "director postcode",
                "Value": "dir postcode"
              },
              {
                "Key": "previous address1",
                "Value": "pre add 1"
              },
              {
                "Key": "previous address2",
                "Value": "pre add 2"
              },
              {
                "Key": "previous address3",
                "Value": "pre add 3"
              },
              {
                "Key": "previous postcode",
                "Value": "pre postcode"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/DataField"
            }
          },
          "UsageRatesData": {
            "type": "array",
            "example": [
              {
                "Key": "daycharge",
                "Value": "10"
              },
              {
                "Key": "nightcharge",
                "Value": "0"
              },
              {
                "Key": "eveandwendcharge",
                "Value": "0"
              },
              {
                "Key": "standing charge",
                "Value": "20"
              },
              {
                "Key": "dayusage",
                "Value": "20000"
              },
              {
                "Key": "nightusage",
                "Value": "0"
              },
              {
                "Key": "eveandwendusage",
                "Value": "0"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/DataField"
            }
          },
          "SecurityDetails": {
            "$ref": "#/components/schemas/SecurityDetails"
          },
          "RefID": {
            "type": "integer",
            "format": "int32"
          },
          "EnvelopeID": {
            "type": "string"
          },
          "Error": {
            "$ref": "#/components/schemas/Error"
          },
          "AgentEmail": {
            "type": "string"
          },
          "ContractEmail": {
            "type": "string"
          },
          "PDFBytes": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "byte"
            }
          },
          "MeterDetailsData": {
            "type": "array",
            "example": [
              {
                "Key": "ref",
                "Value": "123456890"
              },
              {
                "Key": "fits",
                "Value": "0.123"
              },
              {
                "Key": "sc",
                "Value": "12.34"
              },
              {
                "Key": "period",
                "Value": "Quarterly"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/DataField"
            }
          },
          "AuxiliaryDetailsData": {
            "type": "array",
            "example": [
              {
                "Key": "ProductName",
                "Value": "APR"
              },
              {
                "Key": "AMRElec",
                "Value": "true"
              },
              {
                "Key": "RenewableElec",
                "Value": "false"
              },
              {
                "Key": "StandardProductElec",
                "Value": "true"
              },
              {
                "Key": "AMRGas",
                "Value": "false"
              },
              {
                "Key": "RenewableGas",
                "Value": "true"
              },
              {
                "Key": "StandardProductGas",
                "Value": "false"
              },
              {
                "Key": "CompanySicCode",
                "Value": "1221"
              },
              {
                "Key": "MpanSerialNumber",
                "Value": "elecSerial"
              },
              {
                "Key": "MprnSerialNumber",
                "Value": "gasSerial"
              },
              {
                "Key": "Kva",
                "Value": "65"
              },
              {
                "Key": "CapacityCharge",
                "Value": "4.59"
              },
              {
                "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": {
              "$ref": "#/components/schemas/DataField"
            }
          },
          "AdminEmail": {
            "type": "string"
          },
          "DocusignTemplateName": {
            "type": "string"
          },
          "IncludeCertificate": {
            "type": "boolean"
          },
          "WebhookUrl": {
            "type": "string",
            "example": "https://your-domain.com/your-listener.aspx"
          },
          "EmbeddedSignerId": {
            "type": "string",
            "description": "Unique per Envelope identifier. Required to enable subsequent  /getEmbeddedUrl calls",
            "example": "EMB1"
          },
          "TemplateOptions": {
            "$ref": "#/components/schemas/TemplateOptions"
          },
          "Credentials": {
            "$ref": "#/components/schemas/Credentials"
          },
          "SmsNotificationNumber": {
            "type": "string",
            "description": "Optional. Triggers a SMS notification on sending of the envelope in addition to the email. Format must be international to be sent.",
            "example": "+44 1632 960193"
          }
        },
        "format": "DocusignDetails"
      },
      "DocusignStatus": {
        "type": "object",
        "properties": {
          "Signed": {
            "type": "boolean"
          },
          "DateSigned": {
            "type": "string",
            "format": "date-time"
          },
          "ErrorMessage": {
            "type": "string"
          }
        },
        "format": "DocusignStatus"
      },
      "TemplateOptions": {
        "type": "object",
        "properties": {
          "HalfHourly": {
            "type": "boolean",
            "default": false
          },
          "ChangeOfTenancy": {
            "type": "boolean",
            "default": false
          },
          "PlanType": {
            "type": "string",
            "default": ""
          }
        },
        "format": "TemplateOptions"
      },
      "DataField": {
        "type": "object",
        "properties": {
          "Key": {
            "type": "string"
          },
          "Value": {
            "type": "object"
          }
        }
      },
      "GetEmbeddedUrl": {
        "type": "object",
        "properties": {
          "embeddedUrlRequest": {
            "$ref": "#/components/schemas/GetEmbeddedUrlRequest"
          }
        }
      },
      "GetEmbeddedUrlRequest": {
        "type": "object",
        "properties": {
          "SecurityDetails": {
            "$ref": "#/components/schemas/SecurityDetails"
          },
          "Credentials": {
            "$ref": "#/components/schemas/Credentials"
          },
          "EnvelopeId": {
            "type": "string"
          },
          "SignerEmail": {
            "type": "string"
          },
          "SignerName": {
            "type": "string"
          },
          "SignerEmbeddedId": {
            "type": "string",
            "description": "Unique per Envelope identifier. Required to enable subsequent  /getEmbeddedUrl calls",
            "example": "EMB1"
          },
          "ReturnUrl": {
            "type": "string",
            "description": "URL to return to once the signing ritual is complete"
          }
        },
        "format": "GetEmbeddedUrlRequest"
      },
      "GetEmbeddedUrlResultWrapper": {
        "type": "object",
        "properties": {
          "GetEmbeddedUrlResult": {
            "$ref": "#/components/schemas/GetEmbeddedUrlResult"
          }
        },
        "format": "CheckIfSignedResultWrapper"
      },
      "GetEmbeddedUrlResult": {
        "type": "object",
        "properties": {
          "EmbeddedSigningUrl": {
            "type": "string",
            "example": "https://demo.docusign.net/Signing/MTRedeem/v1/xxxxx-xxxxx-xxxxx-xxxx-xxx"
          },
          "Error": {
            "$ref": "#/components/schemas/Error"
          }
        },
        "format": "GetEmbeddedUrlResponse"
      }
    }
  }
}