Certificado de Previdência (Experimental)

Histórico de modificações da API

Operações de teste relacionadas ao Certificado de Previdência.

Consulta de Extrato

Obtém informações de detalhamento do extrato para um certificado.

Experimente

Solicitar URL

Parâmetros de solicitação

string

Identificador que representa o número do certificado.

string

Data inicial do período desejado (yyyy-MM-dd).

string

Data final do período desejado (yyyy-MM-dd).

Cabeçalhos de solicitação

string
A chave de API atribuída a um indivíduo para acessar a API. Você pode encontrar a chave de API em sua conta.

Corpo da solicitação

Resposta 200

OK

{
  "dataInicial": "2017-05-01T00:00:00",
  "dataFinal": "2017-10-28T00:00:00",
  "certificado": {
    "numero": "000002368028",
    "participante": {
      "matricula": "00658701",
      "nome": "CARLOS MAGNO PRATES",
      "idade": 56
    },
    "tipoProduto": "VGBL",
    "dataImplantacao": "2017-05-17T00:00:00",
    "plano": {
      "nome": "VGBL PL ICATU FM RT",
      "susep": "15414.912859/2015-94"
    },
    "status": "ATIVO",
    "fatorAposentadoria": 0.00665456,
    "tabuaAtuarial": "FATOR DE RENDA TEMPORARIA 15 ANOS BR-EMS V.2015 COM 0%",
    "regimeTributacao": "TABELA PROGRESSIVA",
    "tipoRenda": "Renda Mensal Temporária",
    "pagamento": {
      "periodicidade": "ESPORADICO",
      "forma": "DEBITO EM CONTA"
    },
    "fundos": [
      {
        "codigo": "VERDE",
        "nome": "VERDE GR ICATU II PREV",
        "cnpj": "23150486000147",
        "taxaAdministracao": 2.0,
        "saldos": [
          {
            "data": "2017-05-01T00:00:00",
            "saldo": 0.0,
            "qtdCotas": 0.0,
            "valorCotas": 0.0
          },
          {
            "data": "2017-10-27T00:00:00",
            "saldo": 256102.37,
            "qtdCotas": 197646.39245311,
            "valorCotas": 1.2957604
          }
        ],
        "reservas": [
          {
            "dataPrimeiroAporte": "2017-06-05T00:00:00",
            "cotaTotal": 175143.18020931,
            "reservaTotal": 231765.87,
            "carregamentoSaidaTotal": 0.0,
            "reservaLiquidaTotal": 228933.83,
            "reservasAliquotas": [
              {
                "aliquota": 10.0,
                "cota": 0.0,
                "reserva": 0.0,
                "carregamentoSaida": 0.0,
                "reservaLiquida": 0.0
              },
              {
                "aliquota": 15.0,
                "cota": 175143.18020931,
                "reserva": 231765.87,
                "carregamentoSaida": 0.0,
                "reservaLiquida": 228933.83
              },
              {
                "aliquota": 20.0,
                "cota": 0.0,
                "reserva": 0.0,
                "carregamentoSaida": 0.0,
                "reservaLiquida": 0.0
              },
              {
                "aliquota": 25.0,
                "cota": 0.0,
                "reserva": 0.0,
                "carregamentoSaida": 0.0,
                "reservaLiquida": 0.0
              },
              {
                "aliquota": 30.0,
                "cota": 0.0,
                "reserva": 0.0,
                "carregamentoSaida": 0.0,
                "reservaLiquida": 0.0
              },
              {
                "aliquota": 35.0,
                "cota": 0.0,
                "reserva": 0.0,
                "carregamentoSaida": 0.0,
                "reservaLiquida": 0.0
              }
            ]
          }
        ],
        "rentabilidade": {
          "periodo": {
            "dataReferenciaInicial": "2017-04-28T00:00:00",
            "dataReferenciaFinal": "2017-10-27T00:00:00",
            "rentabilidade": 5.85
          },
          "dia": {
            "dataReferencia": "2018-05-30T00:00:00",
            "rentabilidade": 0.41
          },
          "mes": {
            "dataReferenciaInicial": "2018-05-30T00:00:00",
            "dataReferenciaFinal": "2018-05-30T00:00:00",
            "rentabilidade": 0.0
          },
          "mesAnterior": {
            "dataReferenciaInicial": "2018-04-30T00:00:00",
            "dataReferenciaFinal": "2018-05-30T00:00:00",
            "rentabilidade": -1.84
          },
          "ano": {
            "dataReferenciaInicial": "2017-12-29T00:00:00",
            "dataReferenciaFinal": "2018-05-30T00:00:00",
            "rentabilidade": 1.34
          },
          "em12Meses": {
            "dataReferenciaInicial": "2017-05-30T00:00:00",
            "dataReferenciaFinal": "2018-05-30T00:00:00",
            "rentabilidade": 8.75
          },
          "em24Meses": {
            "dataReferenciaInicial": "2016-05-30T00:00:00",
            "dataReferenciaFinal": "2018-05-30T00:00:00",
            "rentabilidade": 22.68
          },
          "em36Meses": {
            "dataReferenciaInicial": "0001-01-01T00:00:00",
            "dataReferenciaFinal": "2018-05-30T00:00:00",
            "rentabilidade": 0.0
          },
          "observacao": "A apuração das rentabilidades é feita entre o dia útil anterior ao início do período e o último dia útil do período. A rentabilidade diária é calculada considerando o fechamento da última cota do fundo."
        },
        "movimentos": [
          {
            "numero": "64456162",
            "tipo": "APL",
            "descricao": "CONTRIBUICAO - APLICACAO",
            "dataMovimento": "2017-06-05T00:00:00",
            "valorBruto": 245000.0,
            "valorLiquido": 245000.0,
            "valorCarregamento": 0.0,
            "dataCotizacao": "2017-06-05T00:00:00",
            "quantidadeCotas": 201564.03821128,
            "saldo": 212885.58977124316,
            "saldoEmCotas": 175143.18020931,
            "valorIR": 0.0
          },
          {
            "numero": "66630843",
            "tipo": "RES",
            "descricao": "RESGATE",
            "dataMovimento": "2017-09-04T00:00:00",
            "valorBruto": 5000.0,
            "valorLiquido": 4964.28,
            "valorCarregamento": 0.0,
            "dataCotizacao": "2017-09-04T00:00:00",
            "quantidadeCotas": 3917.64575817,
            "saldo": 0.0,
            "saldoEmCotas": 0.0,
            "valorIR": 35.72
          }
        ]
      }
    ]
  }
}
{
  "type": "object",
  "properties": {
    "dataInicial": {
      "format": "date-time",
      "type": "string"
    },
    "dataFinal": {
      "format": "date-time",
      "type": "string"
    },
    "certificado": {
      "type": "object",
      "properties": {
        "numero": {
          "type": "string"
        },
        "participante": {
          "type": "object",
          "properties": {
            "matricula": {
              "type": "string"
            },
            "nome": {
              "type": "string"
            },
            "idade": {
              "format": "int32",
              "type": "integer"
            }
          }
        },
        "tipoProduto": {
          "type": "string"
        },
        "dataImplantacao": {
          "format": "date-time",
          "type": "string"
        },
        "plano": {
          "type": "object",
          "properties": {
            "nome": {
              "type": "string"
            },
            "susep": {
              "type": "string"
            }
          }
        },
        "status": {
          "type": "string"
        },
        "fatorAposentadoria": {
          "format": "double",
          "type": "number"
        },
        "tabuaAtuarial": {
          "type": "string"
        },
        "regimeTributacao": {
          "type": "string"
        },
        "tipoRenda": {
          "type": "string"
        },
        "pagamento": {
          "type": "object",
          "properties": {
            "periodicidade": {
              "type": "string"
            },
            "forma": {
              "type": "string"
            }
          }
        },
        "fundos": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "codigo": {
                "type": "string"
              },
              "nome": {
                "type": "string"
              },
              "cnpj": {
                "type": "string"
              },
              "taxaAdministracao": {
                "format": "double",
                "type": "number"
              },
              "saldos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "saldo": {
                      "format": "double",
                      "type": "number"
                    },
                    "qtdCotas": {
                      "format": "double",
                      "type": "number"
                    },
                    "valorCotas": {
                      "format": "double",
                      "type": "number"
                    }
                  }
                }
              },
              "reservas": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dataPrimeiroAporte": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "cotaTotal": {
                      "format": "double",
                      "type": "number"
                    },
                    "reservaTotal": {
                      "format": "double",
                      "type": "number"
                    },
                    "carregamentoSaidaTotal": {
                      "format": "double",
                      "type": "number"
                    },
                    "reservaLiquidaTotal": {
                      "format": "double",
                      "type": "number"
                    },
                    "reservasAliquotas": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "aliquota": {
                            "format": "double",
                            "type": "number"
                          },
                          "cota": {
                            "format": "double",
                            "type": "number"
                          },
                          "reserva": {
                            "format": "double",
                            "type": "number"
                          },
                          "carregamentoSaida": {
                            "format": "double",
                            "type": "number"
                          },
                          "reservaLiquida": {
                            "format": "double",
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "rentabilidade": {
                "type": "object",
                "properties": {
                  "periodo": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "dia": {
                    "type": "object",
                    "properties": {
                      "dataReferencia": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "mes": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "mesAnterior": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "ano": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "em12Meses": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "em24Meses": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "em36Meses": {
                    "type": "object",
                    "properties": {
                      "dataReferenciaInicial": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "dataReferenciaFinal": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "rentabilidade": {
                        "format": "double",
                        "type": "number"
                      }
                    }
                  },
                  "observacao": {
                    "type": "string"
                  }
                }
              },
              "movimentos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "numero": {
                      "type": "string"
                    },
                    "tipo": {
                      "type": "string"
                    },
                    "descricao": {
                      "type": "string"
                    },
                    "dataMovimento": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "valorBruto": {
                      "format": "double",
                      "type": "number"
                    },
                    "valorLiquido": {
                      "format": "double",
                      "type": "number"
                    },
                    "valorCarregamento": {
                      "format": "double",
                      "type": "number"
                    },
                    "dataCotizacao": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "quantidadeCotas": {
                      "format": "double",
                      "type": "number"
                    },
                    "saldo": {
                      "format": "double",
                      "type": "number"
                    },
                    "saldoEmCotas": {
                      "format": "double",
                      "type": "number"
                    },
                    "valorIR": {
                      "format": "double",
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Resposta 400

Solicitação incorreta

Resposta 401

Acesso ao recurso solicitado não autorizado

Resposta 404

O recurso solicitado não foi encontrado

Resposta 422

O período informado excede o máximo de 6 meses

{
  "mensagem": "O período informado excede o máximo de 6 meses."
}
{
  "type": "object",
  "properties": {
    "mensagem": {
      "type": "string"
    }
  }
}

Resposta 500

Erro interno do servidor

Exemplos de código

@ECHO OFF

curl -v -X GET "https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
namespace CSHttpClientSample
{
    using System;
    using System.Net.Http.Headers;
    using System.Text;
    using System.Net.Http;
    using System.Web;

    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}&" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('api.icatuseguros.com.br')
    conn.request("GET", "/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('api.icatuseguros.com.br')
    conn.request("GET", "/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://api.icatuseguros.com.br/previdencia/certificados-exp/v1/{id}/extrato-detalhado?dataInicial={dataInicial}&dataFinal={dataFinal}')


request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body