Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 254
openapi_spec_hash: 55fb271eb29805e8a49ed72fb5ed8843
config_hash: f0e1844d06c76a9e145f7986d993dda6
configured_endpoints: 255
openapi_spec_hash: ac38083f7c2804d34c4eaa265e21dbb5
config_hash: de151ebd21a0bd391662389b310a8f49
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Methods:
- <code title="post /cards/{card_id}/create_details_iframe">client.cards.<a href="./src/increase/resources/cards.py">create_details_iframe</a>(card_id, \*\*<a href="src/increase/types/card_create_details_iframe_params.py">params</a>) -> <a href="./src/increase/types/card_iframe_url.py">CardIframeURL</a></code>
- <code title="post /cards/{card_id}/create_details_token">client.cards.<a href="./src/increase/resources/cards.py">create_details_token</a>(card_id) -> <a href="./src/increase/types/card_details_token.py">CardDetailsToken</a></code>
- <code title="get /cards/{card_id}/details">client.cards.<a href="./src/increase/resources/cards.py">details</a>(card_id) -> <a href="./src/increase/types/card_details.py">CardDetails</a></code>
- <code title="post /cards/{card_id}/renew">client.cards.<a href="./src/increase/resources/cards.py">renew</a>(card_id) -> <a href="./src/increase/types/card.py">Card</a></code>
- <code title="post /cards/{card_id}/update_pin">client.cards.<a href="./src/increase/resources/cards.py">update_pin</a>(card_id, \*\*<a href="src/increase/types/card_update_pin_params.py">params</a>) -> <a href="./src/increase/types/card_details.py">CardDetails</a></code>

# CardPayments
Expand Down
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions src/increase/resources/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,53 @@ def details(
cast_to=CardDetails,
)

def renew(
self,
card_id: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
idempotency_key: str | None = None,
) -> Card:
"""Renew a Card in place.

The Card keeps its identifier, card number, PIN, and
Physical Cards, and receives a new expiration date in the current month four
years from now along with a new verification code, which the Card's details will
return afterwards. Physical Cards that have already shipped keep working until
they are canceled.

Args:
card_id: The identifier of the Card to renew.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return self._post(
path_template("/cards/{card_id}/renew", card_id=card_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=Card,
)

def update_pin(
self,
card_id: str,
Expand Down Expand Up @@ -894,6 +941,53 @@ async def details(
cast_to=CardDetails,
)

async def renew(
self,
card_id: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
idempotency_key: str | None = None,
) -> Card:
"""Renew a Card in place.

The Card keeps its identifier, card number, PIN, and
Physical Cards, and receives a new expiration date in the current month four
years from now along with a new verification code, which the Card's details will
return afterwards. Physical Cards that have already shipped keep working until
they are canceled.

Args:
card_id: The identifier of the Card to renew.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds

idempotency_key: Specify a custom idempotency key for this request
"""
if not card_id:
raise ValueError(f"Expected a non-empty value for `card_id` but received {card_id!r}")
return await self._post(
path_template("/cards/{card_id}/renew", card_id=card_id),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=Card,
)

async def update_pin(
self,
card_id: str,
Expand Down Expand Up @@ -966,6 +1060,9 @@ def __init__(self, cards: CardsResource) -> None:
self.details = to_raw_response_wrapper(
cards.details,
)
self.renew = to_raw_response_wrapper(
cards.renew,
)
self.update_pin = to_raw_response_wrapper(
cards.update_pin,
)
Expand Down Expand Up @@ -996,6 +1093,9 @@ def __init__(self, cards: AsyncCardsResource) -> None:
self.details = async_to_raw_response_wrapper(
cards.details,
)
self.renew = async_to_raw_response_wrapper(
cards.renew,
)
self.update_pin = async_to_raw_response_wrapper(
cards.update_pin,
)
Expand Down Expand Up @@ -1026,6 +1126,9 @@ def __init__(self, cards: CardsResource) -> None:
self.details = to_streamed_response_wrapper(
cards.details,
)
self.renew = to_streamed_response_wrapper(
cards.renew,
)
self.update_pin = to_streamed_response_wrapper(
cards.update_pin,
)
Expand Down Expand Up @@ -1056,6 +1159,9 @@ def __init__(self, cards: AsyncCardsResource) -> None:
self.details = async_to_streamed_response_wrapper(
cards.details,
)
self.renew = async_to_streamed_response_wrapper(
cards.renew,
)
self.update_pin = async_to_streamed_response_wrapper(
cards.update_pin,
)
8 changes: 4 additions & 4 deletions src/increase/resources/digital_card_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncPage[DigitalCardProfile]:
"""
List Card Profiles
List Digital Card Profiles

Args:
cursor: Return the page of entries after this one.
Expand Down Expand Up @@ -292,7 +292,7 @@ def clone(
idempotency_key: str | None = None,
) -> DigitalCardProfile:
"""
Clones a Digital Card Profile
Clone a Digital Card Profile

Args:
digital_card_profile_id: The identifier of the Digital Card Profile to clone.
Expand Down Expand Up @@ -513,7 +513,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[DigitalCardProfile, AsyncPage[DigitalCardProfile]]:
"""
List Card Profiles
List Digital Card Profiles

