Giter Site home page Giter Site logo

Comments (2)

ytrjp avatar ytrjp commented on June 2, 2024

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

from lago.

ytrjp avatar ytrjp commented on June 2, 2024
  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": ""
},

from lago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.