Avistadocs

搜索账户交易

GET /api/transactions

GET https://api.avista.global/api/transactions

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

以友好的公共格式返回已认证账户的交易,支持分页。

功能特点:

  • 金额转换为巴西雷亚尔(2 位小数)
  • 状态和类型映射为显示标签
  • 对手方证件已脱敏
  • startDateendDate 之间最大间隔为 31 天

认证

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

查询参数

参数类型必填描述
pageinteger页码(从 1 开始)。默认值:1
sizeinteger每页记录数(最大 100)。默认值:20
statusstring按状态筛选:PENDINGCONFIRMEDERROR
typestring按类型筛选:PAYMENTWITHDRAWREFUND_INREFUND_OUT
startDatestring开始日期(ISO 8601,例如:2025-01-01)。默认值:最近 31 天
endDatestring结束日期(ISO 8601,例如:2025-01-31)。默认值:当前日期
externalIdstring按交易 externalId 筛选
endToEndIdstring按交易 endToEndId (e2eId) 筛选

状态和类型映射

原始值显示值
PENDINGPendente
CONFIRMEDConfirmado
ERRORError
PAYMENTPix in
WITHDRAWPix out
REFUND_INRefund in
REFUND_OUTRefund out

交易方向Pix inRefund out = CREDITPix outRefund in = DEBIT


代码示例

cURL
curl -X GET "https://api.avista.global/api/transactions?page=1&size=20&status=CONFIRMED" \
  -H "Authorization: Bearer $AVISTA_TOKEN"
const axios = require('axios');

const response = await axios.get('https://api.avista.global/api/transactions?page=1&size=20&status=CONFIRMED', {
  headers: { 'Authorization': `Bearer ${process.env.AVISTA_TOKEN}` },
});
console.log(response.data);
import os, requests

response = requests.get(
    'https://api.avista.global/api/transactions?page=1&size=20&status=CONFIRMED',
    headers={'Authorization': f'Bearer {os.environ["AVISTA_TOKEN"]}'},
)
print(response.json())
$ch = curl_init('https://api.avista.global/api/transactions?page=1&size=20&status=CONFIRMED');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('AVISTA_TOKEN'),
    ],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.avista.global/api/transactions?page=1&size=20&status=CONFIRMED"))
    .header("Authorization", "Bearer " + System.getenv("AVISTA_TOKEN"))
    .GET()
    .build();
HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

响应 (200)

{
  "data": [
    {
      "transactionId": "12345",
      "externalId": "ext-123456",
      "status": "Confirmado",
      "operationType": "Pix in",
      "movementType": "CREDIT",
      "originalAmount": 100.00,
      "feeAmount": 1.00,
      "finalAmount": 99.00,
      "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"
        }
      }
    }
  ],
  "metadata": {
    "page": 1,
    "size": 20,
    "total": 150,
    "totalPages": 8,
    "hasNext": true,
    "hasPrevious": false
  }
}

错误

状态码描述
400参数无效或日期范围超过 31 天
401令牌缺失或无效

本页目录