Skip to content

[FEAT]: Allow assignment of "billable metric" to "plan charges" using the "billable metric code" instead of "billable metric ID". #4904

@francois415

Description

@francois415

Suggestion:
Allow assignment of "billable metric" to "plan charges" using the "billable metric code" instead of "billable metric ID".

Description:
In the endpoint "Create a plan":
I can assign entitlements using the "entitlement.code" which is good.
But I cannot assign a billable metric to plan charges using the "billable metric code" : I need to use the "billable metric ID" which I cannot import with the Metric endpoint, nor see in the UI. This is painful.

Example:
I would like to import the "clone stripe" template in one shot, using a "billable_metric_code": "Transaction_Amount" directly set in the template data:

Create a billable metric
--data-raw '{
"billable_metric": {
"name": "Transaction Amount",
"code": "Transaction_Amount",

Create a plan
--data-raw '{
"plan": {
"name": "Payment Processing Plan",
"code": "Payment_Processing_Plan",
"description": "Per-transaction pricing for payment processing",
"amount_cents": 0,
"amount_currency": "USD",
"pay_in_advance": true,
"charges": [
{
"billable_metric_code": "Transaction_Amount",

Current behavior:
I need to create the billable metric. Then I need to extract the "billable_metric_ID" with the "List all billable metrics" endpoint. Then I can reuse this ID and create the Plan.

Why this enhancement would be useful to most Lago users:
This would be helpful to facilitate the import of template/demo data in Lago. Also import customer data for new implementation.

I hope this helps.
Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions