From b71af2d0eeeccb9f66507bfc81af83d714632a0a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 22:44:34 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- src/increase/types/card.py | 96 +++++++++++++++------ src/increase/types/card_create_params.py | 96 +++++++++++++++------ src/increase/types/card_update_params.py | 96 +++++++++++++++------ tests/api_resources/test_cards.py | 104 ++++++++++++++++------- 5 files changed, 290 insertions(+), 106 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5fef959d..59a5dddf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c73835a51350d0f42d529d2731b0d4da4487f55b1c98a6e0a322c21b1264f209.yml -openapi_spec_hash: 23561aff9285210e32b4e15e1486a01a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-10b0412eb48b8e2b9720b29cf479448d246a9169c1937177f11a3d2ef80ae7f1.yml +openapi_spec_hash: ed688969255974736f3fbd4e6f30194e config_hash: 4945e03affdf289484733306e4797f81 diff --git a/src/increase/types/card.py b/src/increase/types/card.py index f5febcc1..29b66ce8 100644 --- a/src/increase/types/card.py +++ b/src/increase/types/card.py @@ -11,7 +11,6 @@ __all__ = [ "Card", "AuthorizationControls", - "AuthorizationControlsMaximumAuthorizationCount", "AuthorizationControlsMerchantAcceptorIdentifier", "AuthorizationControlsMerchantAcceptorIdentifierAllowed", "AuthorizationControlsMerchantAcceptorIdentifierBlocked", @@ -21,23 +20,17 @@ "AuthorizationControlsMerchantCountry", "AuthorizationControlsMerchantCountryAllowed", "AuthorizationControlsMerchantCountryBlocked", - "AuthorizationControlsSpendingLimit", - "AuthorizationControlsSpendingLimitMerchantCategoryCode", + "AuthorizationControlsUsage", + "AuthorizationControlsUsageMultiUse", + "AuthorizationControlsUsageMultiUseSpendingLimit", + "AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode", + "AuthorizationControlsUsageSingleUse", + "AuthorizationControlsUsageSingleUseSettlementAmount", "BillingAddress", "DigitalWallet", ] -class AuthorizationControlsMaximumAuthorizationCount(BaseModel): - """Limits the number of authorizations that can be approved on this card.""" - - all_time: Optional[int] = None - """ - The maximum number of authorizations that can be approved on this card over its - lifetime. - """ - - class AuthorizationControlsMerchantAcceptorIdentifierAllowed(BaseModel): identifier: str """The Merchant Acceptor ID.""" @@ -104,12 +97,12 @@ class AuthorizationControlsMerchantCountry(BaseModel): """The merchant countries that are blocked for authorizations on this card.""" -class AuthorizationControlsSpendingLimitMerchantCategoryCode(BaseModel): +class AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode(BaseModel): code: str """The Merchant Category Code (MCC).""" -class AuthorizationControlsSpendingLimit(BaseModel): +class AuthorizationControlsUsageMultiUseSpendingLimit(BaseModel): interval: Literal["all_time", "per_transaction", "per_day", "per_week", "per_month"] """The interval at which the spending limit is enforced. @@ -123,7 +116,7 @@ class AuthorizationControlsSpendingLimit(BaseModel): month, midnight UTC. """ - merchant_category_codes: Optional[List[AuthorizationControlsSpendingLimitMerchantCategoryCode]] = None + merchant_category_codes: Optional[List[AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode]] = None """The Merchant Category Codes (MCCs) this spending limit applies to. If not set, the limit applies to all transactions. @@ -133,12 +126,70 @@ class AuthorizationControlsSpendingLimit(BaseModel): """The maximum settlement amount permitted in the given interval.""" +class AuthorizationControlsUsageMultiUse(BaseModel): + """Controls for multi-use cards. + + Required if and only if `category` is `multi_use`. + """ + + spending_limits: Optional[List[AuthorizationControlsUsageMultiUseSpendingLimit]] = None + """Spending limits for this card. + + The most restrictive limit applies if multiple limits match. + """ + + +class AuthorizationControlsUsageSingleUseSettlementAmount(BaseModel): + """The settlement amount constraint for this single-use card.""" + + comparison: Literal["equals", "less_than_or_equals"] + """The operator used to compare the settlement amount. + + - `equals` - The settlement amount must be exactly the specified value. + - `less_than_or_equals` - The settlement amount must be less than or equal to + the specified value. + """ + + value: int + """The settlement amount value.""" + + +class AuthorizationControlsUsageSingleUse(BaseModel): + """Controls for single-use cards. + + Required if and only if `category` is `single_use`. + """ + + settlement_amount: AuthorizationControlsUsageSingleUseSettlementAmount + """The settlement amount constraint for this single-use card.""" + + +class AuthorizationControlsUsage(BaseModel): + """Controls how many times this card can be used.""" + + category: Literal["single_use", "multi_use"] + """Whether the card is for a single use or multiple uses. + + - `single_use` - The card can only be used for a single authorization. + - `multi_use` - The card can be used for multiple authorizations. + """ + + multi_use: Optional[AuthorizationControlsUsageMultiUse] = None + """Controls for multi-use cards. + + Required if and only if `category` is `multi_use`. + """ + + single_use: Optional[AuthorizationControlsUsageSingleUse] = None + """Controls for single-use cards. + + Required if and only if `category` is `single_use`. + """ + + class AuthorizationControls(BaseModel): """Controls that restrict how this card can be used.""" - maximum_authorization_count: Optional[AuthorizationControlsMaximumAuthorizationCount] = None - """Limits the number of authorizations that can be approved on this card.""" - merchant_acceptor_identifier: Optional[AuthorizationControlsMerchantAcceptorIdentifier] = None """ Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations @@ -157,11 +208,8 @@ class AuthorizationControls(BaseModel): this card. """ - spending_limits: Optional[List[AuthorizationControlsSpendingLimit]] = None - """Spending limits for this card. - - The most restrictive limit applies if multiple limits match. - """ + usage: Optional[AuthorizationControlsUsage] = None + """Controls how many times this card can be used.""" class BillingAddress(BaseModel): diff --git a/src/increase/types/card_create_params.py b/src/increase/types/card_create_params.py index 6850b806..be5832eb 100644 --- a/src/increase/types/card_create_params.py +++ b/src/increase/types/card_create_params.py @@ -8,7 +8,6 @@ __all__ = [ "CardCreateParams", "AuthorizationControls", - "AuthorizationControlsMaximumAuthorizationCount", "AuthorizationControlsMerchantAcceptorIdentifier", "AuthorizationControlsMerchantAcceptorIdentifierAllowed", "AuthorizationControlsMerchantAcceptorIdentifierBlocked", @@ -18,8 +17,12 @@ "AuthorizationControlsMerchantCountry", "AuthorizationControlsMerchantCountryAllowed", "AuthorizationControlsMerchantCountryBlocked", - "AuthorizationControlsSpendingLimit", - "AuthorizationControlsSpendingLimitMerchantCategoryCode", + "AuthorizationControlsUsage", + "AuthorizationControlsUsageMultiUse", + "AuthorizationControlsUsageMultiUseSpendingLimit", + "AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode", + "AuthorizationControlsUsageSingleUse", + "AuthorizationControlsUsageSingleUseSettlementAmount", "BillingAddress", "DigitalWallet", ] @@ -55,16 +58,6 @@ class CardCreateParams(TypedDict, total=False): """ -class AuthorizationControlsMaximumAuthorizationCount(TypedDict, total=False): - """Limits the number of authorizations that can be approved on this card.""" - - all_time: Required[int] - """ - The maximum number of authorizations that can be approved on this card over its - lifetime. - """ - - class AuthorizationControlsMerchantAcceptorIdentifierAllowed(TypedDict, total=False): identifier: Required[str] """The Merchant Acceptor ID.""" @@ -149,12 +142,12 @@ class AuthorizationControlsMerchantCountry(TypedDict, total=False): """ -class AuthorizationControlsSpendingLimitMerchantCategoryCode(TypedDict, total=False): +class AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode(TypedDict, total=False): code: Required[str] """The Merchant Category Code.""" -class AuthorizationControlsSpendingLimit(TypedDict, total=False): +class AuthorizationControlsUsageMultiUseSpendingLimit(TypedDict, total=False): interval: Required[Literal["all_time", "per_transaction", "per_day", "per_week", "per_month"]] """The interval at which the spending limit is enforced. @@ -171,19 +164,77 @@ class AuthorizationControlsSpendingLimit(TypedDict, total=False): settlement_amount: Required[int] """The maximum settlement amount permitted in the given interval.""" - merchant_category_codes: Iterable[AuthorizationControlsSpendingLimitMerchantCategoryCode] + merchant_category_codes: Iterable[AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode] """The Merchant Category Codes this spending limit applies to. If not set, the limit applies to all transactions. """ +class AuthorizationControlsUsageMultiUse(TypedDict, total=False): + """Controls for multi-use cards. + + Required if and only if `category` is `multi_use`. + """ + + spending_limits: Iterable[AuthorizationControlsUsageMultiUseSpendingLimit] + """Spending limits for this card. + + The most restrictive limit applies if multiple limits match. + """ + + +class AuthorizationControlsUsageSingleUseSettlementAmount(TypedDict, total=False): + """The settlement amount constraint for this single-use card.""" + + comparison: Required[Literal["equals", "less_than_or_equals"]] + """The operator used to compare the settlement amount. + + - `equals` - The settlement amount must be exactly the specified value. + - `less_than_or_equals` - The settlement amount must be less than or equal to + the specified value. + """ + + value: Required[int] + """The settlement amount value.""" + + +class AuthorizationControlsUsageSingleUse(TypedDict, total=False): + """Controls for single-use cards. + + Required if and only if `category` is `single_use`. + """ + + settlement_amount: Required[AuthorizationControlsUsageSingleUseSettlementAmount] + """The settlement amount constraint for this single-use card.""" + + +class AuthorizationControlsUsage(TypedDict, total=False): + """Controls how many times this card can be used.""" + + category: Required[Literal["single_use", "multi_use"]] + """Whether the card is for a single use or multiple uses. + + - `single_use` - The card can only be used for a single authorization. + - `multi_use` - The card can be used for multiple authorizations. + """ + + multi_use: AuthorizationControlsUsageMultiUse + """Controls for multi-use cards. + + Required if and only if `category` is `multi_use`. + """ + + single_use: AuthorizationControlsUsageSingleUse + """Controls for single-use cards. + + Required if and only if `category` is `single_use`. + """ + + class AuthorizationControls(TypedDict, total=False): """Controls that restrict how this card can be used.""" - maximum_authorization_count: AuthorizationControlsMaximumAuthorizationCount - """Limits the number of authorizations that can be approved on this card.""" - merchant_acceptor_identifier: AuthorizationControlsMerchantAcceptorIdentifier """ Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations @@ -202,11 +253,8 @@ class AuthorizationControls(TypedDict, total=False): this card. """ - spending_limits: Iterable[AuthorizationControlsSpendingLimit] - """Spending limits for this card. - - The most restrictive limit applies if multiple limits match. - """ + usage: AuthorizationControlsUsage + """Controls how many times this card can be used.""" class BillingAddress(TypedDict, total=False): diff --git a/src/increase/types/card_update_params.py b/src/increase/types/card_update_params.py index 8c7e904d..192fb708 100644 --- a/src/increase/types/card_update_params.py +++ b/src/increase/types/card_update_params.py @@ -8,7 +8,6 @@ __all__ = [ "CardUpdateParams", "AuthorizationControls", - "AuthorizationControlsMaximumAuthorizationCount", "AuthorizationControlsMerchantAcceptorIdentifier", "AuthorizationControlsMerchantAcceptorIdentifierAllowed", "AuthorizationControlsMerchantAcceptorIdentifierBlocked", @@ -18,8 +17,12 @@ "AuthorizationControlsMerchantCountry", "AuthorizationControlsMerchantCountryAllowed", "AuthorizationControlsMerchantCountryBlocked", - "AuthorizationControlsSpendingLimit", - "AuthorizationControlsSpendingLimitMerchantCategoryCode", + "AuthorizationControlsUsage", + "AuthorizationControlsUsageMultiUse", + "AuthorizationControlsUsageMultiUseSpendingLimit", + "AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode", + "AuthorizationControlsUsageSingleUse", + "AuthorizationControlsUsageSingleUseSettlementAmount", "BillingAddress", "DigitalWallet", ] @@ -58,16 +61,6 @@ class CardUpdateParams(TypedDict, total=False): """ -class AuthorizationControlsMaximumAuthorizationCount(TypedDict, total=False): - """Limits the number of authorizations that can be approved on this card.""" - - all_time: Required[int] - """ - The maximum number of authorizations that can be approved on this card over its - lifetime. - """ - - class AuthorizationControlsMerchantAcceptorIdentifierAllowed(TypedDict, total=False): identifier: Required[str] """The Merchant Acceptor ID.""" @@ -152,12 +145,12 @@ class AuthorizationControlsMerchantCountry(TypedDict, total=False): """ -class AuthorizationControlsSpendingLimitMerchantCategoryCode(TypedDict, total=False): +class AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode(TypedDict, total=False): code: Required[str] """The Merchant Category Code.""" -class AuthorizationControlsSpendingLimit(TypedDict, total=False): +class AuthorizationControlsUsageMultiUseSpendingLimit(TypedDict, total=False): interval: Required[Literal["all_time", "per_transaction", "per_day", "per_week", "per_month"]] """The interval at which the spending limit is enforced. @@ -174,19 +167,77 @@ class AuthorizationControlsSpendingLimit(TypedDict, total=False): settlement_amount: Required[int] """The maximum settlement amount permitted in the given interval.""" - merchant_category_codes: Iterable[AuthorizationControlsSpendingLimitMerchantCategoryCode] + merchant_category_codes: Iterable[AuthorizationControlsUsageMultiUseSpendingLimitMerchantCategoryCode] """The Merchant Category Codes this spending limit applies to. If not set, the limit applies to all transactions. """ +class AuthorizationControlsUsageMultiUse(TypedDict, total=False): + """Controls for multi-use cards. + + Required if and only if `category` is `multi_use`. + """ + + spending_limits: Iterable[AuthorizationControlsUsageMultiUseSpendingLimit] + """Spending limits for this card. + + The most restrictive limit applies if multiple limits match. + """ + + +class AuthorizationControlsUsageSingleUseSettlementAmount(TypedDict, total=False): + """The settlement amount constraint for this single-use card.""" + + comparison: Required[Literal["equals", "less_than_or_equals"]] + """The operator used to compare the settlement amount. + + - `equals` - The settlement amount must be exactly the specified value. + - `less_than_or_equals` - The settlement amount must be less than or equal to + the specified value. + """ + + value: Required[int] + """The settlement amount value.""" + + +class AuthorizationControlsUsageSingleUse(TypedDict, total=False): + """Controls for single-use cards. + + Required if and only if `category` is `single_use`. + """ + + settlement_amount: Required[AuthorizationControlsUsageSingleUseSettlementAmount] + """The settlement amount constraint for this single-use card.""" + + +class AuthorizationControlsUsage(TypedDict, total=False): + """Controls how many times this card can be used.""" + + category: Required[Literal["single_use", "multi_use"]] + """Whether the card is for a single use or multiple uses. + + - `single_use` - The card can only be used for a single authorization. + - `multi_use` - The card can be used for multiple authorizations. + """ + + multi_use: AuthorizationControlsUsageMultiUse + """Controls for multi-use cards. + + Required if and only if `category` is `multi_use`. + """ + + single_use: AuthorizationControlsUsageSingleUse + """Controls for single-use cards. + + Required if and only if `category` is `single_use`. + """ + + class AuthorizationControls(TypedDict, total=False): """Controls that restrict how this card can be used.""" - maximum_authorization_count: AuthorizationControlsMaximumAuthorizationCount - """Limits the number of authorizations that can be approved on this card.""" - merchant_acceptor_identifier: AuthorizationControlsMerchantAcceptorIdentifier """ Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations @@ -205,11 +256,8 @@ class AuthorizationControls(TypedDict, total=False): this card. """ - spending_limits: Iterable[AuthorizationControlsSpendingLimit] - """Spending limits for this card. - - The most restrictive limit applies if multiple limits match. - """ + usage: AuthorizationControlsUsage + """Controls how many times this card can be used.""" class BillingAddress(TypedDict, total=False): diff --git a/tests/api_resources/test_cards.py b/tests/api_resources/test_cards.py index e0c25e46..bfa0bf63 100644 --- a/tests/api_resources/test_cards.py +++ b/tests/api_resources/test_cards.py @@ -35,7 +35,6 @@ def test_method_create_with_all_params(self, client: Increase) -> None: card = client.cards.create( account_id="account_in71c4amph0vgo2qllky", authorization_controls={ - "maximum_authorization_count": {"all_time": 0}, "merchant_acceptor_identifier": { "allowed": [{"identifier": "x"}], "blocked": [{"identifier": "x"}], @@ -48,13 +47,24 @@ def test_method_create_with_all_params(self, client: Increase) -> None: "allowed": [{"country": "xx"}], "blocked": [{"country": "xx"}], }, - "spending_limits": [ - { - "interval": "all_time", - "settlement_amount": 0, - "merchant_category_codes": [{"code": "x"}], - } - ], + "usage": { + "category": "single_use", + "multi_use": { + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ] + }, + "single_use": { + "settlement_amount": { + "comparison": "equals", + "value": 0, + } + }, + }, }, billing_address={ "city": "x", @@ -147,7 +157,6 @@ def test_method_update_with_all_params(self, client: Increase) -> None: card = client.cards.update( card_id="card_oubs0hwk5rn6knuecxg2", authorization_controls={ - "maximum_authorization_count": {"all_time": 0}, "merchant_acceptor_identifier": { "allowed": [{"identifier": "x"}], "blocked": [{"identifier": "x"}], @@ -160,13 +169,24 @@ def test_method_update_with_all_params(self, client: Increase) -> None: "allowed": [{"country": "xx"}], "blocked": [{"country": "xx"}], }, - "spending_limits": [ - { - "interval": "all_time", - "settlement_amount": 0, - "merchant_category_codes": [{"code": "x"}], - } - ], + "usage": { + "category": "single_use", + "multi_use": { + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ] + }, + "single_use": { + "settlement_amount": { + "comparison": "equals", + "value": 0, + } + }, + }, }, billing_address={ "city": "x", @@ -403,7 +423,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) card = await async_client.cards.create( account_id="account_in71c4amph0vgo2qllky", authorization_controls={ - "maximum_authorization_count": {"all_time": 0}, "merchant_acceptor_identifier": { "allowed": [{"identifier": "x"}], "blocked": [{"identifier": "x"}], @@ -416,13 +435,24 @@ async def test_method_create_with_all_params(self, async_client: AsyncIncrease) "allowed": [{"country": "xx"}], "blocked": [{"country": "xx"}], }, - "spending_limits": [ - { - "interval": "all_time", - "settlement_amount": 0, - "merchant_category_codes": [{"code": "x"}], - } - ], + "usage": { + "category": "single_use", + "multi_use": { + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ] + }, + "single_use": { + "settlement_amount": { + "comparison": "equals", + "value": 0, + } + }, + }, }, billing_address={ "city": "x", @@ -515,7 +545,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncIncrease) card = await async_client.cards.update( card_id="card_oubs0hwk5rn6knuecxg2", authorization_controls={ - "maximum_authorization_count": {"all_time": 0}, "merchant_acceptor_identifier": { "allowed": [{"identifier": "x"}], "blocked": [{"identifier": "x"}], @@ -528,13 +557,24 @@ async def test_method_update_with_all_params(self, async_client: AsyncIncrease) "allowed": [{"country": "xx"}], "blocked": [{"country": "xx"}], }, - "spending_limits": [ - { - "interval": "all_time", - "settlement_amount": 0, - "merchant_category_codes": [{"code": "x"}], - } - ], + "usage": { + "category": "single_use", + "multi_use": { + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ] + }, + "single_use": { + "settlement_amount": { + "comparison": "equals", + "value": 0, + } + }, + }, }, billing_address={ "city": "x", From 2591ff8b287d3c52c29e6c7ba990bce9d2bcf3e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 22:44:56 +0000 Subject: [PATCH 2/2] release: 0.472.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 82f99026..bdceeb24 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.471.0" + ".": "0.472.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e80aec97..06ec5eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.472.0 (2026-04-06) + +Full Changelog: [v0.471.0...v0.472.0](https://github.com/Increase/increase-python/compare/v0.471.0...v0.472.0) + +### Features + +* **api:** api update ([b71af2d](https://github.com/Increase/increase-python/commit/b71af2d0eeeccb9f66507bfc81af83d714632a0a)) + ## 0.471.0 (2026-04-04) Full Changelog: [v0.470.0...v0.471.0](https://github.com/Increase/increase-python/compare/v0.470.0...v0.471.0) diff --git a/pyproject.toml b/pyproject.toml index 20053f51..1aeced9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.471.0" +version = "0.472.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index 5aca77c1..d22cb6b7 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.471.0" # x-release-please-version +__version__ = "0.472.0" # x-release-please-version