lago_ruby 0.48.0.pre.beta → 0.51.0.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +19 -6
- data/docs/AddOnBaseInput.md +2 -0
- data/docs/AddOnCreateInputAddOn.md +2 -0
- data/docs/AddOnObject.md +2 -0
- data/docs/BillableMetricBaseInput.md +1 -1
- data/docs/BillableMetricCreateInputBillableMetric.md +1 -1
- data/docs/BillableMetricObject.md +1 -1
- data/docs/ChargeObject.md +2 -0
- data/docs/CreditNoteCreateInputCreditNote.md +1 -1
- data/docs/CreditNoteEstimateInput.md +18 -0
- data/docs/CreditNoteEstimateInputCreditNote.md +20 -0
- data/docs/CreditNoteEstimateInputCreditNoteItemsInner.md +20 -0
- data/docs/CreditNoteEstimated.md +18 -0
- data/docs/CreditNoteEstimatedEstimatedCreditNote.md +38 -0
- data/docs/CreditNoteEstimatedEstimatedCreditNoteAppliedTaxesInner.md +32 -0
- data/docs/CreditNoteEstimatedEstimatedCreditNoteItemsInner.md +20 -0
- data/docs/CreditNoteItemObjectFee.md +4 -0
- data/docs/CreditNoteObject.md +2 -2
- data/docs/CreditNotesApi.md +72 -0
- data/docs/CustomerChargeUsageObject.md +2 -0
- data/docs/CustomerChargeUsageObjectGroupsInner.md +2 -0
- data/docs/CustomerPastUsage.md +20 -0
- data/docs/CustomerUsageObject.md +2 -0
- data/docs/CustomersApi.md +82 -0
- data/docs/EventsApi.md +7 -6
- data/docs/FeeObject.md +4 -0
- data/docs/FeeObjectItem.md +4 -0
- data/docs/GroupPropertiesObject.md +2 -0
- data/docs/InvoiceOneOffCreateInputInvoiceFeesInner.md +2 -0
- data/docs/PlanCreateInputPlan.md +3 -1
- data/docs/PlanCreateInputPlanChargesInner.md +2 -0
- data/docs/PlanObject.md +3 -1
- data/docs/PlanOverridesObject.md +32 -0
- data/docs/PlanOverridesObjectChargesInner.md +28 -0
- data/docs/PlanUpdateInputPlan.md +3 -1
- data/docs/PlanUpdateInputPlanChargesInner.md +2 -0
- data/docs/Subscription.md +1 -1
- data/docs/SubscriptionCreateInputSubscription.md +3 -1
- data/docs/SubscriptionObjectExtended.md +52 -0
- data/docs/SubscriptionUpdateInputSubscription.md +3 -1
- data/docs/SubscriptionsApi.md +70 -0
- data/lago_ruby.gemspec +1 -1
- data/lib/lago_ruby/api/add_ons_api.rb +1 -1
- data/lib/lago_ruby/api/billable_metrics_api.rb +1 -1
- data/lib/lago_ruby/api/coupons_api.rb +1 -1
- data/lib/lago_ruby/api/credit_notes_api.rb +65 -1
- data/lib/lago_ruby/api/customers_api.rb +83 -1
- data/lib/lago_ruby/api/events_api.rb +6 -6
- data/lib/lago_ruby/api/fees_api.rb +1 -1
- data/lib/lago_ruby/api/invoices_api.rb +1 -1
- data/lib/lago_ruby/api/organizations_api.rb +1 -1
- data/lib/lago_ruby/api/plans_api.rb +1 -1
- data/lib/lago_ruby/api/subscriptions_api.rb +64 -1
- data/lib/lago_ruby/api/taxes_api.rb +1 -1
- data/lib/lago_ruby/api/wallets_api.rb +1 -1
- data/lib/lago_ruby/api/webhook_endpoints_api.rb +1 -1
- data/lib/lago_ruby/api/webhooks_api.rb +1 -1
- data/lib/lago_ruby/api_client.rb +13 -13
- data/lib/lago_ruby/api_error.rb +1 -1
- data/lib/lago_ruby/configuration.rb +2 -1
- data/lib/lago_ruby/models/add_on.rb +2 -2
- data/lib/lago_ruby/models/add_on_base_input.rb +13 -3
- data/lib/lago_ruby/models/add_on_create_input.rb +2 -2
- data/lib/lago_ruby/models/add_on_create_input_add_on.rb +13 -3
- data/lib/lago_ruby/models/add_on_object.rb +13 -3
- data/lib/lago_ruby/models/add_on_update_input.rb +2 -2
- data/lib/lago_ruby/models/add_ons_paginated.rb +2 -2
- data/lib/lago_ruby/models/api_error_bad_request.rb +2 -2
- data/lib/lago_ruby/models/api_error_forbidden.rb +2 -2
- data/lib/lago_ruby/models/api_error_not_allowed.rb +2 -2
- data/lib/lago_ruby/models/api_error_not_found.rb +2 -2
- data/lib/lago_ruby/models/api_error_unauthorized.rb +2 -2
- data/lib/lago_ruby/models/api_error_unprocessable_entity.rb +2 -2
- data/lib/lago_ruby/models/applied_coupon.rb +2 -2
- data/lib/lago_ruby/models/applied_coupon_input.rb +2 -2
- data/lib/lago_ruby/models/applied_coupon_input_applied_coupon.rb +2 -2
- data/lib/lago_ruby/models/applied_coupon_object.rb +2 -2
- data/lib/lago_ruby/models/applied_coupon_object_extended.rb +2 -2
- data/lib/lago_ruby/models/applied_coupons_paginated.rb +2 -2
- data/lib/lago_ruby/models/base_applied_tax.rb +2 -2
- data/lib/lago_ruby/models/billable_metric.rb +2 -2
- data/lib/lago_ruby/models/billable_metric_base_input.rb +5 -5
- data/lib/lago_ruby/models/billable_metric_create_input.rb +2 -2
- data/lib/lago_ruby/models/billable_metric_create_input_billable_metric.rb +5 -5
- data/lib/lago_ruby/models/billable_metric_group.rb +2 -2
- data/lib/lago_ruby/models/billable_metric_group_values_inner.rb +1 -1
- data/lib/lago_ruby/models/billable_metric_group_values_inner_one_of.rb +2 -2
- data/lib/lago_ruby/models/billable_metric_object.rb +5 -5
- data/lib/lago_ruby/models/billable_metric_update_input.rb +2 -2
- data/lib/lago_ruby/models/billable_metrics_paginated.rb +2 -2
- data/lib/lago_ruby/models/charge_object.rb +13 -3
- data/lib/lago_ruby/models/charge_object_properties.rb +2 -2
- data/lib/lago_ruby/models/charge_properties.rb +2 -2
- data/lib/lago_ruby/models/charge_properties_graduated_percentage_ranges_inner.rb +2 -2
- data/lib/lago_ruby/models/charge_properties_graduated_ranges_inner.rb +2 -2
- data/lib/lago_ruby/models/charge_properties_volume_ranges_inner.rb +2 -2
- data/lib/lago_ruby/models/country.rb +1 -1
- data/lib/lago_ruby/models/coupon.rb +2 -2
- data/lib/lago_ruby/models/coupon_base_input.rb +2 -2
- data/lib/lago_ruby/models/coupon_base_input_applies_to.rb +2 -2
- data/lib/lago_ruby/models/coupon_create_input.rb +2 -2
- data/lib/lago_ruby/models/coupon_create_input_coupon.rb +2 -2
- data/lib/lago_ruby/models/coupon_object.rb +2 -2
- data/lib/lago_ruby/models/coupon_update_input.rb +2 -2
- data/lib/lago_ruby/models/coupons_paginated.rb +2 -2
- data/lib/lago_ruby/models/credit_note.rb +2 -2
- data/lib/lago_ruby/models/credit_note_applied_tax_object.rb +2 -2
- data/lib/lago_ruby/models/credit_note_create_input.rb +2 -2
- data/lib/lago_ruby/models/credit_note_create_input_credit_note.rb +3 -3
- data/lib/lago_ruby/models/credit_note_create_input_credit_note_items_inner.rb +1 -1
- data/lib/lago_ruby/models/credit_note_estimate_input.rb +221 -0
- data/lib/lago_ruby/models/credit_note_estimate_input_credit_note.rb +241 -0
- data/lib/lago_ruby/models/credit_note_estimate_input_credit_note_items_inner.rb +239 -0
- data/lib/lago_ruby/models/credit_note_estimated.rb +221 -0
- data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note.rb +387 -0
- data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner.rb +283 -0
- data/lib/lago_ruby/models/credit_note_estimated_estimated_credit_note_items_inner.rb +235 -0
- data/lib/lago_ruby/models/credit_note_item_object.rb +2 -2
- data/lib/lago_ruby/models/credit_note_item_object_fee.rb +30 -3
- data/lib/lago_ruby/models/credit_note_object.rb +13 -13
- data/lib/lago_ruby/models/credit_note_update_input.rb +2 -2
- data/lib/lago_ruby/models/credit_note_update_input_credit_note.rb +2 -2
- data/lib/lago_ruby/models/credit_notes.rb +2 -2
- data/lib/lago_ruby/models/credit_object.rb +2 -2
- data/lib/lago_ruby/models/credit_object_invoice.rb +2 -2
- data/lib/lago_ruby/models/credit_object_item.rb +2 -2
- data/lib/lago_ruby/models/currency.rb +1 -1
- data/lib/lago_ruby/models/customer.rb +2 -2
- data/lib/lago_ruby/models/customer_billing_configuration.rb +2 -2
- data/lib/lago_ruby/models/customer_charge_usage_object.rb +20 -3
- data/lib/lago_ruby/models/customer_charge_usage_object_billable_metric.rb +2 -2
- data/lib/lago_ruby/models/customer_charge_usage_object_charge.rb +2 -2
- data/lib/lago_ruby/models/customer_charge_usage_object_groups_inner.rb +13 -3
- data/lib/lago_ruby/models/customer_create_input.rb +2 -2
- data/lib/lago_ruby/models/customer_create_input_customer.rb +2 -2
- data/lib/lago_ruby/models/customer_create_input_customer_metadata_inner.rb +2 -2
- data/lib/lago_ruby/models/customer_metadata.rb +2 -2
- data/lib/lago_ruby/models/customer_object.rb +2 -2
- data/lib/lago_ruby/models/customer_object_extended.rb +2 -2
- data/lib/lago_ruby/models/customer_past_usage.rb +239 -0
- data/lib/lago_ruby/models/customer_usage.rb +2 -2
- data/lib/lago_ruby/models/customer_usage_object.rb +14 -3
- data/lib/lago_ruby/models/customers_paginated.rb +2 -2
- data/lib/lago_ruby/models/event.rb +2 -2
- data/lib/lago_ruby/models/event_batch_input.rb +2 -2
- data/lib/lago_ruby/models/event_batch_input_event.rb +2 -2
- data/lib/lago_ruby/models/event_batch_input_event_properties.rb +2 -2
- data/lib/lago_ruby/models/event_estimate_fees_input.rb +2 -2
- data/lib/lago_ruby/models/event_estimate_fees_input_event.rb +2 -2
- data/lib/lago_ruby/models/event_input.rb +2 -2
- data/lib/lago_ruby/models/event_input_event.rb +2 -2
- data/lib/lago_ruby/models/event_input_event_timestamp.rb +1 -1
- data/lib/lago_ruby/models/event_object.rb +6 -22
- data/lib/lago_ruby/models/event_object_properties.rb +2 -2
- data/lib/lago_ruby/models/fee.rb +2 -2
- data/lib/lago_ruby/models/fee_applied_tax_object.rb +2 -2
- data/lib/lago_ruby/models/fee_object.rb +30 -3
- data/lib/lago_ruby/models/fee_object_item.rb +23 -3
- data/lib/lago_ruby/models/fee_update_input.rb +2 -2
- data/lib/lago_ruby/models/fee_update_input_fee.rb +2 -2
- data/lib/lago_ruby/models/fees.rb +2 -2
- data/lib/lago_ruby/models/fees_paginated.rb +2 -2
- data/lib/lago_ruby/models/get_customer_portal_url200_response.rb +2 -2
- data/lib/lago_ruby/models/get_customer_portal_url200_response_customer.rb +2 -2
- data/lib/lago_ruby/models/group_object.rb +2 -2
- data/lib/lago_ruby/models/group_properties_object.rb +13 -3
- data/lib/lago_ruby/models/group_properties_object_values.rb +2 -2
- data/lib/lago_ruby/models/groups_paginated.rb +2 -2
- data/lib/lago_ruby/models/invoice.rb +2 -2
- data/lib/lago_ruby/models/invoice_applied_tax_object.rb +2 -2
- data/lib/lago_ruby/models/invoice_metadata_object.rb +2 -2
- data/lib/lago_ruby/models/invoice_object.rb +2 -2
- data/lib/lago_ruby/models/invoice_object_customer.rb +2 -2
- data/lib/lago_ruby/models/invoice_object_extended.rb +2 -2
- data/lib/lago_ruby/models/invoice_one_off_create_input.rb +2 -2
- data/lib/lago_ruby/models/invoice_one_off_create_input_invoice.rb +2 -2
- data/lib/lago_ruby/models/invoice_one_off_create_input_invoice_fees_inner.rb +13 -3
- data/lib/lago_ruby/models/invoice_update_input.rb +2 -2
- data/lib/lago_ruby/models/invoice_update_input_invoice.rb +2 -2
- data/lib/lago_ruby/models/invoice_update_input_invoice_metadata_inner.rb +2 -2
- data/lib/lago_ruby/models/invoices_paginated.rb +2 -2
- data/lib/lago_ruby/models/organization.rb +2 -2
- data/lib/lago_ruby/models/organization_billing_configuration.rb +2 -2
- data/lib/lago_ruby/models/organization_object.rb +2 -2
- data/lib/lago_ruby/models/organization_update_input.rb +2 -2
- data/lib/lago_ruby/models/organization_update_input_organization.rb +2 -2
- data/lib/lago_ruby/models/pagination_meta.rb +2 -2
- data/lib/lago_ruby/models/plan.rb +2 -2
- data/lib/lago_ruby/models/plan_create_input.rb +2 -2
- data/lib/lago_ruby/models/plan_create_input_plan.rb +13 -3
- data/lib/lago_ruby/models/plan_create_input_plan_charges_inner.rb +13 -3
- data/lib/lago_ruby/models/plan_create_input_plan_charges_inner_group_properties_inner.rb +2 -2
- data/lib/lago_ruby/models/plan_object.rb +13 -3
- data/lib/lago_ruby/models/plan_overrides_object.rb +289 -0
- data/lib/lago_ruby/models/plan_overrides_object_charges_inner.rb +268 -0
- data/lib/lago_ruby/models/plan_update_input.rb +2 -2
- data/lib/lago_ruby/models/plan_update_input_plan.rb +13 -3
- data/lib/lago_ruby/models/plan_update_input_plan_charges_inner.rb +13 -3
- data/lib/lago_ruby/models/plans_paginated.rb +2 -2
- data/lib/lago_ruby/models/subscription.rb +3 -3
- data/lib/lago_ruby/models/subscription_create_input.rb +2 -2
- data/lib/lago_ruby/models/subscription_create_input_subscription.rb +15 -6
- data/lib/lago_ruby/models/subscription_object.rb +2 -2
- data/lib/lago_ruby/models/subscription_object_extended.rb +507 -0
- data/lib/lago_ruby/models/subscription_update_input.rb +2 -2
- data/lib/lago_ruby/models/subscription_update_input_subscription.rb +15 -6
- data/lib/lago_ruby/models/subscriptions_paginated.rb +2 -2
- data/lib/lago_ruby/models/tax.rb +2 -2
- data/lib/lago_ruby/models/tax_base_input.rb +2 -2
- data/lib/lago_ruby/models/tax_create_input.rb +2 -2
- data/lib/lago_ruby/models/tax_create_input_tax.rb +2 -2
- data/lib/lago_ruby/models/tax_object.rb +2 -2
- data/lib/lago_ruby/models/tax_update_input.rb +2 -2
- data/lib/lago_ruby/models/taxes_paginated.rb +2 -2
- data/lib/lago_ruby/models/timezone.rb +1 -1
- data/lib/lago_ruby/models/wallet.rb +2 -2
- data/lib/lago_ruby/models/wallet_create_input.rb +2 -2
- data/lib/lago_ruby/models/wallet_create_input_wallet.rb +2 -2
- data/lib/lago_ruby/models/wallet_object.rb +2 -2
- data/lib/lago_ruby/models/wallet_transaction_create_input.rb +2 -2
- data/lib/lago_ruby/models/wallet_transaction_create_input_wallet_transaction.rb +2 -2
- data/lib/lago_ruby/models/wallet_transaction_object.rb +2 -2
- data/lib/lago_ruby/models/wallet_transactions.rb +2 -2
- data/lib/lago_ruby/models/wallet_transactions_paginated.rb +2 -2
- data/lib/lago_ruby/models/wallet_update_input.rb +2 -2
- data/lib/lago_ruby/models/wallet_update_input_wallet.rb +2 -2
- data/lib/lago_ruby/models/wallets_paginated.rb +2 -2
- data/lib/lago_ruby/models/webhook_endpoint.rb +2 -2
- data/lib/lago_ruby/models/webhook_endpoint_create_input.rb +2 -2
- data/lib/lago_ruby/models/webhook_endpoint_create_input_webhook_endpoint.rb +2 -2
- data/lib/lago_ruby/models/webhook_endpoint_object.rb +2 -2
- data/lib/lago_ruby/models/webhook_endpoint_update_input.rb +2 -2
- data/lib/lago_ruby/models/webhook_endpoints_paginated.rb +2 -2
- data/lib/lago_ruby/version.rb +2 -2
- data/lib/lago_ruby.rb +12 -2
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/{credit_note_create_input_credit_note_items_inner_spec.rb → credit_note_estimate_input_credit_note_items_inner_spec.rb} +10 -8
- data/spec/models/credit_note_estimate_input_credit_note_spec.rb +42 -0
- data/spec/models/credit_note_estimate_input_spec.rb +36 -0
- data/spec/models/credit_note_estimated_estimated_credit_note_applied_taxes_inner_spec.rb +78 -0
- data/spec/models/credit_note_estimated_estimated_credit_note_items_inner_spec.rb +42 -0
- data/spec/models/credit_note_estimated_estimated_credit_note_spec.rb +96 -0
- data/spec/models/credit_note_estimated_spec.rb +36 -0
- data/spec/models/customer_past_usage_spec.rb +42 -0
- data/spec/models/plan_overrides_object_charges_inner_spec.rb +66 -0
- data/spec/models/plan_overrides_object_spec.rb +78 -0
- data/spec/models/subscription_object_extended_spec.rb +146 -0
- data/spec/spec_helper.rb +1 -1
- metadata +194 -152
data/docs/CustomersApi.md
CHANGED
@@ -7,6 +7,7 @@ All URIs are relative to *https://api.getlago.com/api/v1*
|
|
7
7
|
| [**create_customer**](CustomersApi.md#create_customer) | **POST** /customers | Create a customer |
|
8
8
|
| [**delete_applied_coupon**](CustomersApi.md#delete_applied_coupon) | **DELETE** /customers/{external_customer_id}/applied_coupons/{applied_coupon_id} | Delete an applied coupon |
|
9
9
|
| [**destroy_customer**](CustomersApi.md#destroy_customer) | **DELETE** /customers/{external_id} | Delete a customer |
|
10
|
+
| [**find_all_customer_past_usage**](CustomersApi.md#find_all_customer_past_usage) | **GET** /customers/{external_customer_id}/past_usage | Retrieve customer past usage |
|
10
11
|
| [**find_all_customers**](CustomersApi.md#find_all_customers) | **GET** /customers | List all customers |
|
11
12
|
| [**find_customer**](CustomersApi.md#find_customer) | **GET** /customers/{external_id} | Retrieve a customer |
|
12
13
|
| [**find_customer_current_usage**](CustomersApi.md#find_customer_current_usage) | **GET** /customers/{external_customer_id}/current_usage | Retrieve customer current usage |
|
@@ -222,6 +223,87 @@ end
|
|
222
223
|
- **Accept**: application/json
|
223
224
|
|
224
225
|
|
226
|
+
## find_all_customer_past_usage
|
227
|
+
|
228
|
+
> <CustomerPastUsage> find_all_customer_past_usage(external_customer_id, external_subscription_id, opts)
|
229
|
+
|
230
|
+
Retrieve customer past usage
|
231
|
+
|
232
|
+
This endpoint enables the retrieval of the usage-based billing data for a customer within past periods.
|
233
|
+
|
234
|
+
### Examples
|
235
|
+
|
236
|
+
```ruby
|
237
|
+
require 'time'
|
238
|
+
require 'lago_ruby'
|
239
|
+
# setup authorization
|
240
|
+
LagoAPI.configure do |config|
|
241
|
+
# Configure Bearer authorization: bearerAuth
|
242
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
243
|
+
end
|
244
|
+
|
245
|
+
api_instance = LagoAPI::CustomersApi.new
|
246
|
+
external_customer_id = '5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba' # String | The customer external unique identifier (provided by your own application).
|
247
|
+
external_subscription_id = 'sub_1234567890' # String | The unique identifier of the subscription within your application.
|
248
|
+
opts = {
|
249
|
+
page: 1, # Integer | Page number.
|
250
|
+
per_page: 20, # Integer | Number of records per page.
|
251
|
+
billable_metric_code: 'cpu', # String | Billable metric code filter to apply to the charge usage
|
252
|
+
periods_count: 5 # Integer | Number of past billing period to returns in the result
|
253
|
+
}
|
254
|
+
|
255
|
+
begin
|
256
|
+
# Retrieve customer past usage
|
257
|
+
result = api_instance.find_all_customer_past_usage(external_customer_id, external_subscription_id, opts)
|
258
|
+
p result
|
259
|
+
rescue LagoAPI::ApiError => e
|
260
|
+
puts "Error when calling CustomersApi->find_all_customer_past_usage: #{e}"
|
261
|
+
end
|
262
|
+
```
|
263
|
+
|
264
|
+
#### Using the find_all_customer_past_usage_with_http_info variant
|
265
|
+
|
266
|
+
This returns an Array which contains the response data, status code and headers.
|
267
|
+
|
268
|
+
> <Array(<CustomerPastUsage>, Integer, Hash)> find_all_customer_past_usage_with_http_info(external_customer_id, external_subscription_id, opts)
|
269
|
+
|
270
|
+
```ruby
|
271
|
+
begin
|
272
|
+
# Retrieve customer past usage
|
273
|
+
data, status_code, headers = api_instance.find_all_customer_past_usage_with_http_info(external_customer_id, external_subscription_id, opts)
|
274
|
+
p status_code # => 2xx
|
275
|
+
p headers # => { ... }
|
276
|
+
p data # => <CustomerPastUsage>
|
277
|
+
rescue LagoAPI::ApiError => e
|
278
|
+
puts "Error when calling CustomersApi->find_all_customer_past_usage_with_http_info: #{e}"
|
279
|
+
end
|
280
|
+
```
|
281
|
+
|
282
|
+
### Parameters
|
283
|
+
|
284
|
+
| Name | Type | Description | Notes |
|
285
|
+
| ---- | ---- | ----------- | ----- |
|
286
|
+
| **external_customer_id** | **String** | The customer external unique identifier (provided by your own application). | |
|
287
|
+
| **external_subscription_id** | **String** | The unique identifier of the subscription within your application. | |
|
288
|
+
| **page** | **Integer** | Page number. | [optional] |
|
289
|
+
| **per_page** | **Integer** | Number of records per page. | [optional] |
|
290
|
+
| **billable_metric_code** | **String** | Billable metric code filter to apply to the charge usage | [optional] |
|
291
|
+
| **periods_count** | **Integer** | Number of past billing period to returns in the result | [optional] |
|
292
|
+
|
293
|
+
### Return type
|
294
|
+
|
295
|
+
[**CustomerPastUsage**](CustomerPastUsage.md)
|
296
|
+
|
297
|
+
### Authorization
|
298
|
+
|
299
|
+
[bearerAuth](../README.md#bearerAuth)
|
300
|
+
|
301
|
+
### HTTP request headers
|
302
|
+
|
303
|
+
- **Content-Type**: Not defined
|
304
|
+
- **Accept**: application/json
|
305
|
+
|
306
|
+
|
225
307
|
## find_all_customers
|
226
308
|
|
227
309
|
> <CustomersPaginated> find_all_customers(opts)
|
data/docs/EventsApi.md
CHANGED
@@ -80,7 +80,7 @@ nil (empty response body)
|
|
80
80
|
|
81
81
|
## create_event
|
82
82
|
|
83
|
-
> create_event(event_input)
|
83
|
+
> <Event> create_event(event_input)
|
84
84
|
|
85
85
|
Send usage events
|
86
86
|
|
@@ -102,7 +102,8 @@ event_input = LagoAPI::EventInput.new({event: LagoAPI::EventInputEvent.new({tran
|
|
102
102
|
|
103
103
|
begin
|
104
104
|
# Send usage events
|
105
|
-
api_instance.create_event(event_input)
|
105
|
+
result = api_instance.create_event(event_input)
|
106
|
+
p result
|
106
107
|
rescue LagoAPI::ApiError => e
|
107
108
|
puts "Error when calling EventsApi->create_event: #{e}"
|
108
109
|
end
|
@@ -110,9 +111,9 @@ end
|
|
110
111
|
|
111
112
|
#### Using the create_event_with_http_info variant
|
112
113
|
|
113
|
-
This returns an Array which contains the response data
|
114
|
+
This returns an Array which contains the response data, status code and headers.
|
114
115
|
|
115
|
-
> <Array(
|
116
|
+
> <Array(<Event>, Integer, Hash)> create_event_with_http_info(event_input)
|
116
117
|
|
117
118
|
```ruby
|
118
119
|
begin
|
@@ -120,7 +121,7 @@ begin
|
|
120
121
|
data, status_code, headers = api_instance.create_event_with_http_info(event_input)
|
121
122
|
p status_code # => 2xx
|
122
123
|
p headers # => { ... }
|
123
|
-
p data # =>
|
124
|
+
p data # => <Event>
|
124
125
|
rescue LagoAPI::ApiError => e
|
125
126
|
puts "Error when calling EventsApi->create_event_with_http_info: #{e}"
|
126
127
|
end
|
@@ -134,7 +135,7 @@ end
|
|
134
135
|
|
135
136
|
### Return type
|
136
137
|
|
137
|
-
|
138
|
+
[**Event**](Event.md)
|
138
139
|
|
139
140
|
### Authorization
|
140
141
|
|
data/docs/FeeObject.md
CHANGED
@@ -13,11 +13,13 @@
|
|
13
13
|
| **lago_customer_id** | **String** | Unique identifier assigned to the customer, created by Lago. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true). | [optional] |
|
14
14
|
| **external_customer_id** | **String** | Unique identifier assigned to the customer in your application. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true). | [optional] |
|
15
15
|
| **external_subscription_id** | **String** | Unique identifier assigned to the subscription in your application. This field is specifically displayed when the fee type is charge and the payment for the fee is made in advance (`pay_in_advance` is set to true). | [optional] |
|
16
|
+
| **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 actual charge will be used as the default display name. | [optional] |
|
16
17
|
| **amount_cents** | **Integer** | The cost of this specific fee, excluding any applicable taxes. | |
|
17
18
|
| **amount_currency** | [**Currency**](Currency.md) | | |
|
18
19
|
| **taxes_amount_cents** | **Integer** | The cost of the tax associated with this specific fee. | |
|
19
20
|
| **taxes_rate** | **Float** | The tax rate associated with this specific fee. | |
|
20
21
|
| **units** | **String** | The number of units used to charge the customer. This field indicates the quantity or count of units consumed or utilized in the context of the charge. It helps in determining the basis for calculating the fee or cost associated with the usage of the service or product provided to the customer. | |
|
22
|
+
| **precise_unit_amount** | **String** | The unit amount of the fee per unit, with precision. | |
|
21
23
|
| **total_amount_cents** | **Integer** | The cost of this specific fee, including any applicable taxes. | |
|
22
24
|
| **total_amount_currency** | [**Currency**](Currency.md) | | |
|
23
25
|
| **events_count** | **Integer** | The number of events that have been sent and used to charge the customer. This field indicates the count or quantity of events that have been processed and considered in the charging process. | [optional] |
|
@@ -49,11 +51,13 @@ instance = LagoAPI::FeeObject.new(
|
|
49
51
|
lago_customer_id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
50
52
|
external_customer_id: external_id,
|
51
53
|
external_subscription_id: external_id,
|
54
|
+
invoice_display_name: Setup Fee (SF1),
|
52
55
|
amount_cents: 100,
|
53
56
|
amount_currency: null,
|
54
57
|
taxes_amount_cents: 20,
|
55
58
|
taxes_rate: 20,
|
56
59
|
units: 0.32,
|
60
|
+
precise_unit_amount: 312.5,
|
57
61
|
total_amount_cents: 120,
|
58
62
|
total_amount_currency: null,
|
59
63
|
events_count: 23,
|
data/docs/FeeObjectItem.md
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
| **type** | **String** | The fee type. Possible values are `add-on`, `charge`, `credit` or `subscription`. | |
|
8
8
|
| **code** | **String** | The code of the fee item. It can be the code of the `add-o`n, the code of the `charge`, the code of the `credit` or the code of the `subscription`. | |
|
9
9
|
| **name** | **String** | The name of the fee item. It can be the name of the `add-on`, the name of the `charge`, the name of the `credit` or the name of the `subscription`. | |
|
10
|
+
| **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 actual charge will be used as the default display name. | [optional] |
|
11
|
+
| **group_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 actual charge will be used as the default display name. | [optional] |
|
10
12
|
| **lago_item_id** | **String** | Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the identifier of the `charge`, the identifier of the `credit` or the identifier of the `subscription`. | |
|
11
13
|
| **item_type** | **String** | The type of the fee item. Possible values are `AddOn`, `BillableMetric`, `WalletTransaction` or `Subscription`. | |
|
12
14
|
|
@@ -19,6 +21,8 @@ instance = LagoAPI::FeeObjectItem.new(
|
|
19
21
|
type: subscription,
|
20
22
|
code: startup,
|
21
23
|
name: Startup,
|
24
|
+
invoice_display_name: Setup Fee (SF1),
|
25
|
+
group_invoice_display_name: Transactions - ACH,
|
22
26
|
lago_item_id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
23
27
|
item_type: Subscription
|
24
28
|
)
|
@@ -5,6 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **group_id** | **String** | Unique identifier of a billable metric group, created by Lago. | |
|
8
|
+
| **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 actual group will be used as the default display name. | [optional] |
|
8
9
|
| **values** | [**GroupPropertiesObjectValues**](GroupPropertiesObjectValues.md) | | |
|
9
10
|
|
10
11
|
## Example
|
@@ -14,6 +15,7 @@ require 'lago_ruby'
|
|
14
15
|
|
15
16
|
instance = LagoAPI::GroupPropertiesObject.new(
|
16
17
|
group_id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
18
|
+
invoice_display_name: AWS,
|
17
19
|
values: null
|
18
20
|
)
|
19
21
|
```
|
@@ -5,6 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **add_on_code** | **String** | The code of the add-on used as invoice item. | |
|
8
|
+
| **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 actual charge will be used as the default display name. | [optional] |
|
8
9
|
| **unit_amount_cents** | **Integer** | The amount of the fee per unit, expressed in cents. By default, the amount of the add-on is used. | [optional] |
|
9
10
|
| **units** | **String** | The quantity of units associated with the fee. By default, only 1 unit is added to the invoice. | [optional] |
|
10
11
|
| **description** | **String** | This is a description | [optional] |
|
@@ -17,6 +18,7 @@ require 'lago_ruby'
|
|
17
18
|
|
18
19
|
instance = LagoAPI::InvoiceOneOffCreateInputInvoiceFeesInner.new(
|
19
20
|
add_on_code: setup_fee,
|
21
|
+
invoice_display_name: Setup Fee (SF1),
|
20
22
|
unit_amount_cents: 12000,
|
21
23
|
units: 2.5,
|
22
24
|
description: The description of the fee line item in the invoice. By default, the description of the add-on is used.,
|
data/docs/PlanCreateInputPlan.md
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **name** | **String** | The name of the plan. | [optional] |
|
8
|
+
| **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. | [optional] |
|
8
9
|
| **code** | **String** | 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. | [optional] |
|
9
10
|
| **interval** | **String** | 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`, `quarterly`, `monthly`, or `weekly`. | [optional] |
|
10
11
|
| **description** | **String** | The description on the plan. | [optional] |
|
@@ -23,6 +24,7 @@ require 'lago_ruby'
|
|
23
24
|
|
24
25
|
instance = LagoAPI::PlanCreateInputPlan.new(
|
25
26
|
name: Startup,
|
27
|
+
invoice_display_name: Startup plan,
|
26
28
|
code: startup,
|
27
29
|
interval: monthly,
|
28
30
|
description: Plan for early stage startups.,
|
@@ -32,7 +34,7 @@ instance = LagoAPI::PlanCreateInputPlan.new(
|
|
32
34
|
pay_in_advance: true,
|
33
35
|
bill_charges_monthly: null,
|
34
36
|
tax_codes: ["french_standard_vat"],
|
35
|
-
charges: [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"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"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
37
|
+
charges: [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"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"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
36
38
|
)
|
37
39
|
```
|
38
40
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
| **charge_model** | **String** | Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage` `package`, `percentage` or `volume`. | [optional] |
|
9
9
|
| **pay_in_advance** | **Boolean** | 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. | [optional] |
|
10
10
|
| **invoiceable** | **Boolean** | 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`. | [optional] |
|
11
|
+
| **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 actual charge will be used as the default display name. | [optional] |
|
11
12
|
| **prorated** | **Boolean** | 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`. | [optional] |
|
12
13
|
| **min_amount_cents** | **Integer** | 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. | [optional] |
|
13
14
|
| **properties** | [**ChargeObjectProperties**](ChargeObjectProperties.md) | | [optional] |
|
@@ -24,6 +25,7 @@ instance = LagoAPI::PlanCreateInputPlanChargesInner.new(
|
|
24
25
|
charge_model: standard,
|
25
26
|
pay_in_advance: false,
|
26
27
|
invoiceable: true,
|
28
|
+
invoice_display_name: Setup,
|
27
29
|
prorated: false,
|
28
30
|
min_amount_cents: 0,
|
29
31
|
properties: null,
|
data/docs/PlanObject.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **lago_id** | **String** | Unique identifier of the plan created by Lago. | |
|
8
8
|
| **name** | **String** | The name of the plan. | |
|
9
|
+
| **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. | [optional] |
|
9
10
|
| **created_at** | **Time** | 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. | |
|
10
11
|
| **code** | **String** | 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. | |
|
11
12
|
| **interval** | **String** | 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`, `quarterly`, `monthly` or `weekly`. | |
|
@@ -28,6 +29,7 @@ require 'lago_ruby'
|
|
28
29
|
instance = LagoAPI::PlanObject.new(
|
29
30
|
lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
30
31
|
name: Startup,
|
32
|
+
invoice_display_name: Startup plan,
|
31
33
|
created_at: 2023-06-27T19:43:42Z,
|
32
34
|
code: startup,
|
33
35
|
interval: monthly,
|
@@ -39,7 +41,7 @@ instance = LagoAPI::PlanObject.new(
|
|
39
41
|
bill_charges_monthly: null,
|
40
42
|
active_subscriptions_count: 0,
|
41
43
|
draft_invoices_count: 0,
|
42
|
-
charges: [{"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,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"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,"pay_in_advance":false,"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"}]},"group_properties":[]},{"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,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"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,"pay_in_advance":false,"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"}]},"group_properties":[]},{"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,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}],
|
44
|
+
charges: [{"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,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"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,"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"}]},"group_properties":[]},{"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,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"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,"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"}]},"group_properties":[]},{"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,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}],
|
43
45
|
taxes: null
|
44
46
|
)
|
45
47
|
```
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# LagoAPI::PlanOverridesObject
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **amount_cents** | **Integer** | 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. | [optional] |
|
8
|
+
| **amount_currency** | [**Currency**](Currency.md) | | [optional] |
|
9
|
+
| **description** | **String** | The description on the plan. | [optional] |
|
10
|
+
| **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. | [optional] |
|
11
|
+
| **name** | **String** | The name of the plan. | [optional] |
|
12
|
+
| **tax_codes** | **Array<String>** | List of unique code used to identify the taxes. | [optional] |
|
13
|
+
| **trial_period** | **Float** | The duration in days during which the base cost of the plan is offered for free. | [optional] |
|
14
|
+
| **charges** | [**Array<PlanOverridesObjectChargesInner>**](PlanOverridesObjectChargesInner.md) | Additional usage-based charges for this plan. | [optional] |
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'lago_ruby'
|
20
|
+
|
21
|
+
instance = LagoAPI::PlanOverridesObject.new(
|
22
|
+
amount_cents: 10000,
|
23
|
+
amount_currency: null,
|
24
|
+
description: Plan for early stage startups.,
|
25
|
+
invoice_display_name: Startup plan,
|
26
|
+
name: Startup,
|
27
|
+
tax_codes: ["french_standard_vat"],
|
28
|
+
trial_period: 5,
|
29
|
+
charges: null
|
30
|
+
)
|
31
|
+
```
|
32
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# LagoAPI::PlanOverridesObjectChargesInner
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | Unique identifier of the charge created by Lago. | [optional] |
|
8
|
+
| **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 actual charge will be used as the default display name. | [optional] |
|
9
|
+
| **min_amount_cents** | **Integer** | 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. | [optional] |
|
10
|
+
| **properties** | [**ChargeObjectProperties**](ChargeObjectProperties.md) | | [optional] |
|
11
|
+
| **group_properties** | [**Array<PlanCreateInputPlanChargesInnerGroupPropertiesInner>**](PlanCreateInputPlanChargesInnerGroupPropertiesInner.md) | All charge information, sorted by groups. | [optional] |
|
12
|
+
| **tax_codes** | **Array<String>** | List of unique code used to identify the taxes. | [optional] |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'lago_ruby'
|
18
|
+
|
19
|
+
instance = LagoAPI::PlanOverridesObjectChargesInner.new(
|
20
|
+
id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
21
|
+
invoice_display_name: Setup,
|
22
|
+
min_amount_cents: 0,
|
23
|
+
properties: null,
|
24
|
+
group_properties: null,
|
25
|
+
tax_codes: ["french_standard_vat"]
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
data/docs/PlanUpdateInputPlan.md
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **name** | **String** | The name of the plan. | [optional] |
|
8
|
+
| **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. | [optional] |
|
8
9
|
| **code** | **String** | 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. | [optional] |
|
9
10
|
| **interval** | **String** | 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`, `quarterly`, `monthly`, or `weekly`. | [optional] |
|
10
11
|
| **description** | **String** | The description on the plan. | [optional] |
|
@@ -23,6 +24,7 @@ require 'lago_ruby'
|
|
23
24
|
|
24
25
|
instance = LagoAPI::PlanUpdateInputPlan.new(
|
25
26
|
name: Startup,
|
27
|
+
invoice_display_name: Startup plan,
|
26
28
|
code: startup,
|
27
29
|
interval: monthly,
|
28
30
|
description: Plan for early stage startups.,
|
@@ -32,7 +34,7 @@ instance = LagoAPI::PlanUpdateInputPlan.new(
|
|
32
34
|
pay_in_advance: true,
|
33
35
|
bill_charges_monthly: null,
|
34
36
|
tax_codes: ["french_standard_vat"],
|
35
|
-
charges: [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"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"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
37
|
+
charges: [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"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"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
|
36
38
|
)
|
37
39
|
```
|
38
40
|
|
@@ -9,6 +9,7 @@
|
|
9
9
|
| **charge_model** | **String** | Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage` or `volume`. | [optional] |
|
10
10
|
| **pay_in_advance** | **Boolean** | 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. | [optional] |
|
11
11
|
| **invoiceable** | **Boolean** | 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`. | [optional] |
|
12
|
+
| **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 actual charge will be used as the default display name. | [optional] |
|
12
13
|
| **prorated** | **Boolean** | 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`. | [optional] |
|
13
14
|
| **min_amount_cents** | **Integer** | 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. | [optional] |
|
14
15
|
| **properties** | [**ChargeObjectProperties**](ChargeObjectProperties.md) | | [optional] |
|
@@ -26,6 +27,7 @@ instance = LagoAPI::PlanUpdateInputPlanChargesInner.new(
|
|
26
27
|
charge_model: standard,
|
27
28
|
pay_in_advance: false,
|
28
29
|
invoiceable: true,
|
30
|
+
invoice_display_name: Setup,
|
29
31
|
prorated: false,
|
30
32
|
min_amount_cents: 0,
|
31
33
|
properties: null,
|
data/docs/Subscription.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **subscription** | [**
|
7
|
+
| **subscription** | [**SubscriptionObjectExtended**](SubscriptionObjectExtended.md) | | |
|
8
8
|
|
9
9
|
## Example
|
10
10
|
|
@@ -11,6 +11,7 @@
|
|
11
11
|
| **billing_time** | **String** | The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration). | [optional] |
|
12
12
|
| **ending_at** | **Time** | The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC). | [optional] |
|
13
13
|
| **subscription_at** | **Time** | The start date for the subscription, allowing for the creation of subscriptions that can begin in the past or future. Please note that it cannot be used to update the start date of a pending subscription or schedule an upgrade/downgrade. The start_date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). | [optional] |
|
14
|
+
| **plan_overrides** | [**PlanOverridesObject**](PlanOverridesObject.md) | | [optional] |
|
14
15
|
|
15
16
|
## Example
|
16
17
|
|
@@ -24,7 +25,8 @@ instance = LagoAPI::SubscriptionCreateInputSubscription.new(
|
|
24
25
|
external_id: my_sub_1234567890,
|
25
26
|
billing_time: anniversary,
|
26
27
|
ending_at: 2022-10-08T00:00Z,
|
27
|
-
subscription_at: 2022-08-08T00:00Z
|
28
|
+
subscription_at: 2022-08-08T00:00Z,
|
29
|
+
plan_overrides: null
|
28
30
|
)
|
29
31
|
```
|
30
32
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# LagoAPI::SubscriptionObjectExtended
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **lago_id** | **String** | Unique identifier assigned to the subscription within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s record within the Lago system | |
|
8
|
+
| **external_id** | **String** | The subscription external unique identifier (provided by your own application). | |
|
9
|
+
| **lago_customer_id** | **String** | Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system | |
|
10
|
+
| **external_customer_id** | **String** | The customer external unique identifier (provided by your own application). | |
|
11
|
+
| **billing_time** | **String** | The billing time for the subscription, which can be set as either `anniversary` or `calendar`. If not explicitly provided, it will default to `calendar`. The billing time determines the timing of recurring billing cycles for the subscription. By specifying `anniversary`, the billing cycle will be based on the specific date the subscription started (billed fully), while `calendar` sets the billing cycle at the first day of the week/month/year (billed with proration). | |
|
12
|
+
| **name** | **String** | The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan. | [optional] |
|
13
|
+
| **plan_code** | **String** | The unique code representing the plan to be attached to the customer. This code must correspond to the `code` property of one of the active plans. | |
|
14
|
+
| **status** | **String** | The status of the subscription, which can have the following values: - `pending`: a previous subscription has been downgraded, and the current one is awaiting automatic activation at the end of the billing period. - `active`: the subscription is currently active and applied to the customer. - `terminated`: the subscription is no longer active. - `canceled`: the subscription has been stopped before its activation. This can occur when two consecutive downgrades have been applied to a customer or when a subscription with a pending status is terminated. | |
|
15
|
+
| **created_at** | **Time** | The creation date of the subscription, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). This date provides a timestamp indicating when the subscription was initially created. | |
|
16
|
+
| **canceled_at** | **Time** | The cancellation date of the subscription. This field is not null when the subscription is `canceled`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). | [optional] |
|
17
|
+
| **started_at** | **Time** | The effective start date of the subscription. This field can be null if the subscription is `pending` or `canceled`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). | [optional] |
|
18
|
+
| **ending_at** | **Time** | The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC). | [optional] |
|
19
|
+
| **subscription_at** | **Time** | The anniversary date and time of the initial subscription. This date serves as the basis for billing subscriptions with `anniversary` billing time. The `anniversary_date` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). | |
|
20
|
+
| **terminated_at** | **Time** | The termination date of the subscription. This field is not null when the subscription is `terminated`. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC) | [optional] |
|
21
|
+
| **previous_plan_code** | **String** | The code identifying the previous plan associated with this subscription. | [optional] |
|
22
|
+
| **next_plan_code** | **String** | The code identifying the next plan in the case of a downgrade. | [optional] |
|
23
|
+
| **downgrade_plan_date** | **Time** | The date when the plan will be downgraded, represented in ISO 8601 date format. | [optional] |
|
24
|
+
| **plan** | [**PlanObject**](PlanObject.md) | | [optional] |
|
25
|
+
|
26
|
+
## Example
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'lago_ruby'
|
30
|
+
|
31
|
+
instance = LagoAPI::SubscriptionObjectExtended.new(
|
32
|
+
lago_id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
33
|
+
external_id: 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba,
|
34
|
+
lago_customer_id: 1a901a90-1a90-1a90-1a90-1a901a901a90,
|
35
|
+
external_customer_id: 5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba,
|
36
|
+
billing_time: anniversary,
|
37
|
+
name: Repository A,
|
38
|
+
plan_code: premium,
|
39
|
+
status: active,
|
40
|
+
created_at: 2022-08-08T00:00Z,
|
41
|
+
canceled_at: 2022-09-14T16:35:31Z,
|
42
|
+
started_at: 2022-08-08T00:00Z,
|
43
|
+
ending_at: 2022-10-08T00:00Z,
|
44
|
+
subscription_at: 2022-08-08T00:00Z,
|
45
|
+
terminated_at: 2022-09-14T16:35:31Z,
|
46
|
+
previous_plan_code: null,
|
47
|
+
next_plan_code: null,
|
48
|
+
downgrade_plan_date: null,
|
49
|
+
plan: null
|
50
|
+
)
|
51
|
+
```
|
52
|
+
|
@@ -7,6 +7,7 @@
|
|
7
7
|
| **name** | **String** | The display name of the subscription on an invoice. This field allows for customization of the subscription's name for billing purposes, especially useful when a single customer has multiple subscriptions using the same plan. | [optional] |
|
8
8
|
| **ending_at** | **Time** | The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC). | [optional] |
|
9
9
|
| **subscription_at** | **Time** | The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). | [optional] |
|
10
|
+
| **plan_overrides** | [**PlanOverridesObject**](PlanOverridesObject.md) | | [optional] |
|
10
11
|
|
11
12
|
## Example
|
12
13
|
|
@@ -16,7 +17,8 @@ require 'lago_ruby'
|
|
16
17
|
instance = LagoAPI::SubscriptionUpdateInputSubscription.new(
|
17
18
|
name: Repository B,
|
18
19
|
ending_at: 2022-10-08T00:00Z,
|
19
|
-
subscription_at: 2022-08-08T00:00Z
|
20
|
+
subscription_at: 2022-08-08T00:00Z,
|
21
|
+
plan_overrides: null
|
20
22
|
)
|
21
23
|
```
|
22
24
|
|