API de Cotação

Para ir direto para a documentação da API clique em swagger. Abaixo o índice dos serviços disponíveis.

Premissa

Para consumir as APIs da Sompo é preciso seguir os passos a abaixo.

Cadastro: O primeiro passo é fazer o cadastro no Portal Developers Sompo, este cadastro passará por uma aprovação interna.

Seleção dos Serviços: O segundo passo é criar um APP e adicionar as APIs que você deseja consumir neste APP.

Autenticação na plataforma de APIs da Sompo: Agora que você já tem um username, password e client-id, você precisa fazer a autenticação na API de Access-Token para receber uma credencial de acesso as APIs da Sompo.

A descrição completa do processo está descrita na página Autenticação na plataforma de API da Sompo.

Cotação Agrícola

Descrição de Negócio

.

Documentação (swagger) do serviço Cotação Agrícola.

Passo 1 (premissa): A aplicação deve estar autenticada na plataforma de APIs da Sompo. Mais detalhes em Autenticação na plataforma de API da Sompo.

Passo 2: Chamar a API Cotação Agrícola

Campo da chamada (Request)

Endpoint: https://api.sompo.com.br/agro/v1

Método: POST

Parâmetros:

  • Seção Header
    • Authorization: [inserir-access-token].
    • Content-Type: application/json
    • cliente_id: [inserir-client_id]
  • Seção Body:
      {
      "commisionedAgent": {
      "documentNumber": "string",
      "comissiondeRole": "broker",
      "susepCode": "string",
      "lead": true,
      "commissionPercentage": 0,
      "comissionAmount": 0,
      "address": {
      "type": 2223036,
      "externalCode": "CO",
      "email": "contato@email.com",
      "dddPhoneContactNumber": "0",
      "phoneContactNumber": "0",
      "address": "R. Exemplo",
      "number": "100",
      "complement": "Ap. 11",
      "zipCode": "00000-000",
      "neighborhood": "Bairro",
      "city": "São Paulo",
      "uf": "SP",
      "userCreatedId": "132",
      "flagEqualAddress": true
      }
      },
      "brokerLogin": "corretor",
      "coveragePeriod": 0,
      "productTypeId": 10,
      "productModalityId": 9,
      "flagRuralCode": true,
      "flagFederalGrant": true,
      "flagStateGrant": true,
      "subsidiaryId": 4,
      "productId": 500,
      "branchId": 80,
      "brokerCode": 13,
      "client": {
      "name": "João da Silva",
      "fantasyName": "nome fantasia",
      "personType": 1,
      "rGorCnpjNumber": "0",
      "sexType": 2,
      "birthDate": "2024-08-20",
      "civilStateType": 1,
      "documentType": "document",
      "documentNumber": "0",
      "issuingBody": "sesp sp",
      "emissionDate": "2024-08-20",
      "professionCode": 3,
      "salaryRangeCode": 3,
      "patrimonialSituation": 3,
      "activityCode": 3,
      "flagPep": true,
      "dddNumber": "0",
      "PhoneNumber": "0",
      "dddFaxNumber": "0",
      "PhoneFaxNumber": "0",
      "emailContact": "contato@email.com",
      "flagActive": true,
      "addressNumber": "R. Example",
      "complement": "Ap. 10",
      "cep": "00000-00",
      "neighborhood": "Bairro",
      "city": "São Paulo",
      "uf": "SP",
      "flagRefuseAdditionalData": true,
      "DddPhoneContact": "0",
      "NumberPhoneContact": "0",
      "societyType": 2,
      "nationalityType": 3,
      "companyType": 1,
      "liquidPatrimony": 1000,
      "currentPatrimony": 1200,
      "addresses": [
      {
      "type": 2223036,
      "externalCode": "CO",
      "email": "contato@email.com",
      "dddPhoneContactNumber": "0",
      "phoneContactNumber": "0",
      "address": "R. Exemplo",
      "number": "100",
      "complement": "Ap. 11",
      "zipCode": "00000-000",
      "neighborhood": "Bairro",
      "city": "São Paulo",
      "uf": "SP",
      "userCreatedId": "132",
      "flagEqualAddress": true
      }
      ]
      },
      "insuredItem": {
      "agriculturalItem": {
      "cultureType": 15,
      "agriculturalIrrigationType": true,
      "flagPolicyCurrentArea": true,
      "flagAgriculturalZoning": true,
      "flagCropDamageCurrentSeason": true,
      "flagFederalGrant": true,
      "flagStateGrant": true,
      "zipCode": "000000-000",
      "propertyName": "Nome da Propriedade",
      "cityCode": 10,
      "cityDescription": "Descrição da cidade",
      "ufCode": "SP",
      "plantingTechniqueCode": 9,
      "cultureBacenDescription": 5,
      "address": "string",
      "addressNumber": "16",
      "complement": "Ap. 19",
      "neighborhood": "Bairro",
      "accessRouteDescription": "Roteiro de Acesso",
      "initialPlantingDate": "2024-08-20",
      "soilType": 3,
      "cultivarType": 1,
      "expectedPruningDate": "2024-08-20",
      "harvestEndDate": "2024-08-20",
      "age": 19,
      "plantNumber": 10,
      "spacing": 14.1,
      "spacing2": 10.1,
      "groupType": 10,
      "insuredAreaDescription": 10.1,
      "coverageLevelDescription": "Nivel de Cobertura",
      "expectedProductivityDescription": "Produtividade Esperada",
      "latitude": "10837263716263518000",
      "longitude": "19281918372817273000",
      "plantingFormCode": 19,
      "sandNumber": 10.1,
      "siltNumber": 10.19,
      "clayNumber": 16.19,
      "itemNumber": 12,
      "planCode": 5,
      "itemCoverage": {
      "coverageCode": 10,
      "coverage": "Cobertura",
      "branchCode": 10,
      "flagBasic": true,
      "franchise": "Franquia",
      "cdOpcFranchise": 100,
      "itemCoverageCroqui": {
      "centerId": "Centro ID",
      "area": 10.1,
      "itemCoverageCroquiGps": {
      "latitude": 10000.1,
      "longitude": 10000.1,
      "latitudeDescription": "Descrição latitude",
      "longitudeDescription": "Descrição Longitude"
      }
      }
      }
      }
      }
      }

