Tài liệu / API Reference/ API Analytics

API Analytics

API Reference Cập nhật: 23/03/2026

Analytics API

Thống kê giao dịch, tài khoản và trạng thái dịch vụ.

Tổng quan

GET /api/v1/analytics/overview
Authorization: Bearer YOUR_API_KEY

Response

{
  "status": true,
  "messages": "Thành công",
  "overview": {
    "total_transactions": 35,
    "total_in": 3436800,
    "total_out": 1330000,
    "bank_accounts": 1,
    "webhooks_sent": 35,
    "webhooks_errors": 0
  }
}

Mô tả trường

TrườngKiểuMô tả
total_transactionsintegerTổng số giao dịch
total_inintegerTổng tiền vào (VND)
total_outintegerTổng tiền ra (VND)
bank_accountsintegerSố tài khoản ngân hàng
webhooks_sentintegerTổng webhook đã gửi
webhooks_errorsintegerWebhook gửi lỗi

Thống kê theo kỳ

GET /api/v1/analytics/period?range=monthly
Authorization: Bearer YOUR_API_KEY

Query Parameters

ParamGiá trịMô tả
rangedaily1 ngày gần nhất
weekly7 ngày gần nhất
monthly30 ngày gần nhất (mặc định)

Response

{
  "status": true,
  "messages": "Thành công",
  "range": "monthly",
  "data": [
    {
      "date": "2026-03-22",
      "type": "IN",
      "count": 33,
      "total": 3436800
    },
    {
      "date": "2026-03-22",
      "type": "OUT",
      "count": 2,
      "total": 1330000
    }
  ]
}

Mô tả trường data

TrườngKiểuMô tả
datestringNgày (Y-m-d)
typestringIN hoặc OUT
countintegerSố giao dịch
totalintegerTổng tiền (VND)

Trạng thái tài khoản

GET /api/v1/analytics/status
Authorization: Bearer YOUR_API_KEY

Response

{
  "status": true,
  "messages": "Thành công",
  "account": {
    "plan": "Nano",
    "expires_at": "2027-03-22 07:25:47",
    "is_trial": false,
    "bank_accounts": 1,
    "max_bank_accounts": 1,
    "webhooks": 1
  }
}

Mô tả trường account

TrườngKiểuMô tả
planstringTên gói đang dùng
expires_atstringNgày hết hạn
is_trialbooleanĐang dùng thử hay không
bank_accountsintegerSố TK đang dùng
max_bank_accountsintegerGiới hạn TK của gói
webhooksintegerSố webhook đang active

Ví dụ cURL

# Tổng quan
curl -s "https://thueapi.vn/api/v1/analytics/overview" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Theo kỳ
curl -s "https://thueapi.vn/api/v1/analytics/period?range=monthly" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Trạng thái
curl -s "https://thueapi.vn/api/v1/analytics/status" \
  -H "Authorization: Bearer YOUR_API_KEY"
ThueAPI.VN
Đăng nhập với Google
hoặc đăng nhập bằng email
Quên mật khẩu?

Chưa có tài khoản?

Đăng ký với Google
hoặc đăng ký bằng email

Bằng cách đăng ký, bạn đồng ý với Điều khoản dịch vụChính sách bảo mật của chúng tôi.

Đã có tài khoản?