Autional Autional
API Reference GitHub autional.com →

POST /internal/billing/export-user-data

Internal service call (compliance-service): Export all associated data of a specified user in the billing service, including subscriptions, billing records, credit balance, usage statistics, usage alerts, and metering records

Billing Service - Internal None application/json

Request Body

Schema: dto.ExportUserDataRequest

FieldTypeRequiredExampleConstraintsDescription
user_id string Yes usr_abc123

Responses

StatusDescriptionSchema
200User data export successfuldto.ExportUserDataResponse
400Invalid request parametersobject
401Unauthorizedobject
500Internal server errorobject

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 Professional Monthly Subscription
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 Plan downgrade prorated credit
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 Professional Monthly Subscription
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 call volume alert
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