diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4663cfd4..aaa9928e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.468.0" + ".": "0.469.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 3e05b57f..5c2b8655 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-e3103e9bb8480e11581841c322e0bd0255b64413d401873c96cd00a3e6d6c3f7.yml -openapi_spec_hash: 962e1efe27066cf84b405a6695dd8288 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-31046e3fe86098c429a87dc861cf42dae0252314abf90021a804e748f9c16417.yml +openapi_spec_hash: 78fe78704879172326e842c27ee09a3a config_hash: 4945e03affdf289484733306e4797f81 diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c35a62..04fc491a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.469.0 (2026-04-03) + +Full Changelog: [v0.468.0...v0.469.0](https://github.com/Increase/increase-python/compare/v0.468.0...v0.469.0) + +### Features + +* **api:** api update ([4fe0d7e](https://github.com/Increase/increase-python/commit/4fe0d7e417b0d5bdcceb6c9322e25c492fc80d08)) + ## 0.468.0 (2026-04-02) Full Changelog: [v0.467.0...v0.468.0](https://github.com/Increase/increase-python/compare/v0.467.0...v0.468.0) diff --git a/pyproject.toml b/pyproject.toml index 071f67a6..dbc31a66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.468.0" +version = "0.469.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 abf42cac..ea3b2586 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.468.0" # x-release-please-version +__version__ = "0.469.0" # x-release-please-version diff --git a/src/increase/resources/cards.py b/src/increase/resources/cards.py index 572153c3..e39ed522 100644 --- a/src/increase/resources/cards.py +++ b/src/increase/resources/cards.py @@ -56,6 +56,7 @@ def create( self, *, account_id: str, + authorization_controls: card_create_params.AuthorizationControls | Omit = omit, billing_address: card_create_params.BillingAddress | Omit = omit, description: str | Omit = omit, digital_wallet: card_create_params.DigitalWallet | Omit = omit, @@ -74,6 +75,8 @@ def create( Args: account_id: The Account the card should belong to. + authorization_controls: Controls that restrict how this card can be used. + billing_address: The card's billing address. description: The description you choose to give the card. @@ -102,6 +105,7 @@ def create( body=maybe_transform( { "account_id": account_id, + "authorization_controls": authorization_controls, "billing_address": billing_address, "description": description, "digital_wallet": digital_wallet, @@ -158,6 +162,7 @@ def update( self, card_id: str, *, + authorization_controls: card_update_params.AuthorizationControls | Omit = omit, billing_address: card_update_params.BillingAddress | Omit = omit, description: str | Omit = omit, digital_wallet: card_update_params.DigitalWallet | Omit = omit, @@ -177,6 +182,8 @@ def update( Args: card_id: The card identifier. + authorization_controls: Controls that restrict how this card can be used. + billing_address: The card's updated billing address. description: The description you choose to give the card. @@ -210,6 +217,7 @@ def update( path_template("/cards/{card_id}", card_id=card_id), body=maybe_transform( { + "authorization_controls": authorization_controls, "billing_address": billing_address, "description": description, "digital_wallet": digital_wallet, @@ -450,6 +458,7 @@ async def create( self, *, account_id: str, + authorization_controls: card_create_params.AuthorizationControls | Omit = omit, billing_address: card_create_params.BillingAddress | Omit = omit, description: str | Omit = omit, digital_wallet: card_create_params.DigitalWallet | Omit = omit, @@ -468,6 +477,8 @@ async def create( Args: account_id: The Account the card should belong to. + authorization_controls: Controls that restrict how this card can be used. + billing_address: The card's billing address. description: The description you choose to give the card. @@ -496,6 +507,7 @@ async def create( body=await async_maybe_transform( { "account_id": account_id, + "authorization_controls": authorization_controls, "billing_address": billing_address, "description": description, "digital_wallet": digital_wallet, @@ -552,6 +564,7 @@ async def update( self, card_id: str, *, + authorization_controls: card_update_params.AuthorizationControls | Omit = omit, billing_address: card_update_params.BillingAddress | Omit = omit, description: str | Omit = omit, digital_wallet: card_update_params.DigitalWallet | Omit = omit, @@ -571,6 +584,8 @@ async def update( Args: card_id: The card identifier. + authorization_controls: Controls that restrict how this card can be used. + billing_address: The card's updated billing address. description: The description you choose to give the card. @@ -604,6 +619,7 @@ async def update( path_template("/cards/{card_id}", card_id=card_id), body=await async_maybe_transform( { + "authorization_controls": authorization_controls, "billing_address": billing_address, "description": description, "digital_wallet": digital_wallet, diff --git a/src/increase/types/card.py b/src/increase/types/card.py index b3e8186e..6c72310d 100644 --- a/src/increase/types/card.py +++ b/src/increase/types/card.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, Dict, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -8,7 +8,160 @@ from .._models import BaseModel -__all__ = ["Card", "BillingAddress", "DigitalWallet"] +__all__ = [ + "Card", + "AuthorizationControls", + "AuthorizationControlsMaximumAuthorizationCount", + "AuthorizationControlsMerchantAcceptorIdentifier", + "AuthorizationControlsMerchantAcceptorIdentifierAllowed", + "AuthorizationControlsMerchantAcceptorIdentifierBlocked", + "AuthorizationControlsMerchantCategoryCode", + "AuthorizationControlsMerchantCategoryCodeAllowed", + "AuthorizationControlsMerchantCategoryCodeBlocked", + "AuthorizationControlsMerchantCountry", + "AuthorizationControlsMerchantCountryAllowed", + "AuthorizationControlsMerchantCountryBlocked", + "AuthorizationControlsSpendingLimit", + "AuthorizationControlsSpendingLimitMerchantCategoryCode", + "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.""" + + +class AuthorizationControlsMerchantAcceptorIdentifierBlocked(BaseModel): + identifier: str + """The Merchant Acceptor ID.""" + + +class AuthorizationControlsMerchantAcceptorIdentifier(BaseModel): + """ + Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations on this card. + """ + + allowed: Optional[List[AuthorizationControlsMerchantAcceptorIdentifierAllowed]] = None + """The Merchant Acceptor IDs that are allowed for authorizations on this card.""" + + blocked: Optional[List[AuthorizationControlsMerchantAcceptorIdentifierBlocked]] = None + """The Merchant Acceptor IDs that are blocked for authorizations on this card.""" + + +class AuthorizationControlsMerchantCategoryCodeAllowed(BaseModel): + code: str + """The Merchant Category Code (MCC).""" + + +class AuthorizationControlsMerchantCategoryCodeBlocked(BaseModel): + code: str + """The Merchant Category Code (MCC).""" + + +class AuthorizationControlsMerchantCategoryCode(BaseModel): + """ + Restricts which Merchant Category Codes are allowed or blocked for authorizations on this card. + """ + + allowed: Optional[List[AuthorizationControlsMerchantCategoryCodeAllowed]] = None + """The Merchant Category Codes that are allowed for authorizations on this card.""" + + blocked: Optional[List[AuthorizationControlsMerchantCategoryCodeBlocked]] = None + """The Merchant Category Codes that are blocked for authorizations on this card.""" + + +class AuthorizationControlsMerchantCountryAllowed(BaseModel): + country: str + """The ISO 3166-1 alpha-2 country code.""" + + +class AuthorizationControlsMerchantCountryBlocked(BaseModel): + country: str + """The ISO 3166-1 alpha-2 country code.""" + + +class AuthorizationControlsMerchantCountry(BaseModel): + """ + Restricts which merchant countries are allowed or blocked for authorizations on this card. + """ + + allowed: Optional[List[AuthorizationControlsMerchantCountryAllowed]] = None + """The merchant countries that are allowed for authorizations on this card.""" + + blocked: Optional[List[AuthorizationControlsMerchantCountryBlocked]] = None + """The merchant countries that are blocked for authorizations on this card.""" + + +class AuthorizationControlsSpendingLimitMerchantCategoryCode(BaseModel): + code: str + """The Merchant Category Code (MCC).""" + + +class AuthorizationControlsSpendingLimit(BaseModel): + interval: Literal["all_time", "per_transaction", "per_day", "per_week", "per_month"] + """The interval at which the spending limit is enforced. + + - `all_time` - The spending limit applies over the lifetime of the card. + - `per_transaction` - The spending limit applies per transaction. + - `per_day` - The spending limit applies per day. Resets nightly at midnight + UTC. + - `per_week` - The spending limit applies per week. Resets weekly on Mondays at + midnight UTC. + - `per_month` - The spending limit applies per month. Resets on the first of the + month, midnight UTC. + """ + + merchant_category_codes: Optional[List[AuthorizationControlsSpendingLimitMerchantCategoryCode]] = None + """The Merchant Category Codes (MCCs) this spending limit applies to. + + If not set, the limit applies to all transactions. + """ + + settlement_amount: int + """The maximum settlement amount permitted in the given interval.""" + + +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 + on this card. + """ + + merchant_category_code: Optional[AuthorizationControlsMerchantCategoryCode] = None + """ + Restricts which Merchant Category Codes are allowed or blocked for + authorizations on this card. + """ + + merchant_country: Optional[AuthorizationControlsMerchantCountry] = None + """ + Restricts which merchant countries are allowed or blocked for authorizations on + this card. + """ + + spending_limits: Optional[List[AuthorizationControlsSpendingLimit]] = None + """Spending limits for this card. + + The most restrictive limit is applied if multiple limits match. + """ class BillingAddress(BaseModel): @@ -66,6 +219,9 @@ class Card(BaseModel): account_id: str """The identifier for the account this card belongs to.""" + authorization_controls: Optional[AuthorizationControls] = None + """Controls that restrict how this card can be used.""" + billing_address: BillingAddress """The Card's billing address.""" diff --git a/src/increase/types/card_create_params.py b/src/increase/types/card_create_params.py index 3a3f24cf..062d7df0 100644 --- a/src/increase/types/card_create_params.py +++ b/src/increase/types/card_create_params.py @@ -2,15 +2,36 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict - -__all__ = ["CardCreateParams", "BillingAddress", "DigitalWallet"] +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = [ + "CardCreateParams", + "AuthorizationControls", + "AuthorizationControlsMaximumAuthorizationCount", + "AuthorizationControlsMerchantAcceptorIdentifier", + "AuthorizationControlsMerchantAcceptorIdentifierAllowed", + "AuthorizationControlsMerchantAcceptorIdentifierBlocked", + "AuthorizationControlsMerchantCategoryCode", + "AuthorizationControlsMerchantCategoryCodeAllowed", + "AuthorizationControlsMerchantCategoryCodeBlocked", + "AuthorizationControlsMerchantCountry", + "AuthorizationControlsMerchantCountryAllowed", + "AuthorizationControlsMerchantCountryBlocked", + "AuthorizationControlsSpendingLimit", + "AuthorizationControlsSpendingLimitMerchantCategoryCode", + "BillingAddress", + "DigitalWallet", +] class CardCreateParams(TypedDict, total=False): account_id: Required[str] """The Account the card should belong to.""" + authorization_controls: AuthorizationControls + """Controls that restrict how this card can be used.""" + billing_address: BillingAddress """The card's billing address.""" @@ -34,6 +55,160 @@ 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.""" + + +class AuthorizationControlsMerchantAcceptorIdentifierBlocked(TypedDict, total=False): + identifier: Required[str] + """The Merchant Acceptor ID.""" + + +class AuthorizationControlsMerchantAcceptorIdentifier(TypedDict, total=False): + """ + Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations on this card. + """ + + allowed: Iterable[AuthorizationControlsMerchantAcceptorIdentifierAllowed] + """The Merchant Acceptor IDs that are allowed for authorizations on this card. + + Authorizations with Merchant Acceptor IDs not in this list will be declined. + """ + + blocked: Iterable[AuthorizationControlsMerchantAcceptorIdentifierBlocked] + """The Merchant Acceptor IDs that are blocked for authorizations on this card. + + Authorizations with Merchant Acceptor IDs in this list will be declined. + """ + + +class AuthorizationControlsMerchantCategoryCodeAllowed(TypedDict, total=False): + code: Required[str] + """The Merchant Category Code.""" + + +class AuthorizationControlsMerchantCategoryCodeBlocked(TypedDict, total=False): + code: Required[str] + """The Merchant Category Code.""" + + +class AuthorizationControlsMerchantCategoryCode(TypedDict, total=False): + """ + Restricts which Merchant Category Codes are allowed or blocked for authorizations on this card. + """ + + allowed: Iterable[AuthorizationControlsMerchantCategoryCodeAllowed] + """The Merchant Category Codes that are allowed for authorizations on this card. + + Authorizations with Merchant Category Codes not in this list will be declined. + """ + + blocked: Iterable[AuthorizationControlsMerchantCategoryCodeBlocked] + """The Merchant Category Codes that are blocked for authorizations on this card. + + Authorizations with Merchant Category Codes in this list will be declined. + """ + + +class AuthorizationControlsMerchantCountryAllowed(TypedDict, total=False): + country: Required[str] + """The ISO 3166-1 alpha-2 country code.""" + + +class AuthorizationControlsMerchantCountryBlocked(TypedDict, total=False): + country: Required[str] + """The ISO 3166-1 alpha-2 country code.""" + + +class AuthorizationControlsMerchantCountry(TypedDict, total=False): + """ + Restricts which merchant countries are allowed or blocked for authorizations on this card. + """ + + allowed: Iterable[AuthorizationControlsMerchantCountryAllowed] + """The merchant countries that are allowed for authorizations on this card. + + Authorizations with merchant countries not in this list will be declined. + """ + + blocked: Iterable[AuthorizationControlsMerchantCountryBlocked] + """The merchant countries that are blocked for authorizations on this card. + + Authorizations with merchant countries in this list will be declined. + """ + + +class AuthorizationControlsSpendingLimitMerchantCategoryCode(TypedDict, total=False): + code: Required[str] + """The Merchant Category Code.""" + + +class AuthorizationControlsSpendingLimit(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. + + - `all_time` - The spending limit applies over the lifetime of the card. + - `per_transaction` - The spending limit applies per transaction. + - `per_day` - The spending limit applies per day. Resets nightly at midnight + UTC. + - `per_week` - The spending limit applies per week. Resets weekly on Mondays at + midnight UTC. + - `per_month` - The spending limit applies per month. Resets on the first of the + month, midnight UTC. + """ + + settlement_amount: Required[int] + """The maximum settlement amount permitted in the given interval.""" + + merchant_category_codes: Iterable[AuthorizationControlsSpendingLimitMerchantCategoryCode] + """The Merchant Category Codes this spending limit applies to. + + If not set, the limit applies to all transactions. + """ + + +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 + on this card. + """ + + merchant_category_code: AuthorizationControlsMerchantCategoryCode + """ + Restricts which Merchant Category Codes are allowed or blocked for + authorizations on this card. + """ + + merchant_country: AuthorizationControlsMerchantCountry + """ + Restricts which merchant countries are allowed or blocked for authorizations on + this card. + """ + + spending_limits: Iterable[AuthorizationControlsSpendingLimit] + """Spending limits for this card. + + The most restrictive limit is applied if multiple limits match. + """ + + class BillingAddress(TypedDict, total=False): """The card's billing address.""" diff --git a/src/increase/types/card_update_params.py b/src/increase/types/card_update_params.py index 6fb58153..fae5b153 100644 --- a/src/increase/types/card_update_params.py +++ b/src/increase/types/card_update_params.py @@ -2,12 +2,33 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["CardUpdateParams", "BillingAddress", "DigitalWallet"] +__all__ = [ + "CardUpdateParams", + "AuthorizationControls", + "AuthorizationControlsMaximumAuthorizationCount", + "AuthorizationControlsMerchantAcceptorIdentifier", + "AuthorizationControlsMerchantAcceptorIdentifierAllowed", + "AuthorizationControlsMerchantAcceptorIdentifierBlocked", + "AuthorizationControlsMerchantCategoryCode", + "AuthorizationControlsMerchantCategoryCodeAllowed", + "AuthorizationControlsMerchantCategoryCodeBlocked", + "AuthorizationControlsMerchantCountry", + "AuthorizationControlsMerchantCountryAllowed", + "AuthorizationControlsMerchantCountryBlocked", + "AuthorizationControlsSpendingLimit", + "AuthorizationControlsSpendingLimitMerchantCategoryCode", + "BillingAddress", + "DigitalWallet", +] class CardUpdateParams(TypedDict, total=False): + authorization_controls: AuthorizationControls + """Controls that restrict how this card can be used.""" + billing_address: BillingAddress """The card's updated billing address.""" @@ -37,6 +58,160 @@ 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.""" + + +class AuthorizationControlsMerchantAcceptorIdentifierBlocked(TypedDict, total=False): + identifier: Required[str] + """The Merchant Acceptor ID.""" + + +class AuthorizationControlsMerchantAcceptorIdentifier(TypedDict, total=False): + """ + Restricts which Merchant Acceptor IDs are allowed or blocked for authorizations on this card. + """ + + allowed: Iterable[AuthorizationControlsMerchantAcceptorIdentifierAllowed] + """The Merchant Acceptor IDs that are allowed for authorizations on this card. + + Authorizations with Merchant Acceptor IDs not in this list will be declined. + """ + + blocked: Iterable[AuthorizationControlsMerchantAcceptorIdentifierBlocked] + """The Merchant Acceptor IDs that are blocked for authorizations on this card. + + Authorizations with Merchant Acceptor IDs in this list will be declined. + """ + + +class AuthorizationControlsMerchantCategoryCodeAllowed(TypedDict, total=False): + code: Required[str] + """The Merchant Category Code.""" + + +class AuthorizationControlsMerchantCategoryCodeBlocked(TypedDict, total=False): + code: Required[str] + """The Merchant Category Code.""" + + +class AuthorizationControlsMerchantCategoryCode(TypedDict, total=False): + """ + Restricts which Merchant Category Codes are allowed or blocked for authorizations on this card. + """ + + allowed: Iterable[AuthorizationControlsMerchantCategoryCodeAllowed] + """The Merchant Category Codes that are allowed for authorizations on this card. + + Authorizations with Merchant Category Codes not in this list will be declined. + """ + + blocked: Iterable[AuthorizationControlsMerchantCategoryCodeBlocked] + """The Merchant Category Codes that are blocked for authorizations on this card. + + Authorizations with Merchant Category Codes in this list will be declined. + """ + + +class AuthorizationControlsMerchantCountryAllowed(TypedDict, total=False): + country: Required[str] + """The ISO 3166-1 alpha-2 country code.""" + + +class AuthorizationControlsMerchantCountryBlocked(TypedDict, total=False): + country: Required[str] + """The ISO 3166-1 alpha-2 country code.""" + + +class AuthorizationControlsMerchantCountry(TypedDict, total=False): + """ + Restricts which merchant countries are allowed or blocked for authorizations on this card. + """ + + allowed: Iterable[AuthorizationControlsMerchantCountryAllowed] + """The merchant countries that are allowed for authorizations on this card. + + Authorizations with merchant countries not in this list will be declined. + """ + + blocked: Iterable[AuthorizationControlsMerchantCountryBlocked] + """The merchant countries that are blocked for authorizations on this card. + + Authorizations with merchant countries in this list will be declined. + """ + + +class AuthorizationControlsSpendingLimitMerchantCategoryCode(TypedDict, total=False): + code: Required[str] + """The Merchant Category Code.""" + + +class AuthorizationControlsSpendingLimit(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. + + - `all_time` - The spending limit applies over the lifetime of the card. + - `per_transaction` - The spending limit applies per transaction. + - `per_day` - The spending limit applies per day. Resets nightly at midnight + UTC. + - `per_week` - The spending limit applies per week. Resets weekly on Mondays at + midnight UTC. + - `per_month` - The spending limit applies per month. Resets on the first of the + month, midnight UTC. + """ + + settlement_amount: Required[int] + """The maximum settlement amount permitted in the given interval.""" + + merchant_category_codes: Iterable[AuthorizationControlsSpendingLimitMerchantCategoryCode] + """The Merchant Category Codes this spending limit applies to. + + If not set, the limit applies to all transactions. + """ + + +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 + on this card. + """ + + merchant_category_code: AuthorizationControlsMerchantCategoryCode + """ + Restricts which Merchant Category Codes are allowed or blocked for + authorizations on this card. + """ + + merchant_country: AuthorizationControlsMerchantCountry + """ + Restricts which merchant countries are allowed or blocked for authorizations on + this card. + """ + + spending_limits: Iterable[AuthorizationControlsSpendingLimit] + """Spending limits for this card. + + The most restrictive limit is applied if multiple limits match. + """ + + class BillingAddress(TypedDict, total=False): """The card's updated billing address.""" diff --git a/tests/api_resources/test_cards.py b/tests/api_resources/test_cards.py index ac1a9a3a..e0c25e46 100644 --- a/tests/api_resources/test_cards.py +++ b/tests/api_resources/test_cards.py @@ -34,6 +34,28 @@ def test_method_create(self, client: Increase) -> None: 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"}], + }, + "merchant_category_code": { + "allowed": [{"code": "xxxx"}], + "blocked": [{"code": "xxxx"}], + }, + "merchant_country": { + "allowed": [{"country": "xx"}], + "blocked": [{"country": "xx"}], + }, + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ], + }, billing_address={ "city": "x", "line1": "x", @@ -124,6 +146,28 @@ def test_method_update(self, client: Increase) -> None: 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"}], + }, + "merchant_category_code": { + "allowed": [{"code": "xxxx"}], + "blocked": [{"code": "xxxx"}], + }, + "merchant_country": { + "allowed": [{"country": "xx"}], + "blocked": [{"country": "xx"}], + }, + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ], + }, billing_address={ "city": "x", "line1": "x", @@ -358,6 +402,28 @@ async def test_method_create(self, async_client: AsyncIncrease) -> None: async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: 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"}], + }, + "merchant_category_code": { + "allowed": [{"code": "xxxx"}], + "blocked": [{"code": "xxxx"}], + }, + "merchant_country": { + "allowed": [{"country": "xx"}], + "blocked": [{"country": "xx"}], + }, + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ], + }, billing_address={ "city": "x", "line1": "x", @@ -448,6 +514,28 @@ async def test_method_update(self, async_client: AsyncIncrease) -> None: async def test_method_update_with_all_params(self, async_client: AsyncIncrease) -> None: 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"}], + }, + "merchant_category_code": { + "allowed": [{"code": "xxxx"}], + "blocked": [{"code": "xxxx"}], + }, + "merchant_country": { + "allowed": [{"country": "xx"}], + "blocked": [{"country": "xx"}], + }, + "spending_limits": [ + { + "interval": "all_time", + "settlement_amount": 0, + "merchant_category_codes": [{"code": "x"}], + } + ], + }, billing_address={ "city": "x", "line1": "x",