Sweeping Accounts V2 - List Journey Session API

Visão Geral

Esta API permite a listagem de sessões de jornada de sweeping accounts.

Endpoint

GET /open-keys/itp/api/v2/sweeping-accounts/v2/journeys-sessions

Autenticação

A API requer autenticação OAuth2 com uma das seguintes permissões:

  • journey: Para fluxos que utilizam redirecionamento à detentora de conta
  • app: Para integrações diretas via API

O token de acesso deve ser enviado no header:

Authorization: Bearer {access_token}

Estrutura da Requisição

Parâmetros que podem ser enviados

{
  "page": 1,
	"pageSize": 10
}

Campos da Requisição

Nível Raiz

CampoTipoObrigatórioDescrição
pageNumberNãoPágina atual da listagem
pageSizeNumberNãoQuantidade de itens por página

Exemplo de Requisição (cURL)

curl --location 'https://api.exemplo.com/open-keys/itp/api/v2/sweeping-accounts/v2/journeys-sessions?page=1&pageSize=1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Exemplo de Requisição (JavaScript/Node.js)

const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.exemplo.com/open-keys/itp/api/v2/sweeping-accounts/v2/journeys-sessions?page=1&pageSize=1',
  headers: { 
    'Authorization': '••••••'
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Exemplo de Requisição (Python)

import requests

url = "https://api.exemplo.com/open-keys/itp/api/v2/sweeping-accounts/v2/journeys-sessions?page=1&pageSize=1"

payload = {}
headers = {
  'Authorization': '••••••'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Resposta da API

Sucesso (200 OK)

A API retorna um objeto contendo:

{
    "data": [
        {
            "journeyId": "6927467b7220f7158cb60b3f",
            "paymentInitiationData": {
                "creditors": [
                    {
                        "name": "João Silva",
                        "cpfCnpj": "12345678909",
                        "personType": "PESSOA_NATURAL"
                    }
                ],
                "loggedUser": {
                    "document": {
                        "identification": "12345678909",
                        "rel": "CPF"
                    }
                },
                "recurringConfiguration": {
                    "sweeping": {
                        "totalAllowedAmount": "10000.00",
                        "transactionLimit": "150.00",
                        "periodicLimits": {
                            "day": {
                                "quantityLimit": 5,
                                "transactionLimit": "25.00"
                            },
                            "week": {
                                "quantityLimit": 5,
                                "transactionLimit": "100.00"
                            },
                            "month": {
                                "quantityLimit": 5,
                                "transactionLimit": "300.00"
                            },
                            "year": {
                                "quantityLimit": 5,
                                "transactionLimit": "10000.00"
                            }
                        },
                        "startDateTime": "2025-11-27T16:00:00Z"
                    }
                }
            },
            "redirectUrl": "http://localhost:8080/callback",
            "paymentInitiationApi": "SWEEPING_ACCOUNTS_V2",
            "applicationClientId": "openkeys_287f10e6-7917-4ff7-8291-e885a9e9076d",
            "applicationId": "68a482d2b3ee755e8bbdec8a",
            "tokenId": "6929f87b764d3127b812cea2",
            "journeySessionStageId": "6929f87b524daa7b8c72e289",
            "status": "CANCELLED",
            "statusHistory": [
                {
                    "updatedAt": "2025-11-28T19:31:07.153Z",
                    "status": "PENDING"
                },
                {
                    "updatedAt": "2025-11-28T19:31:29.985Z",
                    "status": "AWAITING_AUTHORISATION"
                },
                {
                    "updatedAt": "2025-11-28T19:32:04.977Z",
                    "status": "CANCELLED"
                }
            ],
            "createdAt": "2025-11-28T19:31:07.153Z",
            "updatedAt": "2025-11-28T19:32:04.977Z",
            "paymentInitiationId": "6929f87b524daa7b8c72e28b",
            "id": "6929f87b524daa7b8c72e28a"
        }
    ],
    "meta": {
        "total": 123,
        "page": 1,
        "pageSize": 1,
        "totalPages": 123
    }
}

Erros Comuns

401 Unauthorized

{
    "error": "Unauthorized",
    "message": "Token inválido ou expirado"
}

Solução: Verifique se o token de acesso é válido e possui as permissões necessárias (journey ou app).