Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DynamicPricing): Document Event#precise_total_amount_cents #281

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/schemas/ChargeObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ properties:
example: "2022-09-14T16:35:31Z"
charge_model:
type: string
description: Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage` or `volume`.
description: Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage`, `volume` or `dynamic`.
enum:
- standard
- graduated
- graduated_percentage
- package
- percentage
- volume
- dynamic
pay_in_advance:
type: boolean
description: 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.
Expand Down
5 changes: 5 additions & 0 deletions src/schemas/EventInputObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ properties:
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.
precise_total_amount_cents:
type: string
nullable: true
example: "1234.56"
description: The precise total amount in cents with precision used by the `dynamic` pricing model to compute the usage amount.
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.
Expand Down
5 changes: 5 additions & 0 deletions src/schemas/EventObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ properties:
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.
precise_total_amount_cents:
type: string
nullable: true
example: "1234.56"
description: The precise total amount that was sent in the event payload. This filed 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.
Expand Down
3 changes: 2 additions & 1 deletion src/schemas/PlanCreateInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ properties:
example: "1a901a90-1a90-1a90-1a90-1a901a901a90"
charge_model:
type: string
description: Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage` `package`, `percentage` or `volume`.
description: Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage` `package`, `percentage`, `volume` or `dynamic`.
enum:
- standard
- graduated
- graduated_percentage
- package
- percentage
- volume
- dynamic
example: "standard"
pay_in_advance:
type: boolean
Expand Down
3 changes: 2 additions & 1 deletion src/schemas/PlanUpdateInput.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ properties:
example: "1a901a90-1a90-1a90-1a90-1a901a901a90"
charge_model:
type: string
description: Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage` or `volume`.
description: Specifies the pricing model used for the calculation of the final fee. It can be `standard`, `graduated`, `graduated_percentage`, `package`, `percentage`, `volume` or `dynamic`.
enum:
- standard
- graduated
- graduated_percentage
- package
- percentage
- volume
- dynamic
example: "standard"
pay_in_advance:
type: boolean
Expand Down
Loading