{"templateId":"markdown","versions":[{"version":"v2026.04","label":"v2026.04","link":"/pt-br/products/payments-direct-2/api-docs/developer-guides/paginate-through-results","default":true,"active":true,"folderId":"7e5507fe"},{"version":"v2026.03","label":"v2026.03","link":"/pt-br/products/payments-direct-2/v2026.03/api-docs/developer-guides/paginate-through-results","default":false,"active":false,"folderId":"7e5507fe"},{"version":"v2025.11","label":"v2025.11","link":"/pt-br/products/payments-direct-2/v2025.11/api-docs/developer-guides/paginate-through-results","default":false,"active":false,"folderId":"7e5507fe"}],"sharedDataIds":{"sidebar":"sidebar-@l10n/pt-BR/products/payments-direct-2/@v2025.11/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Paginar os resultados","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com","lang":"en-US"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"paginar-os-resultados","__idx":0},"children":["Paginar os resultados"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Vários endpoints da API do ","Payments Direct"," retornam resultados paginados quando uma lista pode conter muitos registros. A API usa dois estilos de paginação, conforme o endpoint:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Paginação baseada em token"]}," para identidades, instrumentos financeiros e busca de pagamentos. A resposta inclui um valor opaco de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextToken"]}," que você informa para recuperar a próxima página."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Paginação por offset"]}," para transações de ledger. Você especifica o índice do registro inicial (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]},") e o número de registros a retornar (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page-size"]},")."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A tabela abaixo resume qual estilo se aplica a cada endpoint paginado."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Estilo"},"children":["Estilo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parâmetro de tamanho da página"},"children":["Parâmetro de tamanho da página"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Padrão"},"children":["Padrão"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Máximo"},"children":["Máximo"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3/identities"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Baseada em token"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["10"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3/identities/{identity-id}/financial-instruments"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Baseada em token"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["10"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v3/payments/filter"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Baseada em token (corpo da requisição)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page.size"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["20"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v2/ledger-transactions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Por offset"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page-size"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["25"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["50"]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"paginação-baseada-em-token","__idx":1},"children":["Paginação baseada em token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A paginação baseada em token usa um token de string opaco para marcar a sua posição em um conjunto de resultados. Quando a API retorna um ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextToken"]}," na resposta, há mais resultados disponíveis. Quando o ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextToken"]}," está ausente, você chegou à última página."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Os tokens são opacos e podem mudar entre releases. Não tente decodificar, interpretar nem construir valores de token."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"identidades-e-instrumentos-financeiros","__idx":2},"children":["Identidades e instrumentos financeiros"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3/identities"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v3/identities/{identity-id}/financial-instruments"]},", informe os parâmetros de paginação como parâmetros de consulta."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parâmetros da requisição:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parâmetro"},"children":["Parâmetro"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tipo"},"children":["Tipo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Obrigatório"},"children":["Obrigatório"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Descrição"},"children":["Descrição"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Não"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número máximo de registros a retornar. O padrão é 10 e o máximo é 100."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next-token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Não"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token opaco retornado pela resposta anterior. Omita este parâmetro para começar do início."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo: primeira página"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://{base-url}/v3/identities?limit=25\" \\\n  -H \"Authorization: Bearer <access_token>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo de resposta (há mais páginas disponíveis):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [\n    { \"identityId\": \"abc123\", \"identityType\": \"INDIVIDUAL\", \"...\" },\n    { \"...\" }\n  ],\n  \"nextToken\": \"eyJrZXkxIjoidmFsdWUifQ==\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo: página seguinte"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://{base-url}/v3/identities?limit=25&next-token=eyJrZXkxIjoidmFsdWUifQ==\" \\\n  -H \"Authorization: Bearer <access_token>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Quando a resposta não inclui o campo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextToken"]},", você já recuperou todos os registros disponíveis."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"busca-de-pagamentos","__idx":3},"children":["Busca de pagamentos"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["O endpoint ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v3/payments/filter"]}," usa paginação baseada em token, mas os parâmetros de paginação são informados no ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["corpo da requisição"]},", e não como parâmetros de consulta."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Campos de paginação do corpo da requisição:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Campo"},"children":["Campo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tipo"},"children":["Tipo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Obrigatório"},"children":["Obrigatório"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Descrição"},"children":["Descrição"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page.size"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Não"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número de pagamentos a retornar por página. O padrão é 20 e o máximo é 100."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page.lastPageToken"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Não"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token retornado na resposta anterior. Omita para recuperar a primeira página."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo: primeira página"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://{base-url}/v3/payments/filter\" \\\n  -H \"Authorization: Bearer <access_token>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"filter\": {\n      \"paymentStates\": [\"COMPLETED\"]\n    },\n    \"sort\": {\n      \"sortField\": \"CREATED_AT\",\n      \"sortDirection\": \"DESC\"\n    },\n    \"page\": {\n      \"size\": 20\n    }\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo de resposta (há mais páginas disponíveis):"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [ { \"...\" } ],\n  \"filter\": { \"...\" },\n  \"sort\": { \"...\" },\n  \"page\": {\n    \"size\": 20,\n    \"lastPageToken\": \"eyJsYXN0SWQiOiJhYmMxMjMifQ==\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo: página seguinte"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Inclua o valor de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastPageToken"]}," da resposta anterior no corpo da próxima requisição:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"page\": {\n    \"size\": 20,\n    \"lastPageToken\": \"eyJsYXN0SWQiOiJhYmMxMjMifQ==\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Quando a resposta não inclui o campo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page.lastPageToken"]},", você já recuperou todos os pagamentos correspondentes."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"paginação-por-offset","__idx":4},"children":["Paginação por offset"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["O endpoint ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v2/ledger-transactions"]}," usa paginação por offset. Você controla a janela de resultados com dois parâmetros: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page-size"]}," (quantos registros retornar) e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]}," (quantos registros pular)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parâmetros da requisição:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parâmetro"},"children":["Parâmetro"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tipo"},"children":["Tipo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Obrigatório"},"children":["Obrigatório"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Descrição"},"children":["Descrição"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page-size"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sim"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número de registros a retornar. O padrão é 25 e o máximo é 50."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Não"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número de registros a pular antes de retornar resultados. O padrão é 0 (começa do início)."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A resposta inclui um campo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}," com a contagem geral de registros correspondentes. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageElements"]}," para determinar se existem páginas adicionais."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Campos da resposta:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Campo"},"children":["Campo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tipo"},"children":["Tipo"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Descrição"},"children":["Descrição"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número total de registros que correspondem aos filtros da requisição."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número de registros solicitados por página (reflete o parâmetro ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page-size"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageElements"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número de registros efetivamente retornados nesta resposta."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Número de registros pulados (reflete o parâmetro ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo: primeira página"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://{base-url}/v2/ledger-transactions?currency=USD&start-dttm=2026-01-01T00:00:00Z&end-dttm=2026-01-31T23:59:59Z&page-size=25\" \\\n  -H \"Authorization: Bearer <access_token>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo de resposta:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"offset\": 0,\n  \"pageSize\": 25,\n  \"pageElements\": 25,\n  \"total\": 83,\n  \"statementTransactions\": [ { \"...\" } ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exemplo: segunda página"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Com ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total=83"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pageSize=25"]},", a segunda página começa em ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset=25"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \"https://{base-url}/v2/ledger-transactions?currency=USD&start-dttm=2026-01-01T00:00:00Z&end-dttm=2026-01-31T23:59:59Z&page-size=25&offset=25\" \\\n  -H \"Authorization: Bearer <access_token>\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Você recuperou todos os registros quando ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["offset + pageElements >= total"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"boas-práticas","__idx":5},"children":["Boas práticas"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use o tamanho máximo de página em recuperações em massa."]}," Quando o seu objetivo é recuperar todos os registros (por exemplo, para conciliação), defina ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}," ou ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page-size"]}," no valor máximo permitido para reduzir o número de requisições."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Verifique a ausência do ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextToken"]},", não o valor dele."]}," Nos endpoints baseados em token, o sinal correto de que você chegou à última página é a ausência de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nextToken"]}," (ou de ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page.lastPageToken"]},") na resposta, e não um valor de token específico."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Não modifique nem construa tokens."]}," Os tokens são opacos. Uma lógica que interprete ou concatene valores de token vai quebrar quando o formato do token mudar."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Considere os registros adicionados durante a recuperação."]}," A paginação por offset sobre um conjunto de resultados que muda ativamente pode gerar lacunas ou duplicatas. Em transações de ledger, use um intervalo de tempo fixo (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["start-dttm"]}," e ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["end-dttm"]},") para garantir que o conjunto de resultados não mude enquanto você pagina por ele."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Não armazene tokens em cache entre sessões."]}," Os tokens são válidos apenas na sessão em que foram emitidos. Sempre inicie uma nova sequência de paginação para cada novo trabalho de recuperação."]}]},"headings":[{"value":"Paginar os resultados","id":"paginar-os-resultados","depth":1},{"value":"Paginação baseada em token","id":"paginação-baseada-em-token","depth":2},{"value":"Identidades e instrumentos financeiros","id":"identidades-e-instrumentos-financeiros","depth":3},{"value":"Busca de pagamentos","id":"busca-de-pagamentos","depth":3},{"value":"Paginação por offset","id":"paginação-por-offset","depth":2},{"value":"Boas práticas","id":"boas-práticas","depth":2}],"frontmatter":{"seo":{"title":"Paginar os resultados"}},"lastModified":"2026-10-23T14:40:23.341Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pt-br/products/payments-direct-2/api-docs/developer-guides/paginate-through-results","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}