Exemplo de requisição:

{ "commisionedAgent": { "documentNumber": "string", "comissiondeRole": "broker", "susepCode": "string", "lead": true, "commissionPercentage": 0, "comissionAmount": 0, "address": { "type": 2223036, "externalCode": "CO", "email": "contato@email.com", "dddPhoneContactNumber": "0", "phoneContactNumber": "0", "address": "R. Exemplo", "number": "100", "complement": "Ap. 11", "zipCode": "00000-000", "neighborhood": "Bairro", "city": "São Paulo", "uf": "SP", "userCreatedId": "132", "flagEqualAddress": true } }, "brokerLogin": "corretor", "coveragePeriod": 0, "productTypeId": 10, "productModalityId": 9, "flagRuralCode": true, "flagFederalGrant": true, "flagStateGrant": true, "subsidiaryId": 4, "productId": 500, "branchId": 80, "brokerCode": 13, "client": { "name": "João da Silva", "fantasyName": "nome fantasia", "personType": 1, "rGorCnpjNumber": "0", "sexType": 2, "birthDate": "2024-08-20", "civilStateType": 1, "documentType": "document", "documentNumber": "0", "issuingBody": "sesp sp", "emissionDate": "2024-08-20", "professionCode": 3, "salaryRangeCode": 3, "patrimonialSituation": 3, "activityCode": 3, "flagPep": true, "dddNumber": "0", "PhoneNumber": "0", "dddFaxNumber": "0", "PhoneFaxNumber": "0", "emailContact": "contato@email.com", "flagActive": true, "addressNumber": "R. Example", "complement": "Ap. 10", "cep": "00000-00", "neighborhood": "Bairro", "city": "São Paulo", "uf": "SP", "flagRefuseAdditionalData": true, "DddPhoneContact": "0", "NumberPhoneContact": "0", "societyType": 2, "nationalityType": 3, "companyType": 1, "liquidPatrimony": 1000, "currentPatrimony": 1200, "addresses": [ { "type": 2223036, "externalCode": "CO", "email": "contato@email.com", "dddPhoneContactNumber": "0", "phoneContactNumber": "0", "address": "R. Exemplo", "number": "100", "complement": "Ap. 11", "zipCode": "00000-000", "neighborhood": "Bairro", "city": "São Paulo", "uf": "SP", "userCreatedId": "132", "flagEqualAddress": true } ] }, "insuredItem": { "agriculturalItem": { "cultureType": 15, "agriculturalIrrigationType": true, "flagPolicyCurrentArea": true, "flagAgriculturalZoning": true, "flagCropDamageCurrentSeason": true, "flagFederalGrant": true, "flagStateGrant": true, "zipCode": "000000-000", "propertyName": "Nome da Propriedade", "cityCode": 10, "cityDescription": "Descrição da cidade", "ufCode": "SP", "plantingTechniqueCode": 9, "cultureBacenDescription": 5, "address": "string", "addressNumber": "16", "complement": "Ap. 19", "neighborhood": "Bairro", "accessRouteDescription": "Roteiro de Acesso", "initialPlantingDate": "2024-08-20", "soilType": 3, "cultivarType": 1, "expectedPruningDate": "2024-08-20", "harvestEndDate": "2024-08-20", "age": 19, "plantNumber": 10, "spacing": 14.1, "spacing2": 10.1, "groupType": 10, "insuredAreaDescription": 10.1, "coverageLevelDescription": "Nivel de Cobertura", "expectedProductivityDescription": "Produtividade Esperada", "latitude": "10837263716263518000", "longitude": "19281918372817273000", "plantingFormCode": 19, "sandNumber": 10.1, "siltNumber": 10.19, "clayNumber": 16.19, "itemNumber": 12, "planCode": 5, "itemCoverage": { "coverageCode": 10, "coverage": "Cobertura", "branchCode": 10, "flagBasic": true, "franchise": "Franquia", "cdOpcFranchise": 100, "itemCoverageCroqui": { "centerId": "Centro ID", "area": 10.1, "itemCoverageCroquiGps": { "latitude": 10000.1, "longitude": 10000.1, "latitudeDescription": "Descrição latitude", "longitudeDescription": "Descrição Longitude" } } } } } }

