{
    "openapi": "3.0.0",
    "info": {
        "title": "Transmitir/Efetivar Endosso",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://sauto.dsv.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
            "description": "Desenvolvimento"
        },
        {
            "url": "https://sauto.hml.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
            "description": "Homologação"
        },
        {
            "url": "https://sauto.bradescoseguros.com.br:443/V2/WSBL-CotacaoCSP/service/",
            "description": "Produção"
        }
    ],
    "tags": [
        {
            "name": "Transmitir",
            "description": "Transmitir/Efetivar Endosso"
        }
    ],
    "paths": {
        "/endosso/transmitir": {
            "post": {
                "tags": [
                    "Transmitir"
                ],
                "summary": "Transmitir endosso",
                "operationId": "endosso",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Request"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful Operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Response"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErroListResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErroListResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErroListResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErroListResponse"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErroListResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "JWT"
            }
        },
        "schemas": {
            "ErroResponse": {
                "type": "object",
                "properties": {
                    "cdErro": {
                        "type": "integer",
                        "description": "Código do erro."
                    },
                    "dsErro": {
                        "type": "string",
                        "description": "Descrição do erro."
                    },
                    "cdSQLCode": {
                        "type": "integer",
                        "description": "Código SQL associado ao erro."
                    },
                    "dsPrograma": {
                        "type": "string",
                        "description": "Nome do programa onde o erro ocorreu."
                    }
                }
            },
            "ErroListResponse": {
                "type": "array",
                "items": {
                    "$ref": "#/components/schemas/ErroResponse"
                },
                "description": "Lista de erros ocorridos."
            },
            "Alerta": {
                "type": "object",
                "properties": {
                    "codigo": {
                        "type": "integer",
                        "description": "Código do alerta",
                        "example": 123
                    },
                    "descricao": {
                        "type": "string",
                        "description": "Descrição do alerta",
                        "example": "Descrição do alerta"
                    }
                }
            },
            "Response": {
                "type": "object",
                "properties": {
                    "proposta": {
                        "type": "object",
                        "description": "Proposta efetivada",
                        "properties": {
                            "numero": {
                                "type": "string",
                                "description": "Número da proposta"
                            },
                            "alertas": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Alerta"
                                }
                            },
                            "mensagemErro": {
                                "$ref": "#/components/schemas/ErroResponse"
                            }
                        }
                    }
                }
            },
            "Autenticacao": {
                "type": "object",
                "properties": {
                    "provedor": {
                        "type": "integer",
                        "example": 3004894000186
                    },
                    "usuario": {
                        "type": "string",
                        "example": "02519440000185"
                    }
                },
                "required": [
                    "provedor",
                    "usuario"
                ]
            },
            "ChaveApolice": {
                "type": "object",
                "properties": {
                    "numero": {
                        "type": "integer",
                        "example": 49456
                    },
                    "item": {
                        "type": "integer",
                        "example": 1
                    }
                },
                "required": [
                    "numero",
                    "item"
                ]
            },
            "Endosso": {
                "type": "object",
                "properties": {
                    "numero": {
                        "type": "integer",
                        "format": "int64",
                        "example": 123456789
                    },
                    "item": {
                        "type": "integer",
                        "format": "int32",
                        "example": 1
                    }
                },
                "required": [
                    "numero",
                    "item"
                ]
            },
            "Pix": {
                "type": "object",
                "properties": {
                    "tipoChave": {
                        "type": "integer",
                        "enum": [
                            "CPFCNPJ (1)",
                            "EMAIL (2)",
                            "TELEFONE (3)"
                        ],
                        "example": "TELEFONE (3)"
                    },
                    "chave": {
                        "type": "string",
                        "example": "user@hotmail.com"
                    }
                }
            },
            "DadosPagamento": {
                "type": "object",
                "properties": {
                    "pix": {
                        "$ref": "#/components/schemas/Pix"
                    },
                    "codigoBanco": {
                        "type": "integer",
                        "format": "int64",
                        "example": 1
                    },
                    "codigoAgenciaCredito": {
                        "type": "integer",
                        "format": "int32",
                        "example": 1
                    },
                    "codigoContaCredito": {
                        "type": "integer",
                        "format": "int32",
                        "example": 1
                    },
                    "numeroDigitoContaCredito": {
                        "type": "integer",
                        "format": "int32",
                        "example": 1
                    }
                }
            },
            "DadosBancario": {
                "type": "object",
                "properties": {
                    "tipoDevolucao": {
                        "type": "integer",
                        "enum": [
                            "CREDITO_CONTA (1)",
                            "ORDEM_PAGAMENTO (3)",
                            "PIX (4)"
                        ],
                        "example": "CREDITO_CONTA (1)"
                    },
                    "tipoConta": {
                        "type": "integer",
                        "enum": [
                            "CONTA_CORRENTE (1)",
                            "CONTA_POUPANCA (2)"
                        ],
                        "example": "CONTA_CORRENTE (1)"
                    },
                    "dadosPagamento": {
                        "$ref": "#/components/schemas/DadosPagamento"
                    }
                }
            },
            "Request": {
                "type": "object",
                "properties": {
                    "autenticacao": {
                        "$ref": "#/components/schemas/Autenticacao"
                    },
                    "codigoSucursal": {
                        "type": "integer",
                        "example": 251
                    },
                    "chaveApolice": {
                        "$ref": "#/components/schemas/ChaveApolice"
                    },
                    "endosso": {
                        "$ref": "#/components/schemas/Endosso"
                    },
                    "dadosBancario": {
                        "$ref": "#/components/schemas/DadosBancario"
                    }
                },
                "required": [
                    "autenticacao",
                    "chaveApolice",
                    "endosso",
                    "codigoSucursal"
                ]
            }
        }
    }
}