### GET /plans Source: https://swagger.getlago.com/openapi.yaml This endpoint retrieves all existing plans. ```markdown ### Parameters - **page** (integer, query, optional): Page number. (example: 1) - **per_page** (integer, query, optional): Number of records per page. (example: 20) ### Responses #### 200 - Plans **PlansPaginated** - **plans** (array (object)) (required) Array items: - **lago_id** (string (uuid)) (required): Unique identifier of the plan created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **name** (string) (required): The name of the plan. (example: "Startup") - **invoice_display_name** (string): Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name. (example: "Startup plan") - **created_at** (string (date-time)) (required): The date and time when the plan was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the plan was initially created. (example: "2023-06-27T19:43:42Z") - **code** (string) (required): The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance. (example: "startup") - **interval** (string (weekly|monthly|quarterly|semiannual|yearly)) (required): The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `semiannual`, `quarterly`, `monthly` or `weekly`. (example: "monthly") ("weekly"|"monthly"|"quarterly"|"semiannual"|"yearly") - **description** (string): The description on the plan. (example: "") - **amount_cents** (integer) (required): The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan. (example: 10000) - **amount_currency** (string (AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BIF|BMD|BND|BOB|BRL|BSD|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|ISK|JMD|JPY|KES|KGS|KHR|KMF|KRW|KYD|KZT|LAK|LBP|LKR|LRD|LSL|MAD|MDL|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"VUV"|"WST"|"XAF"|"XCD"|"XOF"|"XPF"|"YER"|"ZAR"|"ZMW") - **trial_period** (number): The duration in days during which the base cost of the plan is offered for free. (example: 5) - **pay_in_advance** (boolean): This field determines the billing timing for the plan. When set to `true`, the base cost of the plan is due at the beginning of each billing period. Conversely, when set to `false`, the base cost of the plan is due at the end of each billing period. (example: true) - **bill_charges_monthly** (boolean,null): This field, when set to `true`, enables to invoice usage-based charges on monthly basis, even if the cadence of the plan is yearly or semiannual. This allows customers to pay charges overage on a monthly basis. This can be set to true only if the plan's interval is `yearly` or `semiannual`. (example: null) - **minimum_commitment** (object,null) - **charges** (array (object)): Additional usage-based charges for this plan. (example: [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{},"filters":[{"invoice_display_name":"Europe","properties":{"amount":"10"},"values":{"region":["Europe"]}},{"invoice_display_name":"USA","properties":{"amount":"5"},"values":{"region":["USA"]}},{"invoice_display_name":"Africa","properties":{"amount":"8"},"values":{"region":["Africa"]}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"regroup_paid_fees":null,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"filters":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"regroup_paid_fees":"invoice","prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"filters":[]}]) Array items: - **lago_id** (string (uuid)) (required): Unique identifier of charge, created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **lago_billable_metric_id** (string (uuid)) (required): Unique identifier of the billable metric created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **billable_metric_code** (string) (required): Unique code identifying a billable metric. (example: "requests") - **invoice_display_name** (string,null) (required): Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name. (example: "Setup") - **created_at** (string (date-time)) (required): The date and time when the charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard. (example: "2022-09-14T16:35:31Z") - **charge_model** (string (dynamic|graduated|graduated_percentage|package|percentage|standard|volume)) (required): Specifies the pricing model used for the calculation of the final fee. It can be any of the following values: - [`dynamic`](https://docs.getlago.com/guide/plans/charges/charge-models/dynamic) - [`graduated_percentage`](https://docs.getlago.com/guide/plans/charges/charge-models/graduated-percentage) - [`graduated`](https://docs.getlago.com/guide/plans/charges/charge-models/graduated) - [`package`](https://docs.getlago.com/guide/plans/charges/charge-models/package) - [`percentage`](https://docs.getlago.com/guide/plans/charges/charge-models/percentage) - [`standard`](https://docs.getlago.com/guide/plans/charges/charge-models/standard) - [`volume`](https://docs.getlago.com/guide/plans/charges/charge-models/volume) ("dynamic"|"graduated"|"graduated_percentage"|"package"|"percentage"|"standard"|"volume") - **pay_in_advance** (boolean) (required): This field determines the billing timing for this specific usage-based charge. When set to `true`, the charge is due and invoiced immediately. Conversely, when set to `false`, the charge is due and invoiced at the end of each billing period. (example: true) - **invoiceable** (boolean) (required): This field specifies whether the charge should be included in a proper invoice. If set to `false`, no invoice will be issued for this charge. You can only set it to `false` when `pay_in_advance` is `true`. (example: true) - **regroup_paid_fees** (string,null) (required): This setting can only be configured if `pay_in_advance` is `true` and `invoiceable` is `false`. This field determines whether and when the charge fee should be included in the invoice. If `null`, no invoice will be issued for this charge fee. If `invoice`, an invoice will be generated at the end of the period, consolidating all charge fees with a succeeded payment status. (example: "invoice") ("null"|"invoice") - **prorated** (boolean) (required): Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully. - If set to `true`, the charge is prorated based on the remaining days in the current billing period. - If set to `false`, the charge is billed in full. - If not defined in the request, default value is `false`. (example: false) - **min_amount_cents** (integer) (required): The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period. (example: 1200) - **properties** (object) (required) - **grouped_by** (array (string)): The list of event properties that are used to group the events on the invoice for a `standard` charge model. **DEPRECATED** Replaced by `pricing_group_keys`. (example: ["agent_name"]) - **pricing_group_keys** (array (string)): The list of event properties that are used to group the events on the invoice. (example: ["agent_name"]) - **graduated_ranges** (array (object)): Graduated ranges, sorted from bottom to top tiers, used for a `graduated` charge model. Array items: - **from_value** (integer) (required): Specifies the lower value of a tier for a `graduated` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values. (example: 0) - **to_value** (integer,null) (required): Specifies the highest value of a tier for a `graduated` charge model. - This value must be higher than the from_value of the same tier. - This value must be null for the last tier. (example: 10) - **flat_amount** (string) (required): The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value. (example: "10") - **per_unit_amount** (string) (required): The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value. (example: "0.5") - **graduated_percentage_ranges** (array (object)): Graduated percentage ranges, sorted from bottom to top tiers, used for a `graduated_percentage` charge model. Array items: - **from_value** (integer) (required): Specifies the lower value of a tier for a `graduated_percentage` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values. (example: 0) - **to_value** (integer,null) (required): Specifies the highest value of a tier for a `graduated_percentage` charge model. - This value must be higher than the from_value of the same tier. - This value must be null for the last tier. (example: 10) - **rate** (string (^[0-9]+.?[0-9]*$)) (required): The percentage rate that is applied to the amount of each transaction in the tier for a `graduated_percentage` charge model. It is expressed as a decimal value. (example: "1") - **flat_amount** (string (^[0-9]+.?[0-9]*$)) (required): The flat amount for a whole tier, excluding tax, for a `graduated_percentage` charge model. It is expressed as a decimal value. (example: "10") - **amount** (string): - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value. - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value. (example: "30") - **free_units** (integer): The quantity of units that are provided free of charge for each billing period in a `package` charge model. This field specifies the number of units that customers can use without incurring any additional cost during each billing cycle. (example: 100) - **package_size** (integer): The quantity of units included in each pack or set for a `package` charge model. It indicates the number of units that are bundled together as a single package or set within the pricing structure. (example: 1000) - **rate** (string): The percentage rate that is applied to the amount of each transaction for a `percentage` charge model. It is expressed as a decimal value. (example: "1") - **fixed_amount** (string): The fixed fee that is applied to each transaction for a `percentage` charge model. It is expressed as a decimal value. (example: "0.5") - **free_units_per_events** (integer,null): The count of transactions that are not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the number of transactions that are exempt from the calculation of charges based on the specified percentage rate and fixed fee. (example: 5) - **free_units_per_total_aggregation** (string,null): The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee. (example: "500") - **per_transaction_max_amount** (string,null): Specifies the maximum allowable spending for a single transaction. Working as a transaction cap. (example: "3.75") - **per_transaction_min_amount** (string,null): Specifies the minimum allowable spending for a single transaction. Working as a transaction floor. (example: "1.75") - **volume_ranges** (array (object)): Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. Array items: - **from_value** (integer) (required): Specifies the lower value of a tier for a `volume` charge model. It must be either 0 or the previous range's `to_value + 1` to maintain the proper sequence of values. (example: 0) - **to_value** (integer,null) (required): Specifies the highest value of a tier for a `volume` charge model. - This value must be higher than the `from_value` of the same tier. - This value must be `null` for the last tier. (example: 10) - **flat_amount** (string) (required): The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value. (example: "10") - **per_unit_amount** (string) (required): The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value. (example: "0.5") - **filters** (array (object)) (required): List of filters used to apply differentiated pricing based on additional event properties. Array items: - **invoice_display_name** (string,null) (required): Specifies the name that will be displayed on an invoice. If no value is set for this field, the values of the filter will be used as the default display name. (example: "AWS") - **properties** (object) (required) - **values** (object) (required): List of possible filter values. The key and values must match one of the billable metric filters. (example: {"region":["us-east-1"]}) - **taxes** (array (object)): All taxes applied to the charge. Array items: - **lago_id** (string (uuid)) (required): Unique identifier of the tax, created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **name** (string) (required): Name of the tax. (example: "TVA") - **code** (string) (required): Unique code used to identify the tax associated with the API request. (example: "french_standard_vat") - **description** (string,null): Internal description of the tax (example: "French standard VAT") - **rate** (number) (required): The percentage rate of the tax (example: 20) - **applied_to_organization** (boolean) (required): This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead. (example: true) - **created_at** (string (date-time)) (required): Creation date of the tax. (example: "2023-07-06T14:35:58Z") - **applied_pricing_unit** (object,null): The pricing unit applied to the charge. - **taxes** (array (object)): All taxes applied to the plan. Array items: - **usage_thresholds** (array (object)): List of usage thresholds applied to the plan. Array items: - **lago_id** (string (uuid)) (required): Unique identifier of the usage threshold created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **threshold_display_name** (string,null) (required): The display name of the usage threshold. (example: "Threshold 1") - **amount_cents** (integer) (required): The amount to reach to trigger a `progressive_billing` invoice. (example: 10000) - **recurring** (boolean) (required): This field when set to `true` indicates that a `progressive_billing` invoice will be created every time the lifetime usage increases by the specified amount. (example: true) - **created_at** (string (date-time)) (required): The date and time when the usage threshold was created. It is expressed in UTC format according to the ISO 8601 datetime standard. (example: "2023-06-27T19:43:42Z") - **updated_at** (string (date-time)) (required): The date and time when the usage threshold was last updated. It is expressed in UTC format according to the ISO 8601 datetime standard. (example: "2023-06-27T19:43:42Z") - **entitlements** (array (object)): List of all feature entitlements and their privileges available for this plan. Array items: - **entitlement** (object) (required) - **code** (string) (required): Unique code used to identify the feature. Max 255 characters. (example: "seats") - **name** (string,null) (required): Name of the feature. Max 255 characters. (example: "Number of seats") - **description** (string,null) (required): Description of the feature. Max 600 characters. (example: "Number of users of the account") - **privileges** (array (object)) (required): Privileges associated with this feature. Each privilege must have a value assigned. (example: [{"code":"max","name":"Maximum","value_type":"integer","config":{},"value":10},{"code":"max_admins","name":"Max Admins","value_type":"integer","config":{},"value":5},{"code":"root","name":"Allow root user","value_type":"boolean","config":{},"value":true},{"code":"provider","name":"SSO Provider","value_type":"select","value":"google","config":{"select_options":["google","okta"]}}]) Array items: - **code** (string) (required): Unique code for the privilege. (example: "max") - **name** (string,null) (required): Display name for the privilege. (example: "Maximum") - **value_type** (string (integer|boolean|string|select)) (required): Data type of the privilege value. Default: string (example: "integer") ("integer"|"boolean"|"string"|"select") - **config** (object) (required) - **select_options** (array (string)): Array of string, required only when value_type is `select`. (example: ["google","okta"]) - **value** (integer) (required): Value for integer type privileges - **meta** (object) (required) - **current_page** (integer) (required): Current page. (example: 2) - **next_page** (integer,null): Next page. (example: 3) - **prev_page** (integer,null): Previous page. (example: 1) - **total_pages** (integer) (required): Total number of pages. (example: 4) - **total_count** (integer) (required): Total number of records. (example: 70) #### 401 - response **ApiErrorUnauthorized** - **status** (integer (int32)) (required) (example: 401) - **error** (string) (required) (example: "Unauthorized") ### Example Usage ```bash curl -X GET "https://api.getlago.com/api/v1/plans?page=1&per_page=20" ``` ``` -------------------------------- ### GET /add_ons Source: https://swagger.getlago.com/openapi.yaml This endpoint is used to list all existing add-ons. ```markdown ### Parameters - **page** (integer, query, optional): Page number. (example: 1) - **per_page** (integer, query, optional): Number of records per page. (example: 20) ### Responses #### 200 - Add-ons **AddOnsPaginated** - **add_ons** (array (object)) (required) Array items: - **lago_id** (string (uuid)) (required): Unique identifier of the add-on, created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **name** (string) (required): The name of the add-on. (example: "Setup Fee") - **invoice_display_name** (string,null) (required): Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name. (example: "Setup Fee (SF1)") - **code** (string) (required): Unique code used to identify the add-on. (example: "setup_fee") - **amount_cents** (integer) (required): The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value. (example: 50000) - **amount_currency** (string (AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BIF|BMD|BND|BOB|BRL|BSD|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|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|"SHP"|"SLL"|"SOS"|"SRD"|"STD"|"SZL"|"THB"|"TJS"|"TOP"|"TRY"|"TTD"|"TWD"|"TZS"|"UAH"|"UGX"|"USD"|"UYU"|"UZS"|"VND"|"VUV"|"WST"|"XAF"|"XCD"|"XOF"|"XPF"|"YER"|"ZAR"|"ZMW") - **description** (string,null) (required): The description of the add-on. (example: "Implementation fee for new customers.") - **created_at** (string (date-time)) (required): The date and time when the add-on was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the add-on was initially created. (example: "2022-04-29T08:59:51Z") - **taxes** (array (object)): All taxes applied to the add-on. Array items: - **lago_id** (string (uuid)) (required): Unique identifier of the tax, created by Lago. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **name** (string) (required): Name of the tax. (example: "TVA") - **code** (string) (required): Unique code used to identify the tax associated with the API request. (example: "french_standard_vat") - **description** (string,null): Internal description of the tax (example: "French standard VAT") - **rate** (number) (required): The percentage rate of the tax (example: 20) - **applied_to_organization** (boolean) (required): This field is deprecated and will be removed in a future version. When set to true, it applies the tax to the organization's default billing entity. To apply or remove a tax from any billing entity (including the default one), please use the `PUT /billing_entities/:code` endpoint instead. (example: true) - **created_at** (string (date-time)) (required): Creation date of the tax. (example: "2023-07-06T14:35:58Z") - **meta** (object) (required) - **current_page** (integer) (required): Current page. (example: 2) - **next_page** (integer,null): Next page. (example: 3) - **prev_page** (integer,null): Previous page. (example: 1) - **total_pages** (integer) (required): Total number of pages. (example: 4) - **total_count** (integer) (required): Total number of records. (example: 70) #### 401 - response **ApiErrorUnauthorized** - **status** (integer (int32)) (required) (example: 401) - **error** (string) (required) (example: "Unauthorized") #### 403 - response **ApiErrorForbidden** - **status** (integer (int32)) (required) (example: 403) - **error** (string) (required) (example: "Forbidden") - **code** (string) (required) (example: "feature_unavailable") ### Example Usage ```bash curl -X GET "https://api.getlago.com/api/v1/add_ons?page=1&per_page=20" ``` ``` -------------------------------- ### GET /analytics/usage Source: https://swagger.getlago.com/openapi.yaml Returns usages. ```markdown ### Parameters - **time_granularity** (string (daily|weekly|monthly), query, optional): The time granularity of usage analytics. Possible values are 'daily', 'weekly', 'monthly', 'yearly'. (example: "monthly") - **currency** (union, query, optional): The currency of usage analytics. Format must be ISO 4217. - **from_date** (string (date), query, optional): The start date of the period for which the usage analytics is calculated. (example: "2023-11-01") - **to_date** (string (date), query, optional): The end date of the period for which the usage analytics is calculated. (example: "2023-11-30") - **customer_type** (string (individual|company), query, optional): The type of customer for which the usage analytics is calculated. Possible values are 'individual', 'company'. (example: "individual") - **external_customer_id** (string, query, optional): The external identifier of the customer for which the usage analytics is calculated. (example: "ext-customer-123") - **customer_country** (union, query, optional): The country of the customer for which the usage analytics is calculated. - **external_subscription_id** (string, query, optional): The external identifier of the subscription for which the usage analytics is calculated. (example: "ext-subscription-123") - **is_billable_metric_recurring** (boolean, query, optional): Indicates whether the billable metric associated with the usage is recurring. (example: true) - **plan_code** (string, query, optional): The code of the plan for which the usage analytics is calculated. (example: "plan-code-123") - **billable_metric_code** (string, query, optional): The code of the usage-based billable metrics for which the usage analytics is calculated. (example: "code1") ### Responses #### 200 - Usage **Usages** - **usages** (array (object)) (required) Array items: - **organization_id** (string (uuid)) (required): The unique identifier of the organization for which the usage analytics is calculated. (example: "1a901a90-1a90-1a90-1a90-1a901a901a90") - **start_of_period_dt** (string (date)): The start date of the period for which the usage analytics is calculated. (example: "2023-11-01") - **end_of_period_dt** (string (date)): The end date of the period for which the usage analytics is calculated. (example: "2023-11-30") - **amount_currency** (string (AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BIF|BMD|BND|BOB|BRL|BSD|BWP|BYN|BZD|CAD|CDF|CHF|CLF|CLP|CNY|COP|CRC|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|INR|ISK|JM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P"|"TRY"|"TTD"|"TWD"|"TZS"|"UAH"|"UGX"|"USD"|"UYU"|"UZS"|"VND"|"VUV"|"WST"|"XAF"|"XCD"|"XOF"|"XPF"|"YER"|"ZAR"|"ZMW") - **amount_cents** (integer) (required): The total amount for usages for a period, expressed in cents. (example: 50000) - **billable_metric_code** (string): The code of the usage-based billable metrics. (example: "code1") - **units** (string): The total number of units for the usage-based billable metrics. (example: "1.0") - **is_billable_metric_deleted** (boolean): Indicates whether the billable metric associated with the usage is deleted. (example: false) #### 401 - response **ApiErrorUnauthorized** - **status** (integer (int32)) (required) (example: 401) - **error** (string) (required) (example: "Unauthorized") ### Example Usage ```bash curl -X GET "https://api.getlago.com/api/v1/analytics/usage?time_granularity=monthly¤cy=value&from_date=2023-11-01&to_date=2023-11-30&customer_type=individual&external_customer_id=ext-customer-123&customer_country=value&external_subscription_id=ext-subscription-123&is_billable_metric_recurring=true&plan_code=plan-code-123&billable_metric_code=code1" ``` ```