Args:
cursor: Return the page of entries after this one.
Expand Down Expand Up @@ -626,7 +626,7 @@ async def clone(
idempotency_key: str | None = None,
) -> DigitalCardProfile:
"""
Clones a Digital Card Profile
Clone a Digital Card Profile

Args:
digital_card_profile_id: The identifier of the Digital Card Profile to clone.
Expand Down
14 changes: 10 additions & 4 deletions src/increase/resources/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@ def retrieve(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> File:
"""
Retrieve a File
"""Fetch metadata about a File, like its `purpose` and MIME type.

To access the
content, use the [Get File contents](/documentation/api/files#get-file-contents)
API.

Args:
file_id: The identifier of the File.
Expand Down Expand Up @@ -474,8 +477,11 @@ async def retrieve(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> File:
"""
Retrieve a File
"""Fetch metadata about a File, like its `purpose` and MIME type.

To access the
content, use the [Get File contents](/documentation/api/files#get-file-contents)
API.

Args:
file_id: The identifier of the File.
Expand Down
8 changes: 4 additions & 4 deletions src/increase/resources/intrafi_account_enrollments.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create(
idempotency_key: str | None = None,
) -> IntrafiAccountEnrollment:
"""
Enroll an account in the IntraFi deposit sweep network
Enroll an Account in the IntraFi deposit sweep network

Args:
account_id: The identifier for the account to be added to IntraFi.
Expand Down Expand Up @@ -208,7 +208,7 @@ def unenroll(
idempotency_key: str | None = None,
) -> IntrafiAccountEnrollment:
"""
Unenroll an account from IntraFi
Unenroll an Account from IntraFi

Args:
intrafi_account_enrollment_id: The Identifier of the IntraFi Account Enrollment to remove from IntraFi.
Expand Down Expand Up @@ -277,7 +277,7 @@ async def create(
idempotency_key: str | None = None,
) -> IntrafiAccountEnrollment:
"""
Enroll an account in the IntraFi deposit sweep network
Enroll an Account in the IntraFi deposit sweep network

Args:
account_id: The identifier for the account to be added to IntraFi.
Expand Down Expand Up @@ -429,7 +429,7 @@ async def unenroll(
idempotency_key: str | None = None,
) -> IntrafiAccountEnrollment:
"""
Unenroll an account from IntraFi
Unenroll an Account from IntraFi

Args:
intrafi_account_enrollment_id: The Identifier of the IntraFi Account Enrollment to remove from IntraFi.
Expand Down
4 changes: 2 additions & 2 deletions src/increase/resources/physical_card_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PhysicalCardProfile:
"""
Retrieve a Card Profile
Retrieve a Physical Card Profile

Args:
physical_card_profile_id: The identifier of the Card Profile.
Expand Down Expand Up @@ -443,7 +443,7 @@ async def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PhysicalCardProfile:
"""
Retrieve a Card Profile
Retrieve a Physical Card Profile

Args:
physical_card_profile_id: The identifier of the Card Profile.
Expand Down
8 changes: 4 additions & 4 deletions src/increase/resources/supplemental_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create(
idempotency_key: str | None = None,
) -> EntitySupplementalDocument:
"""
Create a supplemental document for an Entity
Create a Supplemental Document

Args:
entity_id: The identifier of the Entity to associate with the supplemental document.
Expand Down Expand Up @@ -107,7 +107,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncPage[EntitySupplementalDocument]:
"""
List Entity Supplemental Document Submissions
List Supplemental Documents

Args:
entity_id: The identifier of the Entity to list supplemental documents for.
Expand Down Expand Up @@ -188,7 +188,7 @@ async def create(
idempotency_key: str | None = None,
) -> EntitySupplementalDocument:
"""
Create a supplemental document for an Entity
Create a Supplemental Document

Args:
entity_id: The identifier of the Entity to associate with the supplemental document.
Expand Down Expand Up @@ -239,7 +239,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[EntitySupplementalDocument, AsyncPage[EntitySupplementalDocument]]:
"""
List Entity Supplemental Document Submissions
List Supplemental Documents

Args:
entity_id: The identifier of the Entity to list supplemental documents for.
Expand Down
10 changes: 6 additions & 4 deletions src/increase/types/account_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@ class AccountStatement(BaseModel):
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the end
of the period the Account Statement covers. The statement covers all
transactions up to, but not including this timestamp. Usually, this is the
beginning of the following month.
transactions up to, but not including this timestamp. Statement periods are
measured in UTC days, so this is usually midnight UTC on the first day of the
following month.
"""

statement_period_start: datetime
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time representing the
start of the period the Account Statement covers. This is the first moment of
the statement period and is inclusive. Usually, this is the beginning of the
month this statement covers.
the statement period and is inclusive. Statement periods are measured in UTC
days, so this is usually midnight UTC on the first day of the month this
statement covers.
"""

type: Literal["account_statement"]
Expand Down
24 changes: 24 additions & 0 deletions src/increase/types/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"BillingAddress",
"CardholderName",
"DigitalWallet",
"Renewal",
]


Expand Down Expand Up @@ -284,6 +285,23 @@ class DigitalWallet(BaseModel):
"""


class Renewal(BaseModel):
expiration_month: int
"""
The month the Card expired in before this renewal, in M format (e.g., August is
8).
"""

expiration_year: int
"""The year the Card expired in before this renewal, in YYYY format (e.g., 2025)."""

renewed_at: datetime
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
the Card was renewed.
"""


class Card(BaseModel):
"""Cards may operate on credit, debit, or prepaid BINs.

Expand Down Expand Up @@ -348,6 +366,12 @@ class Card(BaseModel):
last4: str
"""The last 4 digits of the Card's Primary Account Number."""

renewals: List[Renewal]
"""Completed renewals of this Card, sorted by `renewed_at` in ascending order.

Each renewal records the expiration date the Card had before it was renewed.
"""

status: Literal["active", "disabled", "canceled"]
"""This indicates if payments can be made with the card.

Expand Down
Loading
Loading