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": "fe5bcb97-aaaa-4e27-81c3-1a1c3287d42f",
	"createdAt": "2023-09-14T16:49:17.375Z",
	"type": "withdrawal",
	"additionalData": {
		"clientWalletId": "f259d2f8-006e-44cc-a016-f15dc206144a",
		"key": "66008158920",
		"description": "PIX-OUT de 1.7 para uma CHAVE EXTERNA",
		"priority": "high",
		"authorizerId": "c2d3feb0-2eb1-4273-bb85-6fd7c9eaddc5"
	},
	"amount": "1.7",
	"clientExternalId": "KAI2924e5edba5e4652a0f3c2784e7493f3",
	"wallet": {
		"id": "f259d2f8-006e-44cc-a016-f15dc206144a",
		"createdAt": "2022-08-17T14:31:34.249Z",
		"updatedAt": "2023-08-22T13:38:07.547Z",
		"deletedAt": null,
		"client": "df718bab-a2a5-4551-9d4d-742238584ed3",
		"clientId": "df718bab-a2a5-4551-9d4d-742238584ed3",
		"accountId": "2d9ea0e7-f185-4437-a225-a92f21a07020",
		"additionalData": {
			"requiredCustomerName": true
		},
		"status": "ready",
		"ispb": "03311443",
		"bankBranch": "0001",
		"bankNumber": "10000007673",
		"isPixoleto": false,
		"notificationUrl": "https://webhook-site-develop.bitcapital.teleport.sh/6f8b4031-7961-4414-aea5-e0dc67518909"
	},
	"externalTransactionId": "fe5bcb97-aaaa-4e27-81c3-1a1c3287d42f",
	"endToEndId": "E033114432023091413491700e79d000",
	"idempotenceKey": "4hjea0e7-f185-4437-a225-a92f21a07865",
	"source": {
		"account": {
			"bankBranch": "0001",
			"bankNumber": "10000007673",
			"ispb": "03311443"
		}
	},
	"states": [
		{
			"id": "47b2d8f5-8b74-479d-b9c9-a8e3302dfa15",
			"createdAt": "2023-09-14T16:49:19.111Z",
			"additionalData": {},
			"status": "pending"
		},
		{
			"id": "5e7311aa-ae48-40fb-bdbb-b1f81a36af47",
			"createdAt": "2023-09-14T16:49:17.454Z",
			"additionalData": {},
			"status": "approved"
		}
	],
	"updatedAt": "2023-09-14T16:49:17.450Z",
	"status": "pending"
}
[
    {
        "id": "c0e4d8e3-7012-4877-a6ab-724705eba058",
        "createdAt": "2023-07-11T20:14:38.470Z",
        "updatedAt": null,
        "deletedAt": null,
        "states": [
            {
                "id": "7f90bc60-2d03-4ecf-8bd3-6c3ab3e7d1e7",
                "createdAt": "2023-07-11T20:14:38.521Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "success",
                "additionalData": {}
            },
            {
                "id": "b04c68d2-58a6-4af4-911b-dbba74344f94",
                "createdAt": "2023-07-11T20:14:38.470Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "pending",
                "additionalData": {}
            }
        ],
        "type": "deposit",
        "amount": "5.00",
        "wallet": "081ef78c-9a34-48b2-a8e5-1e3b07cc0f17",
        "walletId": "081ef78c-9a34-48b2-a8e5-1e3b07cc0f17",
        "derivativeId": null,
        "externalTransactionId": "1bcc550a-76b7-4d74-b1eb-4089db8afee9",
        "clientExternalId": "acb1e76556eb4ac699b91578b019a70d",
        "additionalData": {},
        "source": {
            "name": "MILENE VILHALVA GOUVEIA",
            "type": "personal",
            "taxId": "12583940902",
            "account": {
                "ispb": "59285411",
                "type": "checking",
                "bankBranch": "0001",
                "bankNumber": "0218313731"
            }
        },
        "destination": {
            "type": "corporate",
            "taxId": "34841787000136",
            "account": {
                "ispb": "03311443",
                "type": "payment",
                "bankBranch": "0001",
                "bankNumber": "10000000350"
            }
        },
        "endToEndId": "E59285411202307112013BMXLusYJArX",
        "instructionId": null,
        "initiationMethod": "QRDN",
        "status": "success"
    }
]
[
    {
        "id": "2f0dae84-1825-42e4-8aff-a00b7ca9e5fa",
        "createdAt": "2023-08-04T03:37:25.494Z",
        "updatedAt": null,
        "deletedAt": null,
        "states": [
            {
                "id": "a547c2b3-989b-436a-9124-18a4f0961847",
                "createdAt": "2023-08-04T03:37:25.580Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "success",
                "additionalData": {}
            },
            {
                "id": "6fb51a5a-8a0b-4026-b60e-34e3bec9135c",
                "createdAt": "2023-08-04T03:37:25.495Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "pending",
                "additionalData": {}
            }
        ],
        "type": "withdrawal_refund",
        "amount": "0.02",
        "wallet": {
            "id": "22955a54-5252-40b7-927f-44a9ed7f52ad",
            "createdAt": "2022-08-26T15:21:36.272Z",
            "updatedAt": "2023-08-02T20:57:34.368Z",
            "deletedAt": null,
            "client": "66b7be28-33d1-44a5-b56d-9ce6ce6cc80b",
            "clientId": "66b7be28-33d1-44a5-b56d-9ce6ce6cc80b",
            "accountId": "baf0a04f-4185-4819-b41b-7bd21ceff131",
            "additionalData": {},
            "status": "ready",
            "ispb": "03311443",
            "bankBranch": "0001",
            "bankNumber": "10000000091",
            "isPixoleto": false,
            "notificationUrl": "https://webhook-site.bt-production.app/f3f538de-68b5-4a12-a81e-e1c977a856f0"
        },
        "walletId": "22955a54-5252-40b7-927f-44a9ed7f52ad",
        "derivativeId": "9a101098-6c7b-4194-b017-5ba31e16b19a",
        "externalTransactionId": "6dbc5b7f-41e9-4bf2-af45-b9348b24e31b",
        "clientExternalId": "KAIdab43b71445841c0acd1c3b5ea41908d",
        "additionalData": {},
        "source": {
            "account": {
                "ispb": "60701190"
            }
        },
        "destination": {
            "account": {
                "ispb": "03311443",
                "bankBranch": "0001",
                "bankNumber": "10000000091"
            }
        },
        "endToEndId": "E03311443202308040334rbkF7a7RkEs",
        "instructionId": "D6070119020230804033740671592137",
        "initiationMethod": null,
        "status": "success"
    }
]
{
        "id": "be51bf21-baf8-4e13-b697-89c107f20d37",
        "createdAt": "2023-08-04T09:51:17.912Z",
        "updatedAt": "2023-08-04T09:51:19.596Z",
        "deletedAt": null,
        "states": [
            {
                "id": "1ac4a963-b73e-4f1f-9807-0d124dfd9c88",
                "createdAt": "2023-08-04T09:51:19.577Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "success",
                "additionalData": {}
            },
            {
                "id": "8451810d-d1ef-4aa0-b03e-ff370a956591",
                "createdAt": "2023-08-04T09:51:17.935Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "pending",
                "additionalData": {}
            }
        ],
        "type": "deposit_refund",
        "amount": "0.01",
        "wallet": {
            "id": "22955a54-5252-40b7-927f-44a9ed7f52ad",
            "createdAt": "2022-08-26T15:21:36.272Z",
            "updatedAt": "2023-08-02T20:57:34.368Z",
            "deletedAt": null,
            "client": "66b7be28-33d1-44a5-b56d-9ce6ce6cc80b",
            "clientId": "66b7be28-33d1-44a5-b56d-9ce6ce6cc80b",
            "accountId": "baf0a04f-4185-4819-b41b-7bd21ceff131",
            "additionalData": {},
            "status": "ready",
            "ispb": "03311443",
            "bankBranch": "0001",
            "bankNumber": "10000000091",
            "isPixoleto": false,
            "notificationUrl": "https://webhook-site.bt-production.app/f3f538de-68b5-4a12-a81e-e1c977a856f0"
        },
        "walletId": "22955a54-5252-40b7-927f-44a9ed7f52ad",
        "derivativeId": "3d50c5f6-488b-434e-80d2-a7af184691fb",
        "externalTransactionId": "6d3fe535-3565-40aa-a0d4-c03e3a999fc3",
        "clientExternalId": "KAI298cdb2bfbcc45e9b57dd7b2bea256e5",
        "additionalData": {},
        "source": {
            "type": "corporate",
            "taxId": "29079725000107",
            "account": {
                "ispb": "03311443",
                "type": "checking",
                "bankBranch": "0001",
                "bankNumber": "010000000091"
            }
        },
        "destination": {
            "name": "FLAVIO DE PAULA",
            "type": "personal",
            "taxId": "41592345761",
            "account": {
                "ispb": "60701190",
            "account": {
                "ispb": "60701190",
                "type": "checking",
                "bankBranch": "8354",
                "bankNumber": "16415"
            }
        },
        "endToEndId": "E6070119020230804094721474901495",
        "instructionId": "D03311443202308040951ajyECLPPOy8",
        "initiationMethod": "MANU",
        "status": "success"
    },
    {
        "id": "694ad85a-b1ff-4820-9508-98dd850ab8e6",
        "createdAt": "2023-08-04T09:48:05.583Z",
        "updatedAt": null,
        "deletedAt": null,
        "states": [
            {
                "id": "d1bbec0c-3415-4f4d-bd51-cabdcb33c808",
                "createdAt": "2023-08-04T09:48:05.602Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "success",
                "additionalData": {}
            },
            {
                "id": "04771101-368a-4f87-a42a-d210b308b50a",
                "createdAt": "2023-08-04T09:48:05.587Z",
                "updatedAt": null,
                "deletedAt": null,
                "status": "pending",
                "additionalData": {}
            }
        ],
        "type": "deposit",
        "amount": "0.01",
        "wallet": {
            "id": "22955a54-5252-40b7-927f-44a9ed7f52ad",
            "createdAt": "2022-08-26T15:21:36.272Z",
            "updatedAt": "2023-08-02T20:57:34.368Z",
            "deletedAt": null,
            "client": "66b7be28-33d1-44a5-b56d-9ce6ce6cc80b",
            "clientId": "66b7be28-33d1-44a5-b56d-9ce6ce6cc80b",
            "accountId": "baf0a04f-4185-4819-b41b-7bd21ceff131",
            "additionalData": {},
            "status": "ready",
            "ispb": "03311443",
            "bankBranch": "0001",
            "bankNumber": "10000000091",
            "isPixoleto": false,
            "notificationUrl": "https://webhook-site.bt-production.app/f3f538de-68b5-4a12-a81e-e1c977a856f0"
        },
        "walletId": "22955a54-5252-40b7-927f-44a9ed7f52ad",
        "derivativeId": null,
        "externalTransactionId": "3d50c5f6-488b-434e-80d2-a7af184691fb",
        "clientExternalId": "KAI298cdb2bfbcc45e9b57dd7b2bea256e5",
        "additionalData": {},
        "source": {
            "name": "FLAVIO DE PAULA",
            "type": "personal",
            "taxId": "41592345761",
            "account": {
                "ispb": "60701190",
                "type": "checking",
                "bankBranch": "8354",
                "bankNumber": "00016415"
            }
        },
        "destination": {
            "type": "corporate",
            "taxId": "29079725000107",
            "account": {
                "ispb": "03311443",
                "type": "checking",
                "bankBranch": "0001",
                "bankNumber": "10000000091"
            }
        },
        "endToEndId": "E6070119020230804094721474901495",
        "instructionId": null,
        "initiationMethod": "MANU",
        "status": "success"
    }
]

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