按 ID 查询 Cash In
通过交易 ID 查询 PIX 交易的状态和详情。
端点
GET /api/external/transactions/:id请求头
| 头 | 类型 | 必填 | 描述 |
|---|---|---|---|
Authorization | String | 是 | ApiKey {client_id}:{client_secret} |
路径参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
id | String | 是 | 交易 ID(transaction_id) |
示例
bash
curl -X GET https://api.owem.com.br/api/external/transactions/7popu57v6us7p6pcicgq12345 \
-H "Authorization: ApiKey $CLIENT_ID:$CLIENT_SECRET"成功响应 (200)
json
{
"worked": true,
"data": {
"id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"transaction_id": "7popu57v6us7p6pcicgq12345",
"end_to_end_id": "E37839059202603071530000001",
"external_id": "order-9876",
"type": "pix",
"status": "completed",
"amount": 300000,
"fee_amount": 0,
"net_amount": 300000,
"description": "Pedido #1234",
"direction": "inbound",
"counterparty_name": "Maria Santos",
"created_at": "2026-03-07T15:30:00Z",
"completed_at": "2026-03-07T15:30:02Z"
}
}| 字段 | 类型 | 描述 |
|---|---|---|
worked | Boolean | true 表示操作成功 |
data.id | String | 交易内部 UUID |
data.transaction_id | String | 交易公开标识 |
data.end_to_end_id | String | BACEN 端到端 ID (E2E) |
data.external_id | String | 您系统中的标识符。创建时未提供则为 null |
data.type | String | 交易类型(pix) |
data.status | String | 当前状态(见下表) |
data.amount | Integer | 金额,以基本单位为单位(/ 10,000 = 雷亚尔)。300000 = R$ 30.00 |
data.fee_amount | Integer | 手续费,以基本单位为单位 |
data.net_amount | Integer | 净额,以基本单位为单位 |
data.description | String | 交易描述 |
data.direction | String | inbound 表示收款 |
data.counterparty_name | String | 付款方姓名 |
data.created_at | String | 创建时间(ISO 8601) |
data.completed_at | String | 完成时间(ISO 8601),待处理时为 null |
可能的状态
| 状态 | 描述 |
|---|---|
active | QR Code 已生成,等待付款 |
pending | 检测到付款,处理中 |
completed | 付款已确认 |
failed | 付款失败 |
cancelled | 收款已取消或过期 |
错误响应 (404)
json
{
"worked": false,
"detail": "Transacao nao encontrada"
}错误响应 (401)
json
{
"error": {
"status": 401,
"message": "Missing API key credentials. Use Authorization: ApiKey <client_id>:<client_secret>"
}
}轮询 vs Webhook
要跟踪收款状态,建议使用 Webhooks 而非轮询。如需轮询,请至少间隔 5 秒。