Skip to Content
docs

通过 PIX 密钥和标识符查询交易

GET /api/pix/transactions/pix-key/{pixKey}/{identifier}

GET https://<api-host>/api/pix/transactions/pix-key/{pixKey}/{identifier}

需要在 Authorization 头中提供 Bearer token。请参阅 生成令牌 获取。

返回与 PIX 密钥关联的特定交易,通过提供的标识符进行搜索。

标识符解析逻辑:提供的值会同时与 endToEndId(PIX e2eId)、externalId 和数字 id 进行比较。实际上不存在歧义:每种类型都有唯一的格式(e2eId 以 E 开头 + 32 个字母数字字符;id 是纯数字;externalId 是其他任意字符串)。

认证

需要在 Authorization 头中提供 Bearer 令牌。

路径参数

参数类型必填描述
pixKeystring是PIX 密钥(CPF、CNPJ、手机号、邮箱或随机 EVP 密钥)
identifierstring是交易标识符:与 endToEndId、externalId 或数字 id 进行比较

代码示例

cURL
curl -X GET "https://<api-host>/api/pix/transactions/pix-key/12345678901/ext-123456" \
  -H "Authorization: Bearer $PIX_API_TOKEN"
const axios = require('axios');

const response = await axios.get('https://<api-host>/api/pix/transactions/pix-key/12345678901/ext-123456', {
  headers: { 'Authorization': `Bearer ${process.env.PIX_API_TOKEN}` },
});
console.log(response.data);

响应 (200)

{
  "transactionId": "12345",
  "externalId": "ext-123456",
  "status": "Confirmado",
  "operationType": "Pix in",
  "movementType": "CREDIT",
  "originalAmount": 100.00,
  "feeAmount": 1.00,
  "finalAmount": 99.00,
  "amountPaid": 100.00,
  "mismatchAmount": null,
  "endToEndId": "E12345678901234567890123456789012",
  "createdAt": "2025-01-15T10:30:00.000Z",
  "processedAt": "2025-01-15T10:30:05.000Z",
  "counterpart": {
    "name": "João Silva",
    "document": "***.456.789-**",
    "bank": {
      "bankISPB": "00000000",
      "bankName": "Banco do Brasil",
      "bankCode": "001",
      "accountBranch": "0001",
      "accountNumber": "123456-7"
    }
  }
}

originalAmount 为实际支付金额(确认前为应收金额)。amountPaid 在确认前为 null;mismatchAmount 为应收与实付的差额(无差异时为 null;正数表示少付,负数表示多付)。

错误

状态码描述
401令牌缺失或无效
404根据提供的 PIX 密钥和标识符未找到交易

On this page