A AuthMS API Wiki API Reference iam.tianv.com →

POST /internal/billing/export-user-data

服务间内部调用(compliance-service):导出指定用户在计费服务中的所有关联数据,含订阅、计费记录、信用余额、使用统计、用量告警和计量记录

计费服务 - 内部接口 None application/json

Request Body

Schema: dto.ExportUserDataRequest

FieldTypeRequiredExampleConstraintsDescription
user_id string Yes usr_abc123

Responses

StatusDescriptionSchema
200用户数据导出成功dto.ExportUserDataResponse
400请求参数错误object
401未授权object
500服务器内部错误object

Referenced Schemas

dto.BillingRecordResponse

FieldTypeRequiredExampleConstraintsDescription
amount number No 99
app_id string No app_001
created_at string No 2026-04-01T00:00:00Z
currency string No CNY
description string No 专业版月度订阅
invoice_number string No INV-2026-001
line_items array of

See dto.InvoiceLineItemResponse

No
record_id string No rec_001
status string No paid
tenant_id string No tnt_xyz789
type string No subscription

dto.CreditBalanceResponse

FieldTypeRequiredExampleConstraintsDescription
balance number No 150
currency string No CNY
tenant_id string No tnt_xyz789
updated_at string No 2026-05-12T10:00:00Z

dto.CreditTransactionResponse

FieldTypeRequiredExampleConstraintsDescription
amount number No 50
balance number No 150
created_at string No 2026-05-12T10:00:00Z
id string No ctr_001
remark string No 套餐降级按比例信用
source string No proration
source_id string No sub_xyz789
tenant_id string No tnt_xyz789
type string No credit

dto.ExportUserDataResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.ExportUserDataResult No
message string No
timestamp string No

dto.ExportUserDataResult

FieldTypeRequiredExampleConstraintsDescription
billing_records array of

See dto.BillingRecordResponse

No
credit_balance dto.CreditBalanceResponse No
credit_transactions array of

See dto.CreditTransactionResponse

No
exported_at string No
metered_billing_records array of

See dto.MeteredBillingExportItem

No
note string No
subscription dto.SubscriptionResponse No
tenant_id string No
usage_alerts array of

See dto.UsageAlertResponse

No
usage_stats array of

See dto.UsageStatsExportItem

No
user_id string No

dto.InvoiceLineItemResponse

FieldTypeRequiredExampleConstraintsDescription
amount number No 99
description string No 专业版月度订阅
quantity integer No 1
resource_type string No subscription
tax_amount number No 5.94
tax_rate number No 0.06
unit_price number No 99

dto.MeteredBillingExportItem

FieldTypeRequiredExampleConstraintsDescription
included_units integer No
overage_amount string No
overage_units integer No
period_end string No
period_start string No
resource_type string No
status string No
total_usage integer No

dto.SubscriptionResponse

FieldTypeRequiredExampleConstraintsDescription
admin_user_id string No usr_abc123
amount number No 499
auto_renew boolean No True
billing_cycle string No monthly
cancel_at_period_end boolean No False
currency string No CNY
current_period_end string No 2026-02-01T00:00:00Z
current_period_start string No 2026-01-01T00:00:00Z
grace_period_days integer No 7
plan_id string No pro
status string No active
tenant_id string No tnt_xyz789
trial_end_date string No 2026-01-15T00:00:00Z

dto.UsageAlertResponse

FieldTypeRequiredExampleConstraintsDescription
app_id string No app_001
created_at string No 2026-05-01T00:00:00Z
id string No ua_001
last_triggered_at string No 2026-05-10T08:00:00Z
name string No API调用量告警
notification_channels string No email,in_app
resource_type string No api_calls
status string No active
tenant_id string No tnt_xyz789
threshold_percent integer No 80
updated_at string No 2026-05-05T10:00:00Z

dto.UsageStatsExportItem

FieldTypeRequiredExampleConstraintsDescription
api_requests integer No
bandwidth_used integer No
date string No
failed_logins integer No
login_attempts integer No
mfa_verifications integer No
storage_used integer No
user_count integer No