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
18 changes: 16 additions & 2 deletions src/increase/resources/exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def __init__(self, client: Increase) -> None:
def create(
self,
*,
category: Literal["account_statement_ofx", "transaction_csv", "balance_csv"],
category: Literal["account_statement_ofx", "transaction_csv", "balance_csv", "bookkeeping_account_balance_csv"],
account_statement_ofx: export_create_params.AccountStatementOfx | NotGiven = NOT_GIVEN,
balance_csv: export_create_params.BalanceCsv | NotGiven = NOT_GIVEN,
bookkeeping_account_balance_csv: export_create_params.BookkeepingAccountBalanceCsv | NotGiven = NOT_GIVEN,
transaction_csv: export_create_params.TransactionCsv | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -52,13 +53,18 @@ def create(
- `transaction_csv` - Export a CSV of all transactions for a given time range.
- `balance_csv` - Export a CSV of account balances for the dates in a given
range.
- `bookkeeping_account_balance_csv` - Export a CSV of bookkeeping account
balances for the dates in a given range.

account_statement_ofx: Options for the created export. Required if `category` is equal to
`account_statement_ofx`.

balance_csv: Options for the created export. Required if `category` is equal to
`balance_csv`.

bookkeeping_account_balance_csv: Options for the created export. Required if `category` is equal to
`bookkeeping_account_balance_csv`.

transaction_csv: Options for the created export. Required if `category` is equal to
`transaction_csv`.

Expand All @@ -79,6 +85,7 @@ def create(
"category": category,
"account_statement_ofx": account_statement_ofx,
"balance_csv": balance_csv,
"bookkeeping_account_balance_csv": bookkeeping_account_balance_csv,
"transaction_csv": transaction_csv,
},
export_create_params.ExportCreateParams,
Expand Down Expand Up @@ -185,9 +192,10 @@ def __init__(self, client: AsyncIncrease) -> None:
async def create(
self,
*,
category: Literal["account_statement_ofx", "transaction_csv", "balance_csv"],
category: Literal["account_statement_ofx", "transaction_csv", "balance_csv", "bookkeeping_account_balance_csv"],
account_statement_ofx: export_create_params.AccountStatementOfx | NotGiven = NOT_GIVEN,
balance_csv: export_create_params.BalanceCsv | NotGiven = NOT_GIVEN,
bookkeeping_account_balance_csv: export_create_params.BookkeepingAccountBalanceCsv | NotGiven = NOT_GIVEN,
transaction_csv: export_create_params.TransactionCsv | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -208,13 +216,18 @@ async def create(
- `transaction_csv` - Export a CSV of all transactions for a given time range.
- `balance_csv` - Export a CSV of account balances for the dates in a given
range.
- `bookkeeping_account_balance_csv` - Export a CSV of bookkeeping account
balances for the dates in a given range.

account_statement_ofx: Options for the created export. Required if `category` is equal to
`account_statement_ofx`.

balance_csv: Options for the created export. Required if `category` is equal to
`balance_csv`.

bookkeeping_account_balance_csv: Options for the created export. Required if `category` is equal to
`bookkeeping_account_balance_csv`.

transaction_csv: Options for the created export. Required if `category` is equal to
`transaction_csv`.

Expand All @@ -235,6 +248,7 @@ async def create(
"category": category,
"account_statement_ofx": account_statement_ofx,
"balance_csv": balance_csv,
"bookkeeping_account_balance_csv": bookkeeping_account_balance_csv,
"transaction_csv": transaction_csv,
},
export_create_params.ExportCreateParams,
Expand Down
8 changes: 8 additions & 0 deletions src/increase/types/ach_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ class Return(BaseModel):


class Submission(BaseModel):
effective_date: date
"""The ACH's effective date sent to the receiving bank.

If `effective_date` is configured in the ACH transfer, this will match the value
there. Otherwise, it will the date that the ACH transfer was processed, which is
usually the current or subsequent business day.
"""

expected_funds_settlement_at: datetime
"""When the funds transfer is expected to settle in the recipient's account.

Expand Down
117 changes: 117 additions & 0 deletions src/increase/types/card_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
"ElementCardDeclineVerificationCardVerificationCode",
"ElementCardDeclineVerificationCardholderAddress",
"ElementCardFuelConfirmation",
"ElementCardFuelConfirmationNetworkIdentifiers",
"ElementCardIncrement",
"ElementCardIncrementNetworkIdentifiers",
"ElementCardRefund",
"ElementCardRefundNetworkIdentifiers",
"ElementCardRefundPurchaseDetails",
"ElementCardRefundPurchaseDetailsCarRental",
"ElementCardRefundPurchaseDetailsLodging",
Expand All @@ -35,7 +38,9 @@
"ElementCardRefundPurchaseDetailsTravelAncillaryService",
"ElementCardRefundPurchaseDetailsTravelTripLeg",
"ElementCardReversal",
"ElementCardReversalNetworkIdentifiers",
"ElementCardSettlement",
"ElementCardSettlementNetworkIdentifiers",
"ElementCardSettlementPurchaseDetails",
"ElementCardSettlementPurchaseDetailsCarRental",
"ElementCardSettlementPurchaseDetailsLodging",
Expand Down Expand Up @@ -668,6 +673,27 @@ class ElementCardDecline(BaseModel):
"""Fields related to verification of cardholder-provided values."""


class ElementCardFuelConfirmationNetworkIdentifiers(BaseModel):
retrieval_reference_number: Optional[str]
"""A life-cycle identifier used across e.g., an authorization and a reversal.

Expected to be unique per acquirer within a window of time. For some card
networks the retrieval reference number includes the trace counter.
"""

trace_number: Optional[str]
"""A counter used to verify an individual authorization.

Expected to be unique per acquirer within a window of time.
"""

transaction_id: Optional[str]
"""
A globally unique transaction identifier provided by the card network, used
across multiple life-cycle requests.
"""


class ElementCardFuelConfirmation(BaseModel):
id: str
"""The Card Fuel Confirmation identifier."""
Expand All @@ -694,6 +720,9 @@ class ElementCardFuelConfirmation(BaseModel):
- `visa` - Visa
"""

network_identifiers: ElementCardFuelConfirmationNetworkIdentifiers
"""Network-specific identifiers for a specific request or transaction."""

pending_transaction_id: Optional[str]
"""
The identifier of the Pending Transaction associated with this Card Fuel
Expand All @@ -713,6 +742,27 @@ class ElementCardFuelConfirmation(BaseModel):
"""


class ElementCardIncrementNetworkIdentifiers(BaseModel):
retrieval_reference_number: Optional[str]
"""A life-cycle identifier used across e.g., an authorization and a reversal.

Expected to be unique per acquirer within a window of time. For some card
networks the retrieval reference number includes the trace counter.
"""

trace_number: Optional[str]
"""A counter used to verify an individual authorization.

Expected to be unique per acquirer within a window of time.
"""

transaction_id: Optional[str]
"""
A globally unique transaction identifier provided by the card network, used
across multiple life-cycle requests.
"""


class ElementCardIncrement(BaseModel):
id: str
"""The Card Increment identifier."""
Expand Down Expand Up @@ -745,6 +795,9 @@ class ElementCardIncrement(BaseModel):
- `visa` - Visa
"""

network_identifiers: ElementCardIncrementNetworkIdentifiers
"""Network-specific identifiers for a specific request or transaction."""

pending_transaction_id: Optional[str]
"""The identifier of the Pending Transaction associated with this Card Increment."""

Expand All @@ -767,6 +820,23 @@ class ElementCardIncrement(BaseModel):
"""


class ElementCardRefundNetworkIdentifiers(BaseModel):
acquirer_business_id: str
"""
A network assigned business ID that identifies the acquirer that processed this
transaction.
"""

acquirer_reference_number: str
"""A globally unique identifier for this settlement."""

transaction_id: Optional[str]
"""
A globally unique transaction identifier provided by the card network, used
across multiple life-cycle requests.
"""


class ElementCardRefundPurchaseDetailsCarRental(BaseModel):
car_class_code: Optional[str]
"""Code indicating the vehicle's class."""
Expand Down Expand Up @@ -1221,6 +1291,9 @@ class ElementCardRefund(BaseModel):
merchant_state: Optional[str]
"""The state the merchant resides in."""

network_identifiers: ElementCardRefundNetworkIdentifiers
"""Network-specific identifiers for this refund."""

purchase_details: Optional[ElementCardRefundPurchaseDetails]
"""
Additional details about the card purchase, such as tax and industry-specific
Expand All @@ -1237,6 +1310,27 @@ class ElementCardRefund(BaseModel):
"""


class ElementCardReversalNetworkIdentifiers(BaseModel):
retrieval_reference_number: Optional[str]
"""A life-cycle identifier used across e.g., an authorization and a reversal.

Expected to be unique per acquirer within a window of time. For some card
networks the retrieval reference number includes the trace counter.
"""

trace_number: Optional[str]
"""A counter used to verify an individual authorization.

Expected to be unique per acquirer within a window of time.
"""

transaction_id: Optional[str]
"""
A globally unique transaction identifier provided by the card network, used
across multiple life-cycle requests.
"""


class ElementCardReversal(BaseModel):
id: str
"""The Card Reversal identifier."""
Expand All @@ -1263,6 +1357,9 @@ class ElementCardReversal(BaseModel):
- `visa` - Visa
"""

network_identifiers: ElementCardReversalNetworkIdentifiers
"""Network-specific identifiers for a specific request or transaction."""

pending_transaction_id: Optional[str]
"""The identifier of the Pending Transaction associated with this Card Reversal."""

Expand All @@ -1285,6 +1382,23 @@ class ElementCardReversal(BaseModel):
"""


class ElementCardSettlementNetworkIdentifiers(BaseModel):
acquirer_business_id: str
"""
A network assigned business ID that identifies the acquirer that processed this
transaction.
"""

acquirer_reference_number: str
"""A globally unique identifier for this settlement."""

transaction_id: Optional[str]
"""
A globally unique transaction identifier provided by the card network, used
across multiple life-cycle requests.
"""


class ElementCardSettlementPurchaseDetailsCarRental(BaseModel):
car_class_code: Optional[str]
"""Code indicating the vehicle's class."""
Expand Down Expand Up @@ -1745,6 +1859,9 @@ class ElementCardSettlement(BaseModel):
merchant_state: Optional[str]
"""The state the merchant resides in."""

network_identifiers: ElementCardSettlementNetworkIdentifiers
"""Network-specific identifiers for this refund."""

pending_transaction_id: Optional[str]
"""The identifier of the Pending Transaction associated with this Transaction."""

Expand Down
4 changes: 3 additions & 1 deletion src/increase/types/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Export(BaseModel):
id: str
"""The Export identifier."""

category: Literal["account_statement_ofx", "transaction_csv", "balance_csv"]
category: Literal["account_statement_ofx", "transaction_csv", "balance_csv", "bookkeeping_account_balance_csv"]
"""The category of the Export.

We may add additional possible values for this enum over time; your application
Expand All @@ -24,6 +24,8 @@ class Export(BaseModel):
- `transaction_csv` - Export a CSV of all transactions for a given time range.
- `balance_csv` - Export a CSV of account balances for the dates in a given
range.
- `bookkeeping_account_balance_csv` - Export a CSV of bookkeeping account
balances for the dates in a given range.
"""

created_at: datetime
Expand Down
48 changes: 47 additions & 1 deletion src/increase/types/export_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@
"AccountStatementOfxCreatedAt",
"BalanceCsv",
"BalanceCsvCreatedAt",
"BookkeepingAccountBalanceCsv",
"BookkeepingAccountBalanceCsvCreatedAt",
"TransactionCsv",
"TransactionCsvCreatedAt",
]


class ExportCreateParams(TypedDict, total=False):
category: Required[Literal["account_statement_ofx", "transaction_csv", "balance_csv"]]
category: Required[
Literal["account_statement_ofx", "transaction_csv", "balance_csv", "bookkeeping_account_balance_csv"]
]
"""The type of Export to create.

- `account_statement_ofx` - Export an Open Financial Exchange (OFX) file of
transactions and balances for a given time range and Account.
- `transaction_csv` - Export a CSV of all transactions for a given time range.
- `balance_csv` - Export a CSV of account balances for the dates in a given
range.
- `bookkeeping_account_balance_csv` - Export a CSV of bookkeeping account
balances for the dates in a given range.
"""

account_statement_ofx: AccountStatementOfx
Expand All @@ -42,6 +48,12 @@ class ExportCreateParams(TypedDict, total=False):
Required if `category` is equal to `balance_csv`.
"""

bookkeeping_account_balance_csv: BookkeepingAccountBalanceCsv
"""Options for the created export.

Required if `category` is equal to `bookkeeping_account_balance_csv`.
"""

transaction_csv: TransactionCsv
"""Options for the created export.

Expand Down Expand Up @@ -117,6 +129,40 @@ class BalanceCsv(TypedDict, total=False):
"""Filter results by time range on the `created_at` attribute."""


class BookkeepingAccountBalanceCsvCreatedAt(TypedDict, total=False):
after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
"""
Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
timestamp.
"""

before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
"""
Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
timestamp.
"""

on_or_after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
"""
Return results on or after this
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
"""

on_or_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
"""
Return results on or before this
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
"""


class BookkeepingAccountBalanceCsv(TypedDict, total=False):
bookkeeping_account_id: str
"""Filter exported Transactions to the specified BookkeepingAccount."""

created_at: BookkeepingAccountBalanceCsvCreatedAt
"""Filter results by time range on the `created_at` attribute."""


class TransactionCsvCreatedAt(TypedDict, total=False):
after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
"""
Expand Down
Loading