Skip to content
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.35.0"
".": "4.36.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5b9152241ebdd0d2f3fd536784f33721d24a5c4a59e75cab366a3dcb36552d3d.yml
openapi_spec_hash: b40061d10bbe1ebab8998bddd1827cf8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-f2b97a2c3e41f618dc8955ed325092320ff2170a7d7a9a26a31dc235c969b657.yml
openapi_spec_hash: 64548564dc8ce80ef3ad38fc8cb56b30
config_hash: dd4343ce95871032ef6e0735a4ca038c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.36.0 (2025-11-05)

Full Changelog: [v4.35.0...v4.36.0](https://github.com/orbcorp/orb-python/compare/v4.35.0...v4.36.0)

### Features

* **api:** api update ([e70d3c9](https://github.com/orbcorp/orb-python/commit/e70d3c93ea62dea62e5b3b8e16538f8945bdc4e9))

## 4.35.0 (2025-11-04)

Full Changelog: [v4.34.0...v4.35.0](https://github.com/orbcorp/orb-python/compare/v4.34.0...v4.35.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "orb-billing"
version = "4.35.0"
version = "4.36.0"
description = "The official Python library for the orb API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/orb/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "orb"
__version__ = "4.35.0" # x-release-please-version
__version__ = "4.36.0" # x-release-please-version
12 changes: 12 additions & 0 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ def price_intervals(
add: Iterable[subscription_price_intervals_params.Add] | Omit = omit,
add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | Omit = omit,
allow_invoice_credit_or_void: Optional[bool] | Omit = omit,
can_defer_billing: Optional[bool] | Omit = omit,
edit: Iterable[subscription_price_intervals_params.Edit] | Omit = omit,
edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1315,6 +1316,10 @@ def price_intervals(
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

can_defer_billing: If true, ending an in-arrears price interval mid-cycle will defer billing the
final line itemuntil the next scheduled invoice. If false, it will be billed on
its end date. If not provided, behaviorwill follow account default.

edit: A list of price intervals to edit on the subscription.

edit_adjustments: A list of adjustments to edit on the subscription.
Expand All @@ -1338,6 +1343,7 @@ def price_intervals(
"add": add,
"add_adjustments": add_adjustments,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"can_defer_billing": can_defer_billing,
"edit": edit,
"edit_adjustments": edit_adjustments,
},
Expand Down Expand Up @@ -3308,6 +3314,7 @@ async def price_intervals(
add: Iterable[subscription_price_intervals_params.Add] | Omit = omit,
add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | Omit = omit,
allow_invoice_credit_or_void: Optional[bool] | Omit = omit,
can_defer_billing: Optional[bool] | Omit = omit,
edit: Iterable[subscription_price_intervals_params.Edit] | Omit = omit,
edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -3401,6 +3408,10 @@ async def price_intervals(
credit note. Consider using this as a safety mechanism if you do not expect
existing invoices to be changed.

can_defer_billing: If true, ending an in-arrears price interval mid-cycle will defer billing the
final line itemuntil the next scheduled invoice. If false, it will be billed on
its end date. If not provided, behaviorwill follow account default.

edit: A list of price intervals to edit on the subscription.

edit_adjustments: A list of adjustments to edit on the subscription.
Expand All @@ -3424,6 +3435,7 @@ async def price_intervals(
"add": add,
"add_adjustments": add_adjustments,
"allow_invoice_credit_or_void": allow_invoice_credit_or_void,
"can_defer_billing": can_defer_billing,
"edit": edit,
"edit_adjustments": edit_adjustments,
},
Expand Down
7 changes: 7 additions & 0 deletions src/orb/types/shared/price_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class PriceInterval(BaseModel):
billing_cycle_day: int
"""The day of the month that Orb bills for this price"""

can_defer_billing: bool
"""For in-arrears prices.

If true, and the price interval ends mid-cycle, the final line item will be
deferred to the next scheduled invoice instead of being billed mid-cycle.
"""

current_billing_period_end_date: Optional[datetime] = None
"""The end of the current billing period.

Expand Down
5 changes: 4 additions & 1 deletion src/orb/types/shared/tiered_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List
from typing import List, Optional

from .tier import Tier
from ..._models import BaseModel
Expand All @@ -11,3 +11,6 @@
class TieredConfig(BaseModel):
tiers: List[Tier]
"""Tiers for rating based on total usage quantities into the specified tier"""

prorated: Optional[bool] = None
"""If true, subtotals from this price are prorated based on the service period"""
5 changes: 5 additions & 0 deletions src/orb/types/shared/unit_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from ..._models import BaseModel

__all__ = ["UnitConfig"]
Expand All @@ -8,3 +10,6 @@
class UnitConfig(BaseModel):
unit_amount: str
"""Rate per unit of usage"""

prorated: Optional[bool] = None
"""If true, subtotals from this price are prorated based on the service period"""
3 changes: 3 additions & 0 deletions src/orb/types/shared_params/tiered_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
class TieredConfig(TypedDict, total=False):
tiers: Required[Iterable[Tier]]
"""Tiers for rating based on total usage quantities into the specified tier"""

prorated: bool
"""If true, subtotals from this price are prorated based on the service period"""
3 changes: 3 additions & 0 deletions src/orb/types/shared_params/unit_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
class UnitConfig(TypedDict, total=False):
unit_amount: Required[str]
"""Rate per unit of usage"""

prorated: bool
"""If true, subtotals from this price are prorated based on the service period"""
14 changes: 14 additions & 0 deletions src/orb/types/subscription_price_intervals_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ class SubscriptionPriceIntervalsParams(TypedDict, total=False):
existing invoices to be changed.
"""

can_defer_billing: Optional[bool]
"""
If true, ending an in-arrears price interval mid-cycle will defer billing the
final line itemuntil the next scheduled invoice. If false, it will be billed on
its end date. If not provided, behaviorwill follow account default.
"""

edit: Iterable[Edit]
"""A list of price intervals to edit on the subscription."""

Expand Down Expand Up @@ -669,6 +676,13 @@ class Edit(TypedDict, total=False):
overlapping price intervals must have the same billing cycle day.
"""

can_defer_billing: Optional[bool]
"""
If true, ending an in-arrears price interval mid-cycle will defer billing the
final line itemuntil the next scheduled invoice. If false, it will be billed on
its end date. If not provided, behaviorwill follow account default.
"""

end_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate, None], PropertyInfo(format="iso8601")]
"""The updated end date of this price interval.

Expand Down
20 changes: 16 additions & 4 deletions tests/api_resources/beta/test_external_plan_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -168,7 +171,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -392,7 +398,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -483,7 +492,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down
20 changes: 16 additions & 4 deletions tests/api_resources/test_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -168,7 +171,10 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None:
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -392,7 +398,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -483,7 +492,10 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down
10 changes: 8 additions & 2 deletions tests/api_resources/test_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
"name": "Line Item Name",
"quantity": 1,
"start_date": parse_date("2023-09-22"),
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
}
],
customer_id="4khy3nwzktxv7",
Expand Down Expand Up @@ -508,7 +511,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
"name": "Line Item Name",
"quantity": 1,
"start_date": parse_date("2023-09-22"),
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
}
],
customer_id="4khy3nwzktxv7",
Expand Down
10 changes: 8 additions & 2 deletions tests/api_resources/test_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down Expand Up @@ -322,7 +325,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
"item_id": "item_id",
"model_type": "unit",
"name": "Annual fee",
"unit_config": {"unit_amount": "unit_amount"},
"unit_config": {
"unit_amount": "unit_amount",
"prorated": True,
},
"billable_metric_id": "billable_metric_id",
"billed_in_advance": True,
"billing_cycle_configuration": {
Expand Down
Loading