getlago / lago

Open Source Metering and Usage Based Billing API ⭐️ Consumption tracking, Subscription management, Pricing iterations, Payment orchestration & Revenue analytics
https://www.getlago.com
GNU Affero General Public License v3.0
6.5k stars 277 forks source link

[BUG]: call "Retrieve current usage" API,no return value #344

Open ytrjp opened 2 months ago

ytrjp commented 2 months ago

restart lago-api docker server, Retrieve current usage API back to available

ytrjp commented 2 months ago
  1. call current usage API { "customer_usage": { "from_datetime": "2024-04-26T02:25:28Z", "to_datetime": "2024-04-30T23:59:59Z", "issuing_date": "2024-04-30", "currency": "CNY", "amount_cents": 2000, "total_amount_cents": 2000, "taxes_amount_cents": 0, "lago_invoice_id": null, "from_date": "2024-04-26", "to_date": "2024-04-30", "amount_currency": "CNY", "total_amount_currency": "CNY", "vat_amount_currency": "CNY", "vat_amount_cents": 0, "charges_usage": [ { "units": "0.0", "events_count": 0, "amount_cents": 0, "amount_currency": "CNY", "charge": { "lago_id": "55d41098-31c6-4c65-b1f9-bb325878b443", "charge_model": "package", "invoice_display_name": "" }, "billable_metric": { "lago_id": "6e6b5d33-5951-4039-a957-0bf1ba31bffc", "name": "存储容量", "code": "storage", "aggregation_type": "sum_agg" }, "filters": [], "groups": [], "grouped_usage": [] }, { "units": "2007442.0", "events_count": 11, "amount_cents": 2000, "amount_currency": "CNY", "charge": { "lago_id": "9799cc58-c174-4d3d-a263-a4c17afb86b2", "charge_model": "package", "invoice_display_name": "" }, "billable_metric": { "lago_id": "9c0a2dbd-2a1c-41a7-9b37-e3643f31a74a", "name": "视频时长", "code": "gen_video_duration", "aggregation_type": "sum_agg" }, "filters": [], "groups": [], "grouped_usage": [] } ] } }

  2. send event { "event": { "transaction_id": "ea81bb9b-dc32-4393-ab63-86a0c178a772_1557_1714295412", "external_customer_id": "ea81bb9b-dc32-4393-ab63-86a0c178a772", "external_subscription_id": "payment_20240426_022511_14eb776", "code": "gen_video_duration", "timestamp": 1714295412, "properties": { "plan_code": "month_vip", "storage_usage": 0, "gen_video_duration_usage": 100600 } } }

  3. call current usage API units:not change

    "units": "2007442.0", "events_count": 11, "amount_cents": 2000, "amount_currency": "CNY", "charge": { "lago_id": "9799cc58-c174-4d3d-a263-a4c17afb86b2", "charge_model": "package", "invoice_display_name": "" },