Exemplo do JSON de resposta:

{ "id": 123, "commisionedAgent": { "documentNumber": "string", "comissiondeRole": "broker", "susepCode": "string", "lead": true, "commissionPercentage": 0, "comissionAmount": 0, "address": { "type": 2223036, "externalCode": "CO", "email": "contato@email.com", "dddPhoneContactNumber": "0", "phoneContactNumber": "0", "address": "R. Exemplo", "number": "100", "complement": "Ap. 11", "zipCode": "00000-000", "neighborhood": "Bairro", "city": "São Paulo", "uf": "SP", "userCreatedId": "132", "flagEqualAddress": true } }, "clientByCdInsured": { "id": 132 }, "valueMonthlyPremium": 100.22, "valueLmg": 100.22, "valueCost": 100.22, "iofPercentage": 0.02, "valueIof": 1000.12, "endorsementNumber": 123, "startValidityDate": "2024-08-20", "endValidityDate": "2024-08-20", "commissionPercentage": 100.22, "productTypeCode": 10, "modalityCode": 9, "flagRuralCode": true, "flagFederalGrant": true, "flagStateGrant": true, "contract": { "id": 4, "subsidiaryId": 4, "productId": 500, "branchId": 80, "brokerCode": 13 }, "client": { "id": 10, "name": "João da Silva", "fantasyName": "nome fantasia", "personType": 1, "rGorCnpjNumber": "0", "sexType": 2, "birthDate": "2024-08-20", "civilStateType": 1, "documentType": "document", "documentNumber": "0", "issuingBody": "sesp sp", "emissionDate": "2024-08-20", "professionCode": 3, "salaryRangeCode": 3, "patrimonialSituation": 3, "activityCode": 3, "flagPep": true, "dddNumber": "0", "PhoneNumber": "0", "dddFaxNumber": "0", "PhoneFaxNumber": "0", "emailContact": "contato@email.com", "flagActive": true, "addressNumber": "R. Example", "complement": "Ap. 10", "cep": "00000-00", "neighborhood": "Bairro", "city": "São Paulo", "uf": "SP", "flagRefuseAdditionalData": true, "DddPhoneContact": "0", "NumberPhoneContact": "0", "societyType": 2, "nationalityType": 3, "companyType": 1, "liquidPatrimony": 1000, "currentPatrimony": 1200, "addresses": [ { "type": 2223036, "externalCode": "CO", "email": "contato@email.com", "dddPhoneContactNumber": "0", "phoneContactNumber": "0", "address": "R. Exemplo", "number": "100", "complement": "Ap. 11", "zipCode": "00000-000", "neighborhood": "Bairro", "city": "São Paulo", "uf": "SP", "userCreatedId": "132", "flagEqualAddress": true } ] }, "insuredItem": { "id": 10, "valueMonthlyPremium": 1006.19, "valueCost": 1090.19, "valueTotalPremium": 1006.19, "valueAnnualPremium": 1006.19, "agriculturalItem": { "id": 100, "insuredProductivity": 10.1, "valueEstimatedCost": 10.1, "valueBag": 10.1, "maximumLimitHectare": 10.1, "valuePhytosanitary": 10.1, "cultureType": 15, "expectedProductivity": 10.1, "agriculturalIrrigationType": true, "flagPolicyCurrentArea": true, "flagAgriculturalZoning": true, "flagCropDamageCurrentSeason": true, "flagFederalGrant": true, "flagStateGrant": true, "zipCode": "000000-000", "propertyName": "Nome da Propriedade", "cityCode": 10, "cityDescription": "Descrição da cidade", "ufCode": "SP", "plantingTechniqueCode": 9, "cultureBacenDescription": 5, "address": "string", "addressNumber": "16", "complement": "Ap. 19", "neighborhood": "Bairro", "accessRouteDescription": "Roteiro de Acesso", "initialPlantingDate": "2024-08-20", "soilType": 3, "cultivarType": 1, "expectedPruningDate": "2024-08-20", "harvestEndDate": "2024-08-20", "age": 19, "plantNumber": 10, "spacing": 14.1, "spacing2": 10.1, "groupType": 10, "insuredAreaDescription": 10.1, "coverageLevelDescription": "Nivel de Cobertura", "expectedProductivityDescription": "Produtividade Esperada", "latitude": "10837263716263518000", "longitude": "19281918372817273000", "plantingFormCode": 19, "sandNumber": 10.1, "siltNumber": 10.19, "clayNumber": 16.19, "itemNumber": 12, "planCode": 5, "itemCoverage": { "id": 10, "isValue": 10.1, "valueMonthlyPremium": 10.1, "valueTotalPremium": 10.1, "commissionPercentage": 10.1, "valueAnnualPremium": 10.1, } } } } }

Undefined