diff --git a/openapi.yaml b/openapi.yaml index 3b89551c..5e89e67b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3343,7 +3343,7 @@ paths: example: event-123 - name: timestamp_from_started_at in: query - description: Requires `external_subscription_id` to be set. Filter events by timestamp after the subscription started at datetime. + description: Requires `external_subscription_id` to be set, and cannot be combined with `timestamp_from`. Filter events by timestamp after the subscription started at datetime. required: false explode: true schema: @@ -13533,9 +13533,11 @@ components: example: '2022-09-14T16:35:31Z' description: Creation date of the billable metric. expression: - type: string + type: + - string + - 'null' example: round((ended_at - started_at) * units) - description: Expression used to calculate the event units. The expression is evalutated for each event and the result is then used to calculate the total aggregated units. + description: Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units. field_name: type: - string @@ -13627,8 +13629,8 @@ components: - 'null' example: round((ended_at - started_at) * units) description: | - Expression used to calculate the event units. The expression is evalutated for each event and the result is then used to calculate the total aggregated units. - Accepted function are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. + Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units. + Accepted functions are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. Round is accepting an optional second parameter to specify the number of decimal. rounding_function: type: @@ -13705,8 +13707,8 @@ components: type: string example: round((ended_at - started_at) * units) description: | - Expression used to calculate the event units. The expression is evalutated for each event and the result is then used to calculate the total aggregated units. - Accepted function are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. + Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units. + Accepted functions are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. Round is accepting an optional second parameter to specify the number of decimal. event: type: object @@ -19237,13 +19239,13 @@ components: type: string format: date-time example: '2022-04-29T08:59:51.123Z' - description: This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception. + description: The date and time at which the event occurred, in ISO 8601 format with millisecond precision and expressed in Coordinated Universal Time (UTC). When no timestamp is sent on the event, it is set to the time of event reception. precise_total_amount_cents: type: - string - 'null' example: '1234.56' - description: The precise total amount that was sent in the event payload. This filed is used by the `dynamic` pricing model. + description: The precise total amount that was sent in the event payload. This field is used by the `dynamic` pricing model. properties: type: object description: This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. @@ -19273,7 +19275,7 @@ components: external_subscription_id: type: string example: sub_1234567890 - description: The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided. + description: The unique identifier of the subscription within your application, as sent on the event. It is the value Lago uses to attach the event to a subscription. created_at: type: - string @@ -19326,7 +19328,7 @@ components: description: | This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception. - You can also provide miliseconds precision by appending decimals to the timestamp. + You can also provide milliseconds precision by appending decimals to the timestamp. precise_total_amount_cents: type: - string @@ -19422,6 +19424,12 @@ components: type: string example: sub_1234567890 description: The unique identifier of the subscription within your application. + precise_total_amount_cents: + type: + - string + - 'null' + example: '1234.56' + description: The precise total amount in cents with precision used by the `dynamic` pricing model to compute the estimated usage amount. Defaults to `0` when omitted. properties: type: object description: This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. Any property of the targeted billable metric can be sent here, in addition to the documented fields below. diff --git a/src/resources/events.yaml b/src/resources/events.yaml index 6dd7a1aa..7680607d 100644 --- a/src/resources/events.yaml +++ b/src/resources/events.yaml @@ -47,7 +47,7 @@ get: example: "event-123" - name: timestamp_from_started_at in: query - description: Requires `external_subscription_id` to be set. Filter events by timestamp after the subscription started at datetime. + description: Requires `external_subscription_id` to be set, and cannot be combined with `timestamp_from`. Filter events by timestamp after the subscription started at datetime. required: false explode: true schema: diff --git a/src/schemas/BillableMetricBaseInput.yaml b/src/schemas/BillableMetricBaseInput.yaml index 0acf95c0..e8245735 100644 --- a/src/schemas/BillableMetricBaseInput.yaml +++ b/src/schemas/BillableMetricBaseInput.yaml @@ -29,8 +29,8 @@ properties: - "null" example: "round((ended_at - started_at) * units)" description: | - Expression used to calculate the event units. The expression is evalutated for each event and the result is then used to calculate the total aggregated units. - Accepted function are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. + Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units. + Accepted functions are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. Round is accepting an optional second parameter to specify the number of decimal. rounding_function: type: diff --git a/src/schemas/BillableMetricEvaluateExpressionInput.yaml b/src/schemas/BillableMetricEvaluateExpressionInput.yaml index 107eec59..0ad7ee80 100644 --- a/src/schemas/BillableMetricEvaluateExpressionInput.yaml +++ b/src/schemas/BillableMetricEvaluateExpressionInput.yaml @@ -7,8 +7,8 @@ properties: type: string example: "round((ended_at - started_at) * units)" description: | - Expression used to calculate the event units. The expression is evalutated for each event and the result is then used to calculate the total aggregated units. - Accepted function are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. + Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units. + Accepted functions are `ceil`, `concat` and `round` as well as `+`, `-`, `\` and `*` operations. Round is accepting an optional second parameter to specify the number of decimal. event: type: object diff --git a/src/schemas/BillableMetricObject.yaml b/src/schemas/BillableMetricObject.yaml index cd6e73c5..6dcbd3f0 100644 --- a/src/schemas/BillableMetricObject.yaml +++ b/src/schemas/BillableMetricObject.yaml @@ -58,9 +58,11 @@ properties: example: "2022-09-14T16:35:31Z" description: "Creation date of the billable metric." expression: - type: string + type: + - string + - "null" example: "round((ended_at - started_at) * units)" - description: "Expression used to calculate the event units. The expression is evalutated for each event and the result is then used to calculate the total aggregated units." + description: "Expression used to calculate the event units. The expression is evaluated for each event and the result is then used to calculate the total aggregated units." field_name: type: - string diff --git a/src/schemas/EventEstimateFeesInput.yaml b/src/schemas/EventEstimateFeesInput.yaml index d02b454b..a66e4670 100644 --- a/src/schemas/EventEstimateFeesInput.yaml +++ b/src/schemas/EventEstimateFeesInput.yaml @@ -16,6 +16,12 @@ properties: type: string example: "sub_1234567890" description: The unique identifier of the subscription within your application. + precise_total_amount_cents: + type: + - string + - "null" + example: "1234.56" + description: The precise total amount in cents with precision used by the `dynamic` pricing model to compute the estimated usage amount. Defaults to `0` when omitted. properties: type: object description: This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. Any property of the targeted billable metric can be sent here, in addition to the documented fields below. diff --git a/src/schemas/EventInputObject.yaml b/src/schemas/EventInputObject.yaml index fa19f08e..049f378a 100644 --- a/src/schemas/EventInputObject.yaml +++ b/src/schemas/EventInputObject.yaml @@ -30,7 +30,7 @@ properties: description: | This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception. - You can also provide miliseconds precision by appending decimals to the timestamp. + You can also provide milliseconds precision by appending decimals to the timestamp. precise_total_amount_cents: type: - string diff --git a/src/schemas/EventObject.yaml b/src/schemas/EventObject.yaml index 288515a2..188e3928 100644 --- a/src/schemas/EventObject.yaml +++ b/src/schemas/EventObject.yaml @@ -32,13 +32,13 @@ properties: type: string format: "date-time" example: "2022-04-29T08:59:51.123Z" - description: This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception. + description: The date and time at which the event occurred, in ISO 8601 format with millisecond precision and expressed in Coordinated Universal Time (UTC). When no timestamp is sent on the event, it is set to the time of event reception. precise_total_amount_cents: type: - string - "null" example: "1234.56" - description: The precise total amount that was sent in the event payload. This filed is used by the `dynamic` pricing model. + description: The precise total amount that was sent in the event payload. This field is used by the `dynamic` pricing model. properties: type: object description: This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required. @@ -68,7 +68,7 @@ properties: external_subscription_id: type: string example: "sub_1234567890" - description: The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided. + description: The unique identifier of the subscription within your application, as sent on the event. It is the value Lago uses to attach the event to a subscription. created_at: type: - string