{ "swagger": "2.0", "info": { "contact": { "email": "Group.CH_Open-Source@baloise.ch" }, "description": "An API which allows to communicate with SaaS Providers, which produce Contracts for the host of this API", "license": { "name": "Apache License 2.0", "url": "https://github.com/baloise/corellia/blob/master/LICENSE.txt" }, "title": "Contracts API", "version": "0.1.0" }, "paths": { "/contracts/v2": { "post": { "consumes": [ "application/json; charset=UTF-8" ], "produces": [ "application/json; charset=UTF-8" ], "parameters": [ { "description": "Identifying the sender of this event (request) ", "in": "header", "name": "X-Caller-Name", "required": true, "type": "string" }, { "description": "Unique identifier per event (request)", "format": "uuid", "in": "header", "name": "X-Event-ID", "required": true, "type": "string" }, { "description": "Contract that needs to be uploaded to the insurer", "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/Contract" } } ], "responses": { "400": { "description": "Invalid contract is provided. See ErrorResponse for more information about validation issues", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Technical issue on server side, please retry later", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "A handle to the contract for conversation with the insurer is provided", "schema": { "$ref": "#/definitions/ContractReference" } } }, "tags": [ "contracts" ], "description": "Uploads a contract. If validation fails processing is refused, a corresponding error is thrown", "operationId": "uploadContract", "summary": "Upload a contract to the insurer." } }, "/contracts/v2/cancellations": { "post": { "consumes": [ "application/json; charset=UTF-8" ], "produces": [ "application/json; charset=UTF-8" ], "parameters": [ { "description": "Identifying the sender of this event (request) ", "in": "header", "name": "X-Caller-Name", "required": true, "type": "string" }, { "description": "Unique identifier per event (request)", "format": "uuid", "in": "header", "name": "X-Event-ID", "required": true, "type": "string" }, { "description": "Cancellation to instruct the insurer to cancel the contract", "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/Cancellation" } } ], "responses": { "400": { "description": "Invalid cancellation is provided. See ErrorResponse for more information about validation issues", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Technical issue on server side, please retry later", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "A handle to the contract which was cancelled. It's intended for conversation between consumer and insurer", "schema": { "$ref": "#/definitions/ContractReference" } } }, "tags": [ "contracts" ], "description": "cancels a contract. If validation fails processing is refused, a corresponding error is thrown", "operationId": "cancelContract", "summary": "cancel a contract" } }, "/contracts/v2/documents": { "post": { "consumes": [ "application/json; charset=UTF-8" ], "produces": [ "application/json; charset=UTF-8" ], "parameters": [ { "description": "Identifying the sender of this event (request) ", "in": "header", "name": "X-Caller-Name", "required": true, "type": "string" }, { "description": "Unique identifier per event (request)", "format": "uuid", "in": "header", "name": "X-Event-ID", "required": true, "type": "string" }, { "description": "a documnent that is part of a contract", "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/Document" } } ], "responses": { "400": { "description": "Invalid document is provided. See ErrorResponse for more information about validation issues", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "503": { "description": "Technical issue on server side, please retry later", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "A handle for the uploaded document which can be used in providing a new contract via POST contracts", "schema": { "$ref": "#/definitions/FileHandle" } } }, "tags": [ "documents" ], "description": "Please note that this operation needs to be called per document for a contract to be uploaded. The response contains a handle to the document. This handle should be provided with the contract to be uploaded via uploadContract", "operationId": "uploadDocument", "summary": "Upload a document for a contract." } }, "/contracts/v2/version": { "get": { "produces": [ "application/json; charset=UTF-8" ], "parameters": [], "responses": { "503": { "description": "Technical issue on server side, please retry later", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "default": { "description": "Version identifier", "schema": { "$ref": "#/definitions/Version" } } }, "tags": [ "version" ], "description": "Endpoint to retrieve the current API version (following semver). Can be compared to the URI version. Can be used for testing purposes.", "operationId": "version", "summary": "Callable way of retrieving current API version (following semver)" } } }, "definitions": { "Action": { "properties": { "effective": { "description": "The date when this change should be effective", "format": "date", "type": "string" }, "reason": { "description": "The reason for this type", "format": "int32", "type": "integer" }, "type": { "description": "The type of the action", "format": "int32", "type": "integer" } }, "required": [ "reason", "type" ], "type": "object" }, "Address": { "properties": { "city": { "maxLength": 30, "minLength": 0, "type": "string" }, "houseNumber": { "maxLength": 10, "minLength": 0, "type": "string" }, "sequentialAddressNumber": { "description": "The sequential address number within the Baloise internal partner system.", "format": "int32", "type": "integer" }, "street": { "maxLength": 35, "minLength": 0, "type": "string" }, "zipCode": { "maxLength": 4, "minLength": 4, "type": "string" } }, "required": [ "city", "houseNumber", "street", "zipCode" ], "type": "object" }, "Agent": { "description": "The agent who induced the contract issuance, usually is eligible for receiving commission", "properties": { "agentNumber": { "description": "Identification of an Agent", "maxLength": 8, "minLength": 0, "type": "string" }, "email": { "description": "A valid email adress", "maxLength": 70, "minLength": 2, "type": "string" } }, "required": [ "agentNumber" ], "type": "object" }, "Cancellation": { "properties": { "action": { "$ref": "#/definitions/Action" }, "identifier": { "$ref": "#/definitions/Identifier" } }, "required": [ "action", "identifier" ], "type": "object" }, "Company": { "properties": { "address": { "$ref": "#/definitions/Address" }, "contactFirstName": { "description": "A contact is a person representing the company. Required when partnerNr not set!", "maxLength": 35, "minLength": 2, "type": "string" }, "contactLastName": { "description": "A contact is a person representing the company. Required when partnerNr not set!", "maxLength": 35, "minLength": 2, "type": "string" }, "contactSalutation": { "description": "A contact is a person representing the company. Required when partnerNr not set!", "enum": [ "Mr", "Mrs" ], "type": "string" }, "legalForm": { "description": "Identifies the legal form of the company by CrediReform codes. Has to be provided if UID is missing.", "enum": [ "PRIVATPERSON", "EINZELUNTERNEHMEN", "GEWERBEBETRIEB", "EINFACHE_GESELLSCHAFT", "KOLLEKTIVGESELLSCHAFT", "KOMMANDITGESELLSCHAFT", "TREUHAENDERSCHAFT_TREUUNTERNEHMEN", "ERBENGEMEINSCHAFT", "EUROPAEISCHE_GESELLSCHAFT", "GENOSSENSCHAFT", "AKTIENGESELLSCHAFT", "KOMMANDIT_AKTIENGESELLSCHAFT", "GMBH", "STIFTUNG", "VEREIN", "ANSTALT_LI", "FORMLOSER_BERICHT", "ZWEIGNIEDERL_AUSLAEND_GESELLSCH", "INSTITUT_DES_OEFFENTL_RECHTS" ], "maxLength": 2, "minLength": 2, "type": "string" }, "name": { "description": "Required when partnerNr not set!", "maxLength": 70, "minLength": 3, "type": "string" }, "partnerNr": { "description": "The PartnerNr of the partner.", "format": "int32", "type": "integer" }, "uidNumber": { "description": "Identifies a company uniquely, example CHE-105.805.649", "maxLength": 15, "minLength": 0, "type": "string" } }, "type": "object" }, "Contract": { "properties": { "action": { "$ref": "#/definitions/Action" }, "agent": { "$ref": "#/definitions/Agent" }, "creationDate": { "description": "The day the contract was issued", "format": "date", "type": "string" }, "endDate": { "description": "End of contract which means end of insurance coverage", "format": "date", "type": "string" }, "fileHandles": { "description": "A contract is only complete with its corresponding documents. This is the contract issued by the SaaS provider and maybe some further documents like e.g. customer provided documents like e.g. receipts. At least one contract document is required. In case of migration contracts zero documents are accepted.", "items": { "$ref": "#/definitions/FileHandle" }, "maxItems": 2, "minItems": 0, "type": "array" }, "identifier": { "$ref": "#/definitions/Identifier" }, "payment": { "$ref": "#/definitions/Payment" }, "product": { "$ref": "#/definitions/Product" }, "roles": { "description": "All roles in the contract, e.g. insuranceHolder", "items": { "$ref": "#/definitions/Role" }, "maxItems": 99, "minItems": 1, "type": "array" }, "stampTaxCode": { "description": "The tax stamp code for this contract", "format": "int32", "type": "integer" }, "startDate": { "description": "Start of contract which means start of insurance coverage", "format": "date", "type": "string" }, "termsOfService": { "$ref": "#/definitions/TermsOfService" }, "totalNetPrice": { "$ref": "#/definitions/MonetaryAmount" } }, "required": [ "action", "creationDate", "endDate", "fileHandles", "identifier", "payment", "product", "roles", "stampTaxCode", "startDate", "termsOfService", "totalNetPrice" ], "type": "object" }, "ContractReference": { "properties": { "reference": { "description": "Under this reference the contract is stored at the insurer", "type": "string" } }, "type": "object" }, "Coverable": { "properties": { "code": { "description": "A code uniquely identifying a type of coverable", "format": "int32", "type": "integer" }, "coverages": { "items": { "$ref": "#/definitions/Coverage" }, "maxItems": 99, "minItems": 1, "type": "array" }, "riskLocation": { "$ref": "#/definitions/Address" } }, "required": [ "code", "coverages" ], "type": "object" }, "Coverage": { "properties": { "code": { "description": "A code uniquely identifying a type of coverage", "format": "int32", "type": "integer" }, "deductible": { "$ref": "#/definitions/MonetaryAmount" }, "discountType": { "format": "int32", "type": "integer" }, "discountValue": { "$ref": "#/definitions/MonetaryAmount" }, "extraChargeType": { "format": "int32", "type": "integer" }, "extraChargeValue": { "$ref": "#/definitions/MonetaryAmount" }, "measurandType": { "format": "int32", "type": "integer" }, "measurandValue": { "$ref": "#/definitions/MonetaryAmount" }, "premium": { "$ref": "#/definitions/MonetaryAmount" }, "sumInsured": { "$ref": "#/definitions/MonetaryAmount" } }, "required": [ "code", "premium", "sumInsured" ], "type": "object" }, "Document": { "properties": { "contractId": { "description": "The contract this document belongs to", "maxLength": 20, "minLength": 0, "type": "string" }, "data": { "description": "The document itself. If the documentType is CONTRACT then the document must contain one of these keywords 'Versicherungsvertrag, Contrat d�assurance, Contratto di assicurazione, Insurance policy'", "items": { "format": "byte", "type": "string" }, "type": "array" }, "documentType": { "enum": [ "CONTRACT", "RECEIPT", "COVER_LETTER" ], "type": "string" }, "fileName": { "maxLength": 256, "minLength": 0, "type": "string" }, "mediaType": { "description": "Accepted media types for documents represented by data byte[]", "enum": [ "APPLICATION_PDF", "IMAGE_JPEG", "IMAGE_TIFF", "IMAGE_PNG", "IMAGE_BMP", "IMAGE_GIF" ], "type": "string" } }, "required": [ "contractId", "data", "documentType", "fileName", "mediaType" ], "type": "object" }, "ErrorResponse": { "properties": { "detailMessages": { "description": "In case of e.g. validation error, each validation error is represented by one detail message", "items": { "type": "string" }, "type": "array" }, "errorCause": { "enum": [ "httpClientError", "httpClientErrorInputValidation", "httpServerError" ], "type": "string" }, "message": { "description": "Information about the error", "type": "string" } }, "required": [ "errorCause", "message" ], "type": "object" }, "FileHandle": { "properties": { "handle": { "description": "Reference to an uploaded document. This can be a PDF or a picture (e.g. JPG) of a contract or a purchase receipt.", "type": "string" } }, "required": [ "handle" ], "type": "object" }, "Identifier": { "properties": { "id": { "description": "Id depending on the type.", "type": "string" }, "type": { "description": "The type of the id. EXT or INT.", "enum": [ "INT", "EXT" ], "type": "string" } }, "required": [ "id", "type" ], "type": "object" }, "MonetaryAmount": { "properties": { "amount": { "description": "An amount with two decimal digit like an insured sum or a deductible (e.g. 100,22).", "type": "number" } }, "required": [ "amount" ], "type": "object" }, "Payment": { "properties": { "code": { "description": "A code uniquely identifying the type of payment e.g. invoice or creditcard, Paypal etc.", "format": "int32", "type": "integer" }, "dueDate": { "description": "The due date for the recurring type", "format": "date", "type": "string" }, "recurringType": { "description": "The recurring type code.", "format": "int32", "type": "integer" } }, "required": [ "code", "recurringType" ], "type": "object" }, "Person": { "properties": { "address": { "$ref": "#/definitions/Address" }, "dateOfBirth": { "format": "date", "type": "string" }, "emailAddress": { "description": "A valid email address", "maxLength": 70, "minLength": 2, "type": "string" }, "firstName": { "description": "Required when partnerNr not set!", "maxLength": 35, "minLength": 2, "type": "string" }, "language": { "description": "The language for correspondence with the customer. According to ISO 639-1 language codes, only the values 'de', 'fr', 'it' or 'en' are accepted. Required when partnerNr not set!", "maxLength": 2, "minLength": 2, "type": "string" }, "lastName": { "description": "Required when partnerNr not set!", "maxLength": 35, "minLength": 2, "type": "string" }, "partnerNr": { "description": "The PartnerNr of the partner.", "format": "int32", "type": "integer" }, "phoneNumber": { "$ref": "#/definitions/PhoneNumber" }, "salutation": { "description": "Required when partnerNr not set!", "enum": [ "Mr", "Mrs" ], "type": "string" } }, "type": "object" }, "PhoneNumber": { "properties": { "countryCode": { "description": "Country code, default is +41.", "type": "string" }, "phoneNumber": { "description": "Phone number, without the leading zero.", "maxLength": 20, "minLength": 5, "type": "string" } }, "required": [ "phoneNumber" ], "type": "object" }, "Product": { "properties": { "code": { "description": "A code uniquely identifying the product", "format": "int32", "type": "integer" }, "coverables": { "items": { "$ref": "#/definitions/Coverable" }, "maxItems": 99, "minItems": 1, "type": "array" }, "pricingMonthYear": { "description": "The month/year in which the pricing for the contract was set. Format MMYY", "maxLength": 4, "minLength": 4, "type": "string" } }, "required": [ "code", "coverables", "pricingMonthYear" ], "type": "object" }, "Role": { "properties": { "company": { "$ref": "#/definitions/Company" }, "person": { "$ref": "#/definitions/Person" }, "role": { "enum": [ "insuranceholder", "payer" ], "type": "string" } }, "required": [ "role" ], "type": "object" }, "TermsOfService": { "properties": { "edition": { "description": "The edition of the service terms", "format": "int32", "type": "integer" }, "type": { "description": "The type of service terms", "format": "int32", "type": "integer" } }, "required": [ "edition", "type" ], "type": "object" }, "Version": { "properties": { "value": { "description": "Version identifier of the current API definition", "type": "string" } }, "required": [ "value" ], "type": "object" } }, "x-components": {} }