Consultar uma transação

Consulta uma transação e seu respectivo status

Uma transação é gerada de uma movimentação financeira. Fluxos como Receber um pagamento, efetuar um reembolso ou realizar um saque é uma movimentação onde há uma entrada ou saída de recursos, e a aplicação disponibiliza um endpoint para consulta dos detalhes dessas transações.

Usado para:

  • Consultar uma transação da wallet interna;

Como consultar uma transação:

ENDPOINT: https://kaizen.bt-staging.app/pix-service/v2/wallets/{{walletId}}/transactions/{{endToEndId}}

Esse endpoint utiliza o método GET.

Modelo de requisição:

Para efetuar a consulta é necessário informar a walletID (cliente logado) e o código E2E, ClientExternalID, IdempotenceKey ou o ExternalTransactionID da transação nos parâmetros.

GET {{baseurl}}/pix-service/v2/wallets/{{walletId}}/transactions/{{endToEndId}}
curl --request GET \
     --url 'https://kaizen.bt-staging.app/pix-service/v2/wallets/walletId/transactions?type=END_TO_END_ID' \
     --header 'accept: application/json'
GET {{baseurl}}/pix-service/v2/wallets/{{walletId}}/transactions/{{clientexternalId}
curl --request GET \
     --url 'https://kaizen.bt-staging.app/pix-service/v2/wallets/walletId/transactions?type=CLIENT_EXTERNAL_ID' \
     --header 'accept: application/json'
GET {{baseurl}}/pix-service/v2/wallets/{{walletId}}/transactions/{{idempotencekey}}
curl --request GET \
     --url 'https://kaizen.bt-staging.app/pix-service/v2/wallets/walletId/transactions?type=IDEMPOTENCE_KEY' \
     --header 'accept: application/json'
GET {{baseurl}}/pix-service/v2/wallets/{{walletId}}/transactions/{{external_transaction_id}}
curl --request GET \
     --url 'https://kaizen.bt-staging.app/pix-service/v2/wallets/walletId/transactions?type=EXTERNAL_TRANSACTION_ID' \
     --header 'accept: application/json'

Modelo de resposta:

{
    "id": "35313736-e26b-4bbf-b258-5d1a8a0282d0",
    "createdAt": "2024-02-19T17:12:39.344Z",
    "states": [
        {
            "id": "0e0b634c-fa66-45f5-8af6-92784734e48f",
            "createdAt": "2024-02-19T17:12:42.825Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "failed",
            "additionalData": {
                "accountId": "2d9ea0e7-f185-4437-a225-a92f21a07020",
                "reasonCode": "DS27",
                "transactionId": "35313736-e26b-4bbf-b258-5d1a8a0282d0"
            }
        },
        {
            "id": "d15957ec-4672-4a60-a728-745b8f760b2e",
            "createdAt": "2024-02-19T17:12:40.749Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "pending",
            "additionalData": {}
        },
        {
            "id": "97d71eee-6bb3-405d-bcbc-9f7672cfa84a",
            "createdAt": "2024-02-19T17:12:39.404Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "approved",
            "additionalData": {}
        }
    ],
    "type": "withdrawal",
    "amount": "1.26",
    "status": "failed",
    "additionalData": {
        "key": "+5561900001984",
        "priority": "high",
        "description": "PIX-OUT"
    },
    "destination": {
        "name": "João Silva",
        "taxId": "***22233***",
        "ispb": "99999060",
        "key": "+5561900001984",
        "type": "personal",
        "taxIdHash": "5c8e3647b6f8bb3cefdf63f6491fb09096034c289f2b153c9afc4fd6e4a4e55b"
    },
    "source": {
        "name": "Pedro Henrique e Jennifer Limpeza",
        "taxId": "15077054000122",
        "ispb": "03311443",
        "type": "corporate"
    },
    "clientExternalId": "KAIfa6b583493024857be6679550418428a",
    "walletId": "f259d2f8-006e-44cc-a016-f15dc206144a",
    "endToEndId": "E033114432024021914129ddbbbf9000",
    "instructionId": null,
    "initiationMethod": "DICT",
    "idempotenceKey": "c1dc01fe-70f9-48dc-a2ae-0833fa6a9faf"
}
{
    "id": "8a3fbc64-2d51-439a-9014-8cddb8d241df",
    "createdAt": "2023-07-03T16:47:07.115Z",
    "states": [
        {
            "id": "1a844587-0b48-4c57-af84-8a4b52726908",
            "createdAt": "2023-07-03T16:47:07.121Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "success",
            "additionalData": {}
        },
        {
            "id": "7ff9776d-9426-4f7e-b598-9b7ce8450d24",
            "createdAt": "2023-07-03T16:47:07.115Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "pending",
            "additionalData": {}
        }
    ],
    "type": "deposit",
    "amount": "1.94",
    "status": "success",
    "additionalData": {
        "customID": "customBKEONIF1627",
        "externalCustomerName": null
    },
    "destination": {
        "taxId": "15077054000122",
        "ispb": "03311443",
        "type": "corporate"
    },
    "source": {
        "name": "Kiana Fay",
        "taxId": "***74107***",
        "ispb": "32778350",
        "type": "personal",
        "taxIdHash": "119d6735a10a129de0073fd452f8070db6abb8de1f277ee4fdfe88be4a51be8b"
    },
    "clientExternalId": "COBFgS9HzUCQVnxZHomrIsvwqdn",
    "walletId": "f259d2f8-006e-44cc-a016-f15dc206144a",
    "endToEndId": "E32778350202307031647pGJmoBc62fc",
    "instructionId": null,
    "initiationMethod": "QRDN",
    "idempotenceKey": null
}
{
        "id": "cf181508-2217-4c43-9614-67f339031ebb",
        "createdAt": "2023-06-13T18:02:29.433Z",
        "states": [
            {
                "id": "eebf7e17-3580-4de4-81fa-90ba9cf8dc9c",
                "createdAt": "2023-06-13T18:02:29.433Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "pending",
                "additionalData": {}
            },
            {
                "id": "8509e1a4-97a4-4365-9e43-6a160eb6d5d0",
                "createdAt": "2023-06-13T18:02:29.433Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "success",
                "additionalData": {}
            }
        ],
        "type": "withdrawal_refund",
        "amount": "0.44",
        "status": "pending",
        "additionalData": {},
        "destination": {
            "ispb": "03311443"
        },
        "source": {
            "ispb": "18236120"
        },
        "clientExternalId": "KAI1f38173694604f2e90ef53c60e7fbe0d",
        "walletId": "f259d2f8-006e-44cc-a016-f15dc206144a",
        "endToEndId": "E03311443202306131801bI6H0Uprz3z",
        "instructionId": "D18236120350F2C3615B6EAF456F22135",
        "initiationMethod": null,
        "idempotenceKey": null
    }
{
    "id": "d79673e3-2d04-46db-9ed4-b104aba09a9a",
    "createdAt": "2023-07-12T21:06:35.500Z",
    "states": [
        {
            "id": "f45391a9-409d-4f28-a182-df0055f9905d",
            "createdAt": "2023-07-12T21:06:50.595Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "success",
            "additionalData": {}
        },
        {
            "id": "f49ba401-9b63-4560-ba60-e44617c005ab",
            "createdAt": "2023-07-12T21:06:35.515Z",
            "updatedAt": null,
            "deletedAt": null,
            "status": "pending",
            "additionalData": {}
        }
    ],
    "type": "deposit_refund",
    "amount": "0.13",
    "status": "success",
    "additionalData": {
        "customID": "customMFXASAD1",
        "externalCustomerName": null
    },
    "destination": {
        "name": "Pedro Henrique e Jennifer Limpeza",
        "taxId": "15077054000122",
        "ispb": "03311443",
        "type": "corporate",
        "taxIdHash": "29cdcd223b27f705c8a7d6a3c892887b03359afbd046a64759ee6863c7e93d16"
    },
    "source": {
        "taxId": "15077054000122",
        "ispb": "03311443",
        "type": "corporate"
    },
    "clientExternalId": "COBRdahZ5uQnBCEMTXgbkSsCe3I",
    "walletId": "f259d2f8-006e-44cc-a016-f15dc206144a",
    "endToEndId": "E03311443202307122106ix6nEKR5Y3m",
    "instructionId": null,
    "initiationMethod": null,
    "idempotenceKey": null
}

Descrição dos campos:

campotipodescrição
id- ID da transação consultada
states:pa.statusarray- posição 0 do array sempre exibe o status mais atual de uma transação
typestring (deposit_refund | withdraw_refund | deposit (PIX IN) | withdraw (pix out)- tipo da transação ( consultar no link abaixo a descrição de cada tipo)
amount- valor da transação realizada
wallet.id
clientExternalId- código KAI
- identificador único da cobrança gerada
additionalData.key- chave pix
additionalData.clientWalletId
externalTransactionId
idempotenceKeystring(uuid)- idempotenceKey da transação de pix-out
derivativeId- ID gerado nas transações de estorno (refund)
instructionId- ID gerado nas transações de estorno (refund)
statusstring- replicação do último status do array statescam.status
taxIdHashsha256- Hash do CPF (pagador)

📘

Status das transações

Para cada tipo de transação há um padrão de status, ou seja, na consulta é correto validar o tipo de transação (type), status (status) e data da criação (createdAt), pois esses campos juntos compõem o histórico da transação e evolução de status de cada tipo.

  • PIX IN
    • Status: success
  • PIX OUT
    • Status: awaiting approval; approved; pending; denied; failed; e success
  • Refund de PIX IN (Refund OUT)
    • Status: pending; success e failed
  • Refund de PIX OUT (Refund IN)
    • Status: success