diff --git a/README.md b/README.md index 41f94e4b2..98f856b7a 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ first_page = await increase.accounts.list() print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..." for account in first_page.data: - print(account.created_at) + print(account.id) # Remove `await` for non-async usage. ``` diff --git a/src/increase/_client.py b/src/increase/_client.py index 2cc6c0266..fe23ecdc1 100644 --- a/src/increase/_client.py +++ b/src/increase/_client.py @@ -316,10 +316,10 @@ def _make_status_error( request=request, response=response, body={ - "type": "internal_server_error", - "title": "", "detail": None, "status": 500, + "title": "", + "type": "internal_server_error", }, ) return super()._make_status_error(err_msg, request=request, response=response, body=body) @@ -591,10 +591,10 @@ def _make_status_error( request=request, response=response, body={ - "type": "internal_server_error", - "title": "", "detail": None, "status": 500, + "title": "", + "type": "internal_server_error", }, ) return super()._make_status_error(err_msg, request=request, response=response, body=body) diff --git a/src/increase/_exceptions.py b/src/increase/_exceptions.py index 917e6ab11..5d74c3deb 100644 --- a/src/increase/_exceptions.py +++ b/src/increase/_exceptions.py @@ -66,11 +66,11 @@ def __init__(self, message: str, *, body: object, request: httpx.Request, respon title = cast(Any, data.get("title")) super().__init__(title or message, request=request, response=response, body=body) - self.type = cast(Any, data.get("type")) - self.title = cast(Any, data.get("title")) self.detail = cast(Any, data.get("detail")) - self.status = cast(Any, data.get("status")) self.errors = cast(Any, data.get("errors")) + self.status = cast(Any, data.get("status")) + self.title = cast(Any, data.get("title")) + self.type = cast(Any, data.get("type")) class MalformedRequestError(exceptions.BadRequestError): diff --git a/src/increase/types/account.py b/src/increase/types/account.py index a12b2b93c..5e3007fbc 100644 --- a/src/increase/types/account.py +++ b/src/increase/types/account.py @@ -10,6 +10,9 @@ class Account(BaseModel): + id: str + """The Account identifier.""" + created_at: datetime """ The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Account @@ -25,9 +28,6 @@ class Account(BaseModel): entity_id: Optional[str] """The identifier for the Entity the Account belongs to.""" - id: str - """The Account identifier.""" - informational_entity_id: Optional[str] """ The identifier of an Entity that, while not owning the Account, is associated diff --git a/src/increase/types/account_number.py b/src/increase/types/account_number.py index 40934df47..d6f664e1a 100644 --- a/src/increase/types/account_number.py +++ b/src/increase/types/account_number.py @@ -9,6 +9,9 @@ class AccountNumber(BaseModel): + id: str + """The Account Number identifier.""" + account_id: str """The identifier for the account this Account Number belongs to.""" @@ -21,9 +24,6 @@ class AccountNumber(BaseModel): Number was created. """ - id: str - """The Account Number identifier.""" - name: str """The name you choose for the Account Number.""" diff --git a/src/increase/types/account_statement.py b/src/increase/types/account_statement.py index 1092470c5..57c5e19d2 100644 --- a/src/increase/types/account_statement.py +++ b/src/increase/types/account_statement.py @@ -9,6 +9,9 @@ class AccountStatement(BaseModel): + id: str + """The Account Statement identifier.""" + account_id: str """The identifier for the Account this Account Statement belongs to.""" @@ -24,9 +27,6 @@ class AccountStatement(BaseModel): file_id: str """The identifier of the File containing a PDF of the statement.""" - id: str - """The Account Statement identifier.""" - starting_balance: int """The Account's balance at the start of its statement period.""" diff --git a/src/increase/types/account_transfer.py b/src/increase/types/account_transfer.py index 5039ebaf5..dfe756d5b 100644 --- a/src/increase/types/account_transfer.py +++ b/src/increase/types/account_transfer.py @@ -38,6 +38,9 @@ class Cancellation(BaseModel): class AccountTransfer(BaseModel): + id: str + """The account transfer's identifier.""" + account_id: str """The Account to which the transfer belongs.""" @@ -80,9 +83,6 @@ class AccountTransfer(BaseModel): destination_transaction_id: Optional[str] """The ID for the transaction receiving the transfer.""" - id: str - """The account transfer's identifier.""" - network: Literal["account"] """The transfer's network.""" diff --git a/src/increase/types/ach_prenotification.py b/src/increase/types/ach_prenotification.py index 9da57f3b7..d6013515b 100644 --- a/src/increase/types/ach_prenotification.py +++ b/src/increase/types/ach_prenotification.py @@ -21,6 +21,9 @@ class PrenotificationReturn(BaseModel): class ACHPrenotification(BaseModel): + id: str + """The ACH Prenotification's identifier.""" + account_number: str """The destination account number.""" @@ -53,9 +56,6 @@ class ACHPrenotification(BaseModel): The effective date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ - id: str - """The ACH Prenotification's identifier.""" - prenotification_return: Optional[PrenotificationReturn] """If your prenotification is returned, this will contain details of the return.""" diff --git a/src/increase/types/ach_transfer.py b/src/increase/types/ach_transfer.py index e885d95b9..d9d66f652 100644 --- a/src/increase/types/ach_transfer.py +++ b/src/increase/types/ach_transfer.py @@ -153,6 +153,9 @@ class Submission(BaseModel): class ACHTransfer(BaseModel): + id: str + """The ACH transfer's identifier.""" + account_id: str """The Account to which the transfer belongs.""" @@ -218,9 +221,6 @@ class ACHTransfer(BaseModel): funding: Literal["checking", "savings"] """The type of the account to which the transfer will be sent.""" - id: str - """The ACH transfer's identifier.""" - individual_id: Optional[str] """Your identifer for the transfer recipient.""" diff --git a/src/increase/types/bookkeeping_account.py b/src/increase/types/bookkeeping_account.py index 4682b1836..876d5ed50 100644 --- a/src/increase/types/bookkeeping_account.py +++ b/src/increase/types/bookkeeping_account.py @@ -9,6 +9,9 @@ class BookkeepingAccount(BaseModel): + id: str + """The account identifier.""" + account_id: Optional[str] """The API Account associated with this bookkeeping account.""" @@ -18,9 +21,6 @@ class BookkeepingAccount(BaseModel): entity_id: Optional[str] """The Entity associated with this bookkeeping account.""" - id: str - """The account identifier.""" - name: str """The name you choose for the account.""" diff --git a/src/increase/types/bookkeeping_entry.py b/src/increase/types/bookkeeping_entry.py index f5ce73eb6..5a0f9e618 100644 --- a/src/increase/types/bookkeeping_entry.py +++ b/src/increase/types/bookkeeping_entry.py @@ -8,6 +8,9 @@ class BookkeepingEntry(BaseModel): + id: str + """The entry identifier.""" + account_id: str """The identifier for the Account the Entry belongs to.""" @@ -20,9 +23,6 @@ class BookkeepingEntry(BaseModel): entry_set_id: str """The identifier for the Account the Entry belongs to.""" - id: str - """The entry identifier.""" - type: Literal["bookkeeping_entry"] """A constant representing the object's type. diff --git a/src/increase/types/bookkeeping_entry_set.py b/src/increase/types/bookkeeping_entry_set.py index 10d9e6dc2..f73678ece 100644 --- a/src/increase/types/bookkeeping_entry_set.py +++ b/src/increase/types/bookkeeping_entry_set.py @@ -10,26 +10,26 @@ class Entry(BaseModel): + id: str + """The entry identifier.""" + account_id: str """The bookkeeping account impacted by the entry.""" amount: int """The amount of the entry in minor units.""" - id: str - """The entry identifier.""" - class BookkeepingEntrySet(BaseModel): + id: str + """The entry set identifier.""" + date: datetime """The timestamp of the entry set.""" entries: List[Entry] """The entries""" - id: str - """The entry set identifier.""" - transaction_id: Optional[str] """The transaction identifier, if any.""" diff --git a/src/increase/types/card.py b/src/increase/types/card.py index c3179d66d..2770174c2 100644 --- a/src/increase/types/card.py +++ b/src/increase/types/card.py @@ -47,6 +47,9 @@ class DigitalWallet(BaseModel): class Card(BaseModel): + id: str + """The card identifier.""" + account_id: str """The identifier for the account this card belongs to.""" @@ -75,9 +78,6 @@ class Card(BaseModel): expiration_year: int """The year the card expires in YYYY format (e.g., 2025).""" - id: str - """The card identifier.""" - last4: str """The last 4 digits of the Card's Primary Account Number.""" diff --git a/src/increase/types/card_dispute.py b/src/increase/types/card_dispute.py index 87f108bc3..e906d48de 100644 --- a/src/increase/types/card_dispute.py +++ b/src/increase/types/card_dispute.py @@ -41,6 +41,9 @@ class Rejection(BaseModel): class CardDispute(BaseModel): + id: str + """The Card Dispute identifier.""" + acceptance: Optional[Acceptance] """ If the Card Dispute's status is `accepted`, this will contain details of the @@ -59,9 +62,6 @@ class CardDispute(BaseModel): explanation: str """Why you disputed the Transaction in question.""" - id: str - """The Card Dispute identifier.""" - rejection: Optional[Rejection] """ If the Card Dispute's status is `rejected`, this will contain details of the diff --git a/src/increase/types/card_profile.py b/src/increase/types/card_profile.py index fbf5246fc..453ccbf8e 100644 --- a/src/increase/types/card_profile.py +++ b/src/increase/types/card_profile.py @@ -47,6 +47,9 @@ class DigitalWallets(BaseModel): class CardProfile(BaseModel): + id: str + """The Card Profile identifier.""" + created_at: datetime """ The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which @@ -63,9 +66,6 @@ class CardProfile(BaseModel): their app. """ - id: str - """The Card Profile identifier.""" - status: Literal["pending", "rejected", "active", "archived"] """The status of the Card Profile.""" diff --git a/src/increase/types/check_deposit.py b/src/increase/types/check_deposit.py index a08fbef81..ba30e5e27 100644 --- a/src/increase/types/check_deposit.py +++ b/src/increase/types/check_deposit.py @@ -122,6 +122,9 @@ class DepositReturn(BaseModel): class CheckDeposit(BaseModel): + id: str + """The deposit's identifier.""" + account_id: str """The Account the check was deposited into.""" @@ -164,9 +167,6 @@ class CheckDeposit(BaseModel): front_image_file_id: str """The ID for the File containing the image of the front of the check.""" - id: str - """The deposit's identifier.""" - status: Literal["pending", "submitted", "rejected", "returned"] """The status of the Check Deposit.""" diff --git a/src/increase/types/check_transfer.py b/src/increase/types/check_transfer.py index feb7e162f..c96e3fe8d 100644 --- a/src/increase/types/check_transfer.py +++ b/src/increase/types/check_transfer.py @@ -8,36 +8,16 @@ __all__ = [ "CheckTransfer", - "ReturnAddress", "Approval", "Cancellation", - "Submission", - "StopPaymentRequest", "Deposit", + "ReturnAddress", "ReturnDetails", + "StopPaymentRequest", + "Submission", ] -class ReturnAddress(BaseModel): - city: Optional[str] - """The city of the address.""" - - line1: Optional[str] - """The first line of the address.""" - - line2: Optional[str] - """The second line of the address.""" - - name: Optional[str] - """The name of the address.""" - - state: Optional[str] - """The US state of the address.""" - - zip: Optional[str] - """The postal code of the address.""" - - class Approval(BaseModel): approved_at: datetime """ @@ -66,31 +46,6 @@ class Cancellation(BaseModel): """ -class Submission(BaseModel): - check_number: str - """The identitying number of the check.""" - - submitted_at: datetime - """When this check transfer was submitted to our check printer.""" - - -class StopPaymentRequest(BaseModel): - requested_at: datetime - """The time the stop-payment was requested.""" - - transaction_id: str - """The transaction ID of the corresponding credit transaction.""" - - transfer_id: str - """The ID of the check transfer that was stopped.""" - - type: Literal["check_transfer_stop_payment_request"] - """A constant representing the object's type. - - For this resource it will always be `check_transfer_stop_payment_request`. - """ - - class Deposit(BaseModel): back_image_file_id: Optional[str] """ @@ -114,6 +69,26 @@ class Deposit(BaseModel): """ +class ReturnAddress(BaseModel): + city: Optional[str] + """The city of the address.""" + + line1: Optional[str] + """The first line of the address.""" + + line2: Optional[str] + """The second line of the address.""" + + name: Optional[str] + """The name of the address.""" + + state: Optional[str] + """The US state of the address.""" + + zip: Optional[str] + """The postal code of the address.""" + + class ReturnDetails(BaseModel): file_id: Optional[str] """If available, a document with additional information about the return.""" @@ -137,7 +112,35 @@ class ReturnDetails(BaseModel): """The identifier of the returned Check Transfer.""" +class StopPaymentRequest(BaseModel): + requested_at: datetime + """The time the stop-payment was requested.""" + + transaction_id: str + """The transaction ID of the corresponding credit transaction.""" + + transfer_id: str + """The ID of the check transfer that was stopped.""" + + type: Literal["check_transfer_stop_payment_request"] + """A constant representing the object's type. + + For this resource it will always be `check_transfer_stop_payment_request`. + """ + + +class Submission(BaseModel): + check_number: str + """The identitying number of the check.""" + + submitted_at: datetime + """When this check transfer was submitted to our check printer.""" + + class CheckTransfer(BaseModel): + id: str + """The Check transfer's identifier.""" + account_id: str """The identifier of the Account from which funds will be transferred.""" @@ -186,9 +189,6 @@ class CheckTransfer(BaseModel): deposit: Optional[Deposit] """After a check transfer is deposited, this will contain supplemental details.""" - id: str - """The Check transfer's identifier.""" - mailed_at: Optional[datetime] """ The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which diff --git a/src/increase/types/declined_transaction.py b/src/increase/types/declined_transaction.py index 9d69fe685..fccb60064 100644 --- a/src/increase/types/declined_transaction.py +++ b/src/increase/types/declined_transaction.py @@ -421,6 +421,9 @@ class Source(BaseModel): class DeclinedTransaction(BaseModel): + id: str + """The Declined Transaction identifier.""" + account_id: str """The identifier for the Account the Declined Transaction belongs to.""" @@ -446,9 +449,6 @@ class DeclinedTransaction(BaseModel): description: str """This is the description the vendor provides.""" - id: str - """The Declined Transaction identifier.""" - route_id: Optional[str] """The identifier for the route this Declined Transaction came through. diff --git a/src/increase/types/digital_wallet_token.py b/src/increase/types/digital_wallet_token.py index 15cf5b7ed..0655968fb 100644 --- a/src/increase/types/digital_wallet_token.py +++ b/src/increase/types/digital_wallet_token.py @@ -9,6 +9,9 @@ class DigitalWalletToken(BaseModel): + id: str + """The Digital Wallet Token identifier.""" + card_id: str """The identifier for the Card this Digital Wallet Token belongs to.""" @@ -18,9 +21,6 @@ class DigitalWalletToken(BaseModel): the Card was created. """ - id: str - """The Digital Wallet Token identifier.""" - status: Literal["active", "inactive", "suspended", "deactivated"] """This indicates if payments can be made with the Digital Wallet Token.""" diff --git a/src/increase/types/document.py b/src/increase/types/document.py index 59d8e426c..a30deea24 100644 --- a/src/increase/types/document.py +++ b/src/increase/types/document.py @@ -10,6 +10,9 @@ class Document(BaseModel): + id: str + """The Document identifier.""" + category: Literal["form_1099_int", "proof_of_authorization", "company_information"] """The type of document.""" @@ -25,9 +28,6 @@ class Document(BaseModel): file_id: str """The identifier of the File containing the Document's contents.""" - id: str - """The Document identifier.""" - type: Literal["document"] """A constant representing the object's type. diff --git a/src/increase/types/entity.py b/src/increase/types/entity.py index 91d4917b1..1eed1b0e6 100644 --- a/src/increase/types/entity.py +++ b/src/increase/types/entity.py @@ -14,23 +14,23 @@ "CorporationBeneficialOwnerIndividual", "CorporationBeneficialOwnerIndividualAddress", "CorporationBeneficialOwnerIndividualIdentification", - "NaturalPerson", - "NaturalPersonAddress", - "NaturalPersonIdentification", "Joint", "JointIndividual", "JointIndividualAddress", "JointIndividualIdentification", + "NaturalPerson", + "NaturalPersonAddress", + "NaturalPersonIdentification", + "SupplementalDocument", "Trust", "TrustAddress", + "TrustGrantor", + "TrustGrantorAddress", + "TrustGrantorIdentification", "TrustTrustee", "TrustTrusteeIndividual", "TrustTrusteeIndividualAddress", "TrustTrusteeIndividualIdentification", - "TrustGrantor", - "TrustGrantorAddress", - "TrustGrantorIdentification", - "SupplementalDocument", ] @@ -138,7 +138,7 @@ class Corporation(BaseModel): """The website of the corporation.""" -class NaturalPersonAddress(BaseModel): +class JointIndividualAddress(BaseModel): city: str """The city of the address.""" @@ -158,7 +158,7 @@ class NaturalPersonAddress(BaseModel): """The ZIP code of the address.""" -class NaturalPersonIdentification(BaseModel): +class JointIndividualIdentification(BaseModel): method: Literal[ "social_security_number", "individual_taxpayer_identification_number", "passport", "drivers_license", "other" ] @@ -171,21 +171,29 @@ class NaturalPersonIdentification(BaseModel): """ -class NaturalPerson(BaseModel): - address: NaturalPersonAddress +class JointIndividual(BaseModel): + address: JointIndividualAddress """The person's address.""" date_of_birth: date """The person's date of birth in YYYY-MM-DD format.""" - identification: NaturalPersonIdentification + identification: JointIndividualIdentification """A means of verifying the person's identity.""" name: str """The person's legal name.""" -class JointIndividualAddress(BaseModel): +class Joint(BaseModel): + individuals: List[JointIndividual] + """The two individuals that share control of the entity.""" + + name: str + """The entity's name.""" + + +class NaturalPersonAddress(BaseModel): city: str """The city of the address.""" @@ -205,7 +213,7 @@ class JointIndividualAddress(BaseModel): """The ZIP code of the address.""" -class JointIndividualIdentification(BaseModel): +class NaturalPersonIdentification(BaseModel): method: Literal[ "social_security_number", "individual_taxpayer_identification_number", "passport", "drivers_license", "other" ] @@ -218,26 +226,35 @@ class JointIndividualIdentification(BaseModel): """ -class JointIndividual(BaseModel): - address: JointIndividualAddress +class NaturalPerson(BaseModel): + address: NaturalPersonAddress """The person's address.""" date_of_birth: date """The person's date of birth in YYYY-MM-DD format.""" - identification: JointIndividualIdentification + identification: NaturalPersonIdentification """A means of verifying the person's identity.""" name: str """The person's legal name.""" -class Joint(BaseModel): - individuals: List[JointIndividual] - """The two individuals that share control of the entity.""" +class SupplementalDocument(BaseModel): + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the + Supplemental Document was created. + """ - name: str - """The entity's name.""" + file_id: str + """The File containing the document.""" + + type: Literal["entity_supplemental_document"] + """A constant representing the object's type. + + For this resource it will always be `entity_supplemental_document`. + """ class TrustAddress(BaseModel): @@ -260,7 +277,7 @@ class TrustAddress(BaseModel): """The ZIP code of the address.""" -class TrustTrusteeIndividualAddress(BaseModel): +class TrustGrantorAddress(BaseModel): city: str """The city of the address.""" @@ -280,7 +297,7 @@ class TrustTrusteeIndividualAddress(BaseModel): """The ZIP code of the address.""" -class TrustTrusteeIndividualIdentification(BaseModel): +class TrustGrantorIdentification(BaseModel): method: Literal[ "social_security_number", "individual_taxpayer_identification_number", "passport", "drivers_license", "other" ] @@ -293,32 +310,21 @@ class TrustTrusteeIndividualIdentification(BaseModel): """ -class TrustTrusteeIndividual(BaseModel): - address: TrustTrusteeIndividualAddress +class TrustGrantor(BaseModel): + address: TrustGrantorAddress """The person's address.""" date_of_birth: date """The person's date of birth in YYYY-MM-DD format.""" - identification: TrustTrusteeIndividualIdentification + identification: TrustGrantorIdentification """A means of verifying the person's identity.""" name: str """The person's legal name.""" -class TrustTrustee(BaseModel): - individual: Optional[TrustTrusteeIndividual] - """The individual trustee of the trust. - - Will be present if the trustee's `structure` is equal to `individual`. - """ - - structure: Literal["individual"] - """The structure of the trustee. Will always be equal to `individual`.""" - - -class TrustGrantorAddress(BaseModel): +class TrustTrusteeIndividualAddress(BaseModel): city: str """The city of the address.""" @@ -338,7 +344,7 @@ class TrustGrantorAddress(BaseModel): """The ZIP code of the address.""" -class TrustGrantorIdentification(BaseModel): +class TrustTrusteeIndividualIdentification(BaseModel): method: Literal[ "social_security_number", "individual_taxpayer_identification_number", "passport", "drivers_license", "other" ] @@ -351,20 +357,31 @@ class TrustGrantorIdentification(BaseModel): """ -class TrustGrantor(BaseModel): - address: TrustGrantorAddress +class TrustTrusteeIndividual(BaseModel): + address: TrustTrusteeIndividualAddress """The person's address.""" date_of_birth: date """The person's date of birth in YYYY-MM-DD format.""" - identification: TrustGrantorIdentification + identification: TrustTrusteeIndividualIdentification """A means of verifying the person's identity.""" name: str """The person's legal name.""" +class TrustTrustee(BaseModel): + individual: Optional[TrustTrusteeIndividual] + """The individual trustee of the trust. + + Will be present if the trustee's `structure` is equal to `individual`. + """ + + structure: Literal["individual"] + """The structure of the trustee. Will always be equal to `individual`.""" + + class Trust(BaseModel): address: TrustAddress """The trust's address.""" @@ -394,24 +411,10 @@ class Trust(BaseModel): """The trustees of the trust.""" -class SupplementalDocument(BaseModel): - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the - Supplemental Document was created. - """ - - file_id: str - """The File containing the document.""" - - type: Literal["entity_supplemental_document"] - """A constant representing the object's type. - - For this resource it will always be `entity_supplemental_document`. - """ - - class Entity(BaseModel): + id: str + """The entity's identifier.""" + corporation: Optional[Corporation] """Details of the corporation entity. @@ -421,9 +424,6 @@ class Entity(BaseModel): description: Optional[str] """The entity's description for display purposes.""" - id: str - """The entity's identifier.""" - joint: Optional[Joint] """Details of the joint entity. diff --git a/src/increase/types/entity_create_params.py b/src/increase/types/entity_create_params.py index 67d8fdd42..150c9aa97 100644 --- a/src/increase/types/entity_create_params.py +++ b/src/increase/types/entity_create_params.py @@ -16,22 +16,22 @@ "CorporationBeneficialOwnerIndividual", "CorporationBeneficialOwnerIndividualAddress", "CorporationBeneficialOwnerIndividualIdentification", - "CorporationBeneficialOwnerIndividualIdentificationPassport", "CorporationBeneficialOwnerIndividualIdentificationDriversLicense", "CorporationBeneficialOwnerIndividualIdentificationOther", + "CorporationBeneficialOwnerIndividualIdentificationPassport", "Joint", "JointIndividual", "JointIndividualAddress", "JointIndividualIdentification", - "JointIndividualIdentificationPassport", "JointIndividualIdentificationDriversLicense", "JointIndividualIdentificationOther", + "JointIndividualIdentificationPassport", "NaturalPerson", "NaturalPersonAddress", "NaturalPersonIdentification", - "NaturalPersonIdentificationPassport", "NaturalPersonIdentificationDriversLicense", "NaturalPersonIdentificationOther", + "NaturalPersonIdentificationPassport", "SupplementalDocument", "Trust", "TrustAddress", @@ -39,15 +39,15 @@ "TrustTrusteeIndividual", "TrustTrusteeIndividualAddress", "TrustTrusteeIndividualIdentification", - "TrustTrusteeIndividualIdentificationPassport", "TrustTrusteeIndividualIdentificationDriversLicense", "TrustTrusteeIndividualIdentificationOther", + "TrustTrusteeIndividualIdentificationPassport", "TrustGrantor", "TrustGrantorAddress", "TrustGrantorIdentification", - "TrustGrantorIdentificationPassport", "TrustGrantorIdentificationDriversLicense", "TrustGrantorIdentificationOther", + "TrustGrantorIdentificationPassport", ] @@ -131,17 +131,6 @@ class CorporationBeneficialOwnerIndividualAddress(TypedDict, total=False): """The second line of the address. This might be the floor or room number.""" -class CorporationBeneficialOwnerIndividualIdentificationPassport(TypedDict, total=False): - country: Required[str] - """The country that issued the passport.""" - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The passport's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the passport.""" - - class CorporationBeneficialOwnerIndividualIdentificationDriversLicense(TypedDict, total=False): expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """The driver's license's expiration date in YYYY-MM-DD format.""" @@ -170,6 +159,17 @@ class CorporationBeneficialOwnerIndividualIdentificationOther(TypedDict, total=F """The document's expiration date in YYYY-MM-DD format.""" +class CorporationBeneficialOwnerIndividualIdentificationPassport(TypedDict, total=False): + country: Required[str] + """The country that issued the passport.""" + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The passport's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the passport.""" + + class CorporationBeneficialOwnerIndividualIdentification(TypedDict, total=False): method: Required[ Literal[ @@ -286,17 +286,6 @@ class JointIndividualAddress(TypedDict, total=False): """The second line of the address. This might be the floor or room number.""" -class JointIndividualIdentificationPassport(TypedDict, total=False): - country: Required[str] - """The country that issued the passport.""" - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The passport's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the passport.""" - - class JointIndividualIdentificationDriversLicense(TypedDict, total=False): expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """The driver's license's expiration date in YYYY-MM-DD format.""" @@ -325,6 +314,17 @@ class JointIndividualIdentificationOther(TypedDict, total=False): """The document's expiration date in YYYY-MM-DD format.""" +class JointIndividualIdentificationPassport(TypedDict, total=False): + country: Required[str] + """The country that issued the passport.""" + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The passport's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the passport.""" + + class JointIndividualIdentification(TypedDict, total=False): method: Required[ Literal[ @@ -412,17 +412,6 @@ class NaturalPersonAddress(TypedDict, total=False): """The second line of the address. This might be the floor or room number.""" -class NaturalPersonIdentificationPassport(TypedDict, total=False): - country: Required[str] - """The country that issued the passport.""" - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The passport's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the passport.""" - - class NaturalPersonIdentificationDriversLicense(TypedDict, total=False): expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """The driver's license's expiration date in YYYY-MM-DD format.""" @@ -451,6 +440,17 @@ class NaturalPersonIdentificationOther(TypedDict, total=False): """The document's expiration date in YYYY-MM-DD format.""" +class NaturalPersonIdentificationPassport(TypedDict, total=False): + country: Required[str] + """The country that issued the passport.""" + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The passport's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the passport.""" + + class NaturalPersonIdentification(TypedDict, total=False): method: Required[ Literal[ @@ -555,17 +555,6 @@ class TrustTrusteeIndividualAddress(TypedDict, total=False): """The second line of the address. This might be the floor or room number.""" -class TrustTrusteeIndividualIdentificationPassport(TypedDict, total=False): - country: Required[str] - """The country that issued the passport.""" - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The passport's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the passport.""" - - class TrustTrusteeIndividualIdentificationDriversLicense(TypedDict, total=False): expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """The driver's license's expiration date in YYYY-MM-DD format.""" @@ -594,6 +583,17 @@ class TrustTrusteeIndividualIdentificationOther(TypedDict, total=False): """The document's expiration date in YYYY-MM-DD format.""" +class TrustTrusteeIndividualIdentificationPassport(TypedDict, total=False): + country: Required[str] + """The country that issued the passport.""" + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The passport's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the passport.""" + + class TrustTrusteeIndividualIdentification(TypedDict, total=False): method: Required[ Literal[ @@ -684,17 +684,6 @@ class TrustGrantorAddress(TypedDict, total=False): """The second line of the address. This might be the floor or room number.""" -class TrustGrantorIdentificationPassport(TypedDict, total=False): - country: Required[str] - """The country that issued the passport.""" - - expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """The passport's expiration date in YYYY-MM-DD format.""" - - file_id: Required[str] - """The identifier of the File containing the passport.""" - - class TrustGrantorIdentificationDriversLicense(TypedDict, total=False): expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """The driver's license's expiration date in YYYY-MM-DD format.""" @@ -723,6 +712,17 @@ class TrustGrantorIdentificationOther(TypedDict, total=False): """The document's expiration date in YYYY-MM-DD format.""" +class TrustGrantorIdentificationPassport(TypedDict, total=False): + country: Required[str] + """The country that issued the passport.""" + + expiration_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """The passport's expiration date in YYYY-MM-DD format.""" + + file_id: Required[str] + """The identifier of the File containing the passport.""" + + class TrustGrantorIdentification(TypedDict, total=False): method: Required[ Literal[ diff --git a/src/increase/types/event.py b/src/increase/types/event.py index 1686758e8..68e664da1 100644 --- a/src/increase/types/event.py +++ b/src/increase/types/event.py @@ -9,6 +9,9 @@ class Event(BaseModel): + id: str + """The Event identifier.""" + associated_object_id: str """The identifier of the object that generated this Event.""" @@ -76,9 +79,6 @@ class Event(BaseModel): created_at: datetime """The time the Event was created.""" - id: str - """The Event identifier.""" - type: Literal["event"] """A constant representing the object's type. diff --git a/src/increase/types/event_subscription.py b/src/increase/types/event_subscription.py index 2c58d1160..198dbd33e 100644 --- a/src/increase/types/event_subscription.py +++ b/src/increase/types/event_subscription.py @@ -10,12 +10,12 @@ class EventSubscription(BaseModel): - created_at: datetime - """The time the event subscription was created.""" - id: str """The event subscription identifier.""" + created_at: datetime + """The time the event subscription was created.""" + selected_event_category: Optional[ Literal[ "account.created", diff --git a/src/increase/types/export.py b/src/increase/types/export.py index 9e85effdc..cb50c67e5 100644 --- a/src/increase/types/export.py +++ b/src/increase/types/export.py @@ -10,6 +10,9 @@ class Export(BaseModel): + id: str + """The Export identifier.""" + category: Literal["transaction_csv", "balance_csv"] """The category of the Export. @@ -32,9 +35,6 @@ class Export(BaseModel): This will be present when the Export's status transitions to `complete`. """ - id: str - """The Export identifier.""" - status: Literal["pending", "complete"] """The status of the Export.""" diff --git a/src/increase/types/external_account.py b/src/increase/types/external_account.py index 2865d3829..6244438d8 100644 --- a/src/increase/types/external_account.py +++ b/src/increase/types/external_account.py @@ -9,6 +9,9 @@ class ExternalAccount(BaseModel): + id: str + """The External Account's identifier.""" + account_number: str """The destination account number.""" @@ -24,9 +27,6 @@ class ExternalAccount(BaseModel): funding: Literal["checking", "savings", "other"] """The type of the account to which the transfer will be sent.""" - id: str - """The External Account's identifier.""" - routing_number: str """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" diff --git a/src/increase/types/file.py b/src/increase/types/file.py index e1b9f5b9b..a6766360c 100644 --- a/src/increase/types/file.py +++ b/src/increase/types/file.py @@ -10,6 +10,9 @@ class File(BaseModel): + id: str + """The File's identifier.""" + created_at: datetime """The time the File was created.""" @@ -28,9 +31,6 @@ class File(BaseModel): filename: Optional[str] """The filename that was provided upon upload or generated by Increase.""" - id: str - """The File's identifier.""" - purpose: Literal[ "check_image_front", "check_image_back", diff --git a/src/increase/types/group.py b/src/increase/types/group.py index cb083d778..3e4879fde 100644 --- a/src/increase/types/group.py +++ b/src/increase/types/group.py @@ -9,6 +9,9 @@ class Group(BaseModel): + id: str + """The Group identifier.""" + ach_debit_status: Literal["disabled", "enabled"] """If the Group is allowed to create ACH debits.""" @@ -21,9 +24,6 @@ class Group(BaseModel): was created. """ - id: str - """The Group identifier.""" - type: Literal["group"] """A constant representing the object's type. diff --git a/src/increase/types/inbound_wire_drawdown_request.py b/src/increase/types/inbound_wire_drawdown_request.py index 45db70bf4..84a7a0bd9 100644 --- a/src/increase/types/inbound_wire_drawdown_request.py +++ b/src/increase/types/inbound_wire_drawdown_request.py @@ -9,6 +9,9 @@ class InboundWireDrawdownRequest(BaseModel): + id: str + """The Wire drawdown request identifier.""" + amount: int """The amount being requested in cents.""" @@ -36,9 +39,6 @@ class InboundWireDrawdownRequest(BaseModel): requested. Will always be "USD". """ - id: str - """The Wire drawdown request identifier.""" - message_to_recipient: Optional[str] """A message from the drawdown request's originator.""" diff --git a/src/increase/types/oauth_connection.py b/src/increase/types/oauth_connection.py index 9007af18e..668eb4419 100644 --- a/src/increase/types/oauth_connection.py +++ b/src/increase/types/oauth_connection.py @@ -9,6 +9,9 @@ class OauthConnection(BaseModel): + id: str + """The OAuth Connection's identifier.""" + created_at: datetime """ The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp when the OAuth @@ -18,9 +21,6 @@ class OauthConnection(BaseModel): group_id: str """The identifier of the Group that has authorized your OAuth application.""" - id: str - """The OAuth Connection's identifier.""" - status: Literal["active", "inactive"] """Whether the connection is active.""" diff --git a/src/increase/types/pending_transaction.py b/src/increase/types/pending_transaction.py index e32e28016..f581e3697 100644 --- a/src/increase/types/pending_transaction.py +++ b/src/increase/types/pending_transaction.py @@ -83,6 +83,9 @@ class SourceCardAuthorizationNetworkDetails(BaseModel): class SourceCardAuthorization(BaseModel): + id: str + """The Card Authorization identifier.""" + amount: int """The pending amount in the minor unit of the transaction's currency. @@ -107,9 +110,6 @@ class SourceCardAuthorization(BaseModel): will expire and the pending transaction will be released. """ - id: str - """The Card Authorization identifier.""" - merchant_acceptor_id: str """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -343,6 +343,9 @@ class Source(BaseModel): class PendingTransaction(BaseModel): + id: str + """The Pending Transaction identifier.""" + account_id: str """The identifier for the account this Pending Transaction belongs to.""" @@ -378,9 +381,6 @@ class PendingTransaction(BaseModel): the vendor provides. """ - id: str - """The Pending Transaction identifier.""" - route_id: Optional[str] """The identifier for the route this Pending Transaction came through. diff --git a/src/increase/types/program.py b/src/increase/types/program.py index 156ba5141..a2a8c9c9e 100644 --- a/src/increase/types/program.py +++ b/src/increase/types/program.py @@ -9,15 +9,15 @@ class Program(BaseModel): + id: str + """The Program identifier.""" + created_at: datetime """ The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Program was created. """ - id: str - """The Program identifier.""" - name: str """The name of the Program.""" diff --git a/src/increase/types/real_time_decision.py b/src/increase/types/real_time_decision.py index 0f6741ac2..b444c770a 100644 --- a/src/increase/types/real_time_decision.py +++ b/src/increase/types/real_time_decision.py @@ -12,8 +12,8 @@ "CardAuthorization", "CardAuthorizationNetworkDetails", "CardAuthorizationNetworkDetailsVisa", - "DigitalWalletToken", "DigitalWalletAuthentication", + "DigitalWalletToken", ] @@ -111,27 +111,6 @@ class CardAuthorization(BaseModel): """ -class DigitalWalletToken(BaseModel): - card_id: str - """The identifier of the Card that is being tokenized.""" - - card_profile_id: Optional[str] - """The identifier of the Card Profile that was set via the real time decision. - - This will be null until the real time decision is responded to or if the real - time decision did not set a card profile. - """ - - decision: Optional[Literal["approve", "decline"]] - """Whether or not the provisioning request was approved. - - This will be null until the real time decision is responded to. - """ - - digital_wallet: Literal["apple_pay", "google_pay"] - """The digital wallet app being used.""" - - class DigitalWalletAuthentication(BaseModel): card_id: str """The identifier of the Card that is being tokenized.""" @@ -158,7 +137,31 @@ class DigitalWalletAuthentication(BaseModel): """Whether your application successfully delivered the one-time passcode.""" +class DigitalWalletToken(BaseModel): + card_id: str + """The identifier of the Card that is being tokenized.""" + + card_profile_id: Optional[str] + """The identifier of the Card Profile that was set via the real time decision. + + This will be null until the real time decision is responded to or if the real + time decision did not set a card profile. + """ + + decision: Optional[Literal["approve", "decline"]] + """Whether or not the provisioning request was approved. + + This will be null until the real time decision is responded to. + """ + + digital_wallet: Literal["apple_pay", "google_pay"] + """The digital wallet app being used.""" + + class RealTimeDecision(BaseModel): + id: str + """The Real-Time Decision identifier.""" + card_authorization: Optional[CardAuthorization] """Fields related to a card authorization.""" @@ -179,9 +182,6 @@ class RealTimeDecision(BaseModel): digital_wallet_token: Optional[DigitalWalletToken] """Fields related to a digital wallet token provisioning attempt.""" - id: str - """The Real-Time Decision identifier.""" - status: Literal["pending", "responded", "timed_out"] """The status of the Real-Time Decision.""" diff --git a/src/increase/types/real_time_payments_transfer.py b/src/increase/types/real_time_payments_transfer.py index d25a5f101..130b3042f 100644 --- a/src/increase/types/real_time_payments_transfer.py +++ b/src/increase/types/real_time_payments_transfer.py @@ -6,7 +6,7 @@ from .._models import BaseModel -__all__ = ["RealTimePaymentsTransfer", "Approval", "Cancellation", "Submission", "Rejection"] +__all__ = ["RealTimePaymentsTransfer", "Approval", "Cancellation", "Rejection", "Submission"] class Approval(BaseModel): @@ -37,17 +37,6 @@ class Cancellation(BaseModel): """ -class Submission(BaseModel): - submitted_at: Optional[datetime] - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the transfer was submitted to The Clearing House. - """ - - transaction_identification: str - """The Real Time Payments network identification of the transfer.""" - - class Rejection(BaseModel): reject_reason_additional_information: Optional[str] """ @@ -90,7 +79,21 @@ class Rejection(BaseModel): """ +class Submission(BaseModel): + submitted_at: Optional[datetime] + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was submitted to The Clearing House. + """ + + transaction_identification: str + """The Real Time Payments network identification of the transfer.""" + + class RealTimePaymentsTransfer(BaseModel): + id: str + """The Real Time Payments Transfer's identifier.""" + account_id: str """The Account from which the transfer was sent.""" @@ -136,9 +139,6 @@ class RealTimePaymentsTransfer(BaseModel): external_account_id: Optional[str] """The identifier of the External Account the transfer was made to, if any.""" - id: str - """The Real Time Payments Transfer's identifier.""" - rejection: Optional[Rejection] """ If the transfer is rejected by Real Time Payments or the destination financial diff --git a/src/increase/types/simulations/ach_transfer_simulation.py b/src/increase/types/simulations/ach_transfer_simulation.py index 19f7e5b68..1d30f9710 100644 --- a/src/increase/types/simulations/ach_transfer_simulation.py +++ b/src/increase/types/simulations/ach_transfer_simulation.py @@ -9,6 +9,16 @@ __all__ = [ "ACHTransferSimulation", + "DeclinedTransaction", + "DeclinedTransactionSource", + "DeclinedTransactionSourceACHDecline", + "DeclinedTransactionSourceCardDecline", + "DeclinedTransactionSourceCardDeclineNetworkDetails", + "DeclinedTransactionSourceCardDeclineNetworkDetailsVisa", + "DeclinedTransactionSourceCheckDecline", + "DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline", + "DeclinedTransactionSourceInternationalACHDecline", + "DeclinedTransactionSourceWireDecline", "Transaction", "TransactionSource", "TransactionSourceAccountTransferIntention", @@ -41,813 +51,930 @@ "TransactionSourceSampleFunds", "TransactionSourceWireTransferIntention", "TransactionSourceWireTransferRejection", - "DeclinedTransaction", - "DeclinedTransactionSource", - "DeclinedTransactionSourceACHDecline", - "DeclinedTransactionSourceCardDecline", - "DeclinedTransactionSourceCardDeclineNetworkDetails", - "DeclinedTransactionSourceCardDeclineNetworkDetailsVisa", - "DeclinedTransactionSourceCheckDecline", - "DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline", - "DeclinedTransactionSourceInternationalACHDecline", - "DeclinedTransactionSourceWireDecline", ] -class TransactionSourceAccountTransferIntention(BaseModel): - amount: int - """The pending amount in the minor unit of the transaction's currency. - - For dollars, for example, this is cents. - """ - - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - account currency. - """ - - description: str - """The description you chose to give the transfer.""" - - destination_account_id: str - """The identifier of the Account to where the Account Transfer was sent.""" - - source_account_id: str - """The identifier of the Account from where the Account Transfer was sent.""" - - transfer_id: str - """The identifier of the Account Transfer that led to this Pending Transaction.""" - - -class TransactionSourceACHTransferIntention(BaseModel): - account_number: str - +class DeclinedTransactionSourceACHDecline(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - routing_number: str - - statement_descriptor: str - - transfer_id: str - """The identifier of the ACH Transfer that led to this Transaction.""" - - -class TransactionSourceACHTransferRejection(BaseModel): - transfer_id: str - """The identifier of the ACH Transfer that led to this Transaction.""" + originator_company_descriptive_date: Optional[str] + originator_company_discretionary_data: Optional[str] -class TransactionSourceACHTransferReturn(BaseModel): - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the transfer was created. - """ + originator_company_id: str - raw_return_reason_code: str - """The three character ACH return code, in the range R01 to R85.""" + originator_company_name: str - return_reason_code: Literal[ - "insufficient_fund", - "no_account", - "account_closed", - "invalid_account_number_structure", - "account_frozen_entry_returned_per_ofac_instruction", + reason: Literal[ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", "credit_entry_refused_by_receiver", - "unauthorized_debit_to_consumer_account_using_corporate_sec_code", - "corporate_customer_advised_not_authorized", - "payment_stopped", - "non_transaction_account", - "uncollected_funds", - "routing_number_check_digit_error", - "customer_advised_unauthorized_improper_ineligible_or_incomplete", - "amount_field_error", - "authorization_revoked_by_customer", - "invalid_ach_routing_number", - "file_record_edit_criteria", - "enr_invalid_individual_name", - "returned_per_odfi_request", - "limited_participation_dfi", - "incorrectly_coded_outbound_international_payment", - "account_sold_to_another_dfi", - "addenda_error", - "beneficiary_or_account_holder_deceased", - "customer_advised_not_within_authorization_terms", - "corrected_return", - "duplicate_entry", "duplicate_return", - "enr_duplicate_enrollment", - "enr_invalid_dfi_account_number", - "enr_invalid_individual_id_number", - "enr_invalid_representative_payee_indicator", - "enr_invalid_transaction_code", - "enr_return_of_enr_entry", - "enr_routing_number_check_digit_error", - "entry_not_processed_by_gateway", - "field_error", - "foreign_receiving_dfi_unable_to_settle", - "iat_entry_coding_error", - "improper_effective_entry_date", - "improper_source_document_source_document_presented", - "invalid_company_id", - "invalid_foreign_receiving_dfi_identification", - "invalid_individual_id_number", - "item_and_rck_entry_presented_for_payment", - "item_related_to_rck_entry_is_ineligible", - "mandatory_field_error", - "misrouted_dishonored_return", + "entity_not_active", + "group_locked", + "insufficient_funds", "misrouted_return", - "no_errors_found", - "non_acceptance_of_r62_dishonored_return", - "non_participant_in_iat_program", - "permissible_return_entry", - "permissible_return_entry_not_accepted", - "rdfi_non_settlement", - "rdfi_participant_in_check_truncation_program", - "representative_payee_deceased_or_unable_to_continue_in_that_capacity", - "return_not_a_duplicate", - "return_of_erroneous_or_reversing_debit", - "return_of_improper_credit_entry", - "return_of_improper_debit_entry", - "return_of_xck_entry", - "source_document_presented_for_payment", - "state_law_affecting_rck_acceptance", - "stop_payment_on_item_related_to_rck_entry", - "stop_payment_on_source_document", - "timely_original_return", - "trace_number_error", - "untimely_dishonored_return", - "untimely_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed", ] - """Why the ACH Transfer was returned.""" + """Why the ACH transfer was declined.""" - transaction_id: str - """The identifier of the Tranasaction associated with this return.""" + receiver_id_number: Optional[str] - transfer_id: str - """The identifier of the ACH Transfer associated with this return.""" + receiver_name: Optional[str] + trace_number: str -class TransactionSourceCardDisputeAcceptance(BaseModel): - accepted_at: datetime + +class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): + electronic_commerce_indicator: Optional[ + Literal[ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction", + ] + ] """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the Card Dispute was accepted. + For electronic commerce transactions, this identifies the level of security used + in obtaining the customer's payment credential. For mail or telephone order + transactions, identifies the type of mail or telephone order. """ - card_dispute_id: str - """The identifier of the Card Dispute that was accepted.""" - - transaction_id: str + point_of_service_entry_mode: Optional[shared.PointOfServiceEntryMode] """ - The identifier of the Transaction that was created to return the disputed funds - to your account. + The method used to enter the cardholder's primary account number and card + expiration date """ -class TransactionSourceCardRefund(BaseModel): +class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): + visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa + """Fields specific to the `visa` network""" + + +class DeclinedTransactionSourceCardDecline(BaseModel): amount: int - """The pending amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + account currency. """ - id: str - """The Card Refund identifier.""" + digital_wallet_token_id: Optional[str] + """ + If the authorization was attempted using a Digital Wallet Token (such as an + Apple Pay purchase), the identifier of the token that was used. + """ - merchant_acceptor_id: Optional[str] + merchant_acceptor_id: str """ The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with. """ - merchant_category_code: str - """The 4-digit MCC describing the merchant's business.""" + merchant_category_code: Optional[str] + """ + The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + card is transacting with. + """ merchant_city: Optional[str] """The city the merchant resides in.""" - merchant_country: str + merchant_country: Optional[str] """The country the merchant resides in.""" - merchant_name: Optional[str] - """The name of the merchant.""" + merchant_descriptor: str + """The merchant descriptor of the merchant the card is transacting with.""" merchant_state: Optional[str] """The state the merchant resides in.""" - type: Literal["card_refund"] - """A constant representing the object's type. - - For this resource it will always be `card_refund`. - """ - - -class TransactionSourceCardRevenuePayment(BaseModel): - amount: int - """The amount in the minor unit of the transaction's currency. + network: Literal["visa"] + """The payment network used to process this card authorization""" - For dollars, for example, this is cents. - """ + network_details: DeclinedTransactionSourceCardDeclineNetworkDetails + """Fields specific to the `network`""" - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + real_time_decision_id: Optional[str] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - currency. + The identifier of the Real-Time Decision sent to approve or decline this + transaction. """ - period_end: datetime - """The end of the period for which this transaction paid interest.""" - - period_start: datetime - """The start of the period for which this transaction paid interest.""" - - transacted_on_account_id: Optional[str] - """The account the card belonged to.""" + reason: Literal[ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_internal_limit", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization", + ] + """Why the transaction was declined.""" -class TransactionSourceCardSettlement(BaseModel): +class DeclinedTransactionSourceCheckDecline(BaseModel): amount: int - """The amount in the minor unit of the transaction's settlement currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - card_authorization: Optional[str] - """ - The Card Authorization that was created prior to this Card Settlement, if on - exists. - """ + auxiliary_on_us: Optional[str] - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's settlement currency. + reason: Literal[ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "not_our_item", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized", + "altered_or_fictitious", + ] + """Why the check was declined.""" + + +class DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline(BaseModel): + amount: int + """The declined amount in the minor unit of the destination account currency. + + For dollars, for example, this is cents. """ - id: str - """The Card Settlement identifier.""" + creditor_name: str + """The name the sender of the transfer specified as the recipient of the transfer.""" - merchant_acceptor_id: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The merchant identifier (commonly abbreviated as MID) of the merchant the card - is transacting with. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined + transfer's currency. This will always be "USD" for a Real Time Payments + transfer. """ - merchant_category_code: str - """The 4-digit MCC describing the merchant's business.""" + debtor_account_number: str + """The account number of the account that sent the transfer.""" - merchant_city: Optional[str] - """The city the merchant resides in.""" + debtor_name: str + """The name provided by the sender of the transfer.""" - merchant_country: str - """The country the merchant resides in.""" + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" - merchant_name: Optional[str] - """The name of the merchant.""" + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "account_restricted", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled", + ] + """Why the transfer was declined.""" - merchant_state: Optional[str] - """The state the merchant resides in.""" + remittance_information: Optional[str] + """Additional information included with the transfer.""" - pending_transaction_id: Optional[str] - """The identifier of the Pending Transaction associated with this Transaction.""" + transaction_identification: str + """The Real Time Payments network identification of the declined transfer.""" - presentment_amount: int - """The amount in the minor unit of the transaction's presentment currency.""" - presentment_currency: str - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's presentment currency. +class DeclinedTransactionSourceInternationalACHDecline(BaseModel): + amount: int + """The declined amount in the minor unit of the destination account currency. + + For dollars, for example, this is cents. """ - type: Literal["card_settlement"] - """A constant representing the object's type. + destination_country_code: str - For this resource it will always be `card_settlement`. - """ + destination_currency_code: str + foreign_exchange_indicator: str -class TransactionSourceCheckDepositAcceptance(BaseModel): - account_number: str - """The account number printed on the check.""" + foreign_exchange_reference: Optional[str] - amount: int - """The amount to be deposited in the minor unit of the transaction's currency. + foreign_exchange_reference_indicator: str - For dollars, for example, this is cents. - """ + foreign_payment_amount: int - auxiliary_on_us: Optional[str] - """An additional line of metadata printed on the check. + foreign_trace_number: Optional[str] - This typically includes the check number for business checks. - """ + international_transaction_type_code: str - check_deposit_id: str - """The ID of the Check Deposit that was accepted.""" + originating_currency_code: str - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. - """ + originating_depository_financial_institution_branch_country: str - routing_number: str - """The routing number printed on the check.""" + originating_depository_financial_institution_id: str - serial_number: Optional[str] - """The check serial number, if present, for consumer checks. + originating_depository_financial_institution_id_qualifier: str - For business checks, the serial number is usually in the `auxiliary_on_us` - field. - """ + originating_depository_financial_institution_name: str + originator_city: str -class TransactionSourceCheckDepositReturn(BaseModel): - amount: int - """The amount in the minor unit of the transaction's currency. + originator_company_entry_description: str - For dollars, for example, this is cents. - """ + originator_country: str - check_deposit_id: str - """The identifier of the Check Deposit that was returned.""" + originator_identification: str - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. - """ + originator_name: str - return_reason: Literal[ - "ach_conversion_not_supported", - "closed_account", - "duplicate_submission", - "insufficient_funds", - "no_account", - "not_authorized", - "stale_dated", - "stop_payment", - "unknown_reason", - "unmatched_details", - "unreadable_image", - "endorsement_irregular", - ] + originator_postal_code: Optional[str] - returned_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the check deposit was returned. - """ + originator_state_or_province: Optional[str] - transaction_id: str - """ - The identifier of the transaction that reversed the original check deposit - transaction. - """ + originator_street_address: str + payment_related_information: Optional[str] -class TransactionSourceCheckTransferDeposit(BaseModel): - back_image_file_id: Optional[str] - """ - The identifier of the API File object containing an image of the back of the - deposited check. - """ + payment_related_information2: Optional[str] - deposited_at: datetime - """When the check was deposited.""" + receiver_city: str - front_image_file_id: Optional[str] - """ - The identifier of the API File object containing an image of the front of the - deposited check. - """ + receiver_country: str - type: Literal["check_transfer_deposit"] - """A constant representing the object's type. + receiver_identification_number: Optional[str] - For this resource it will always be `check_transfer_deposit`. - """ + receiver_postal_code: Optional[str] + receiver_state_or_province: Optional[str] -class TransactionSourceCheckTransferIntention(BaseModel): - address_city: Optional[str] - """The city of the check's destination.""" + receiver_street_address: str - address_line1: Optional[str] - """The street address of the check's destination.""" + receiving_company_or_individual_name: str - address_line2: Optional[str] - """The second line of the address of the check's destination.""" + receiving_depository_financial_institution_country: str - address_state: Optional[str] - """The state of the check's destination.""" + receiving_depository_financial_institution_id: str - address_zip: Optional[str] - """The postal code of the check's destination.""" + receiving_depository_financial_institution_id_qualifier: str + + receiving_depository_financial_institution_name: str + + trace_number: str + +class DeclinedTransactionSourceWireDecline(BaseModel): amount: int - """The transfer amount in USD cents.""" + """The declined amount in the minor unit of the destination account currency. - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's - currency. + For dollars, for example, this is cents. """ - recipient_name: Optional[str] - """The name that will be printed on the check.""" + beneficiary_address_line1: Optional[str] - transfer_id: str - """The identifier of the Check Transfer with which this is associated.""" + beneficiary_address_line2: Optional[str] + beneficiary_address_line3: Optional[str] -class TransactionSourceCheckTransferRejection(BaseModel): - transfer_id: str - """The identifier of the Check Transfer that led to this Transaction.""" + beneficiary_name: Optional[str] + beneficiary_reference: Optional[str] -class TransactionSourceCheckTransferReturn(BaseModel): - file_id: Optional[str] - """If available, a document with additional information about the return.""" + description: str - reason: Literal["mail_delivery_failure", "refused_by_recipient", "returned_not_authorized"] - """The reason why the check was returned.""" + input_message_accountability_data: Optional[str] - returned_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the check was returned. + originator_address_line1: Optional[str] + + originator_address_line2: Optional[str] + + originator_address_line3: Optional[str] + + originator_name: Optional[str] + + originator_to_beneficiary_information_line1: Optional[str] + + originator_to_beneficiary_information_line2: Optional[str] + + originator_to_beneficiary_information_line3: Optional[str] + + originator_to_beneficiary_information_line4: Optional[str] + + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "entity_not_active", + "group_locked", + "no_account_number", + "transaction_not_allowed", + ] + """Why the wire transfer was declined.""" + + +class DeclinedTransactionSource(BaseModel): + ach_decline: Optional[DeclinedTransactionSourceACHDecline] + """A ACH Decline object. + + This field will be present in the JSON response if and only if `category` is + equal to `ach_decline`. """ - transaction_id: Optional[str] + card_decline: Optional[DeclinedTransactionSourceCardDecline] + """A Card Decline object. + + This field will be present in the JSON response if and only if `category` is + equal to `card_decline`. """ - The identifier of the Transaction that was created to credit you for the - returned check. + + category: Literal[ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "wire_decline", + "other", + ] + """The type of decline that took place. + + We may add additional possible values for this enum over time; your application + should be able to handle such additions gracefully. """ - transfer_id: str - """The identifier of the returned Check Transfer.""" + check_decline: Optional[DeclinedTransactionSourceCheckDecline] + """A Check Decline object. + This field will be present in the JSON response if and only if `category` is + equal to `check_decline`. + """ -class TransactionSourceCheckTransferStopPaymentRequest(BaseModel): - requested_at: datetime - """The time the stop-payment was requested.""" + inbound_real_time_payments_transfer_decline: Optional[ + DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline + ] + """A Inbound Real Time Payments Transfer Decline object. - transaction_id: str - """The transaction ID of the corresponding credit transaction.""" + This field will be present in the JSON response if and only if `category` is + equal to `inbound_real_time_payments_transfer_decline`. + """ - transfer_id: str - """The ID of the check transfer that was stopped.""" + international_ach_decline: Optional[DeclinedTransactionSourceInternationalACHDecline] + """A International ACH Decline object. - type: Literal["check_transfer_stop_payment_request"] - """A constant representing the object's type. + This field will be present in the JSON response if and only if `category` is + equal to `international_ach_decline`. + """ - For this resource it will always be `check_transfer_stop_payment_request`. + wire_decline: Optional[DeclinedTransactionSourceWireDecline] + """A Wire Decline object. + + This field will be present in the JSON response if and only if `category` is + equal to `wire_decline`. """ -class TransactionSourceFeePayment(BaseModel): +class DeclinedTransaction(BaseModel): + id: str + """The Declined Transaction identifier.""" + + account_id: str + """The identifier for the Account the Declined Transaction belongs to.""" + amount: int - """The amount in the minor unit of the transaction's currency. + """The Declined Transaction amount in the minor unit of its currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + created_at: datetime """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - currency. + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the + Transaction occured. """ - -class TransactionSourceInboundACHTransfer(BaseModel): - amount: int - """The amount in the minor unit of the destination account currency. - - For dollars, for example, this is cents. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined + Transaction's currency. This will match the currency on the Declined + Transcation's Account. """ - originator_company_descriptive_date: Optional[str] - - originator_company_discretionary_data: Optional[str] + description: str + """This is the description the vendor provides.""" - originator_company_entry_description: str + route_id: Optional[str] + """The identifier for the route this Declined Transaction came through. - originator_company_id: str + Routes are things like cards and ACH details. + """ - originator_company_name: str + route_type: Optional[Literal["account_number", "card"]] + """The type of the route this Declined Transaction came through.""" - receiver_id_number: Optional[str] + source: DeclinedTransactionSource + """ + This is an object giving more details on the network-level event that caused the + Declined Transaction. For example, for a card transaction this lists the + merchant's industry and location. Note that for backwards compatibility reasons, + additional undocumented keys may appear in this object. These should be treated + as deprecated and will be removed in the future. + """ - receiver_name: Optional[str] + type: Literal["declined_transaction"] + """A constant representing the object's type. - trace_number: str + For this resource it will always be `declined_transaction`. + """ -class TransactionSourceInboundCheck(BaseModel): +class TransactionSourceAccountTransferIntention(BaseModel): amount: int - """The amount in the minor unit of the destination account currency. + """The pending amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - check_front_image_file_id: Optional[str] - - check_number: Optional[str] - - check_rear_image_file_id: Optional[str] - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + account currency. """ + description: str + """The description you chose to give the transfer.""" -class TransactionSourceInboundInternationalACHTransfer(BaseModel): - amount: int - """The amount in the minor unit of the destination account currency. - - For dollars, for example, this is cents. - """ - - destination_country_code: str + destination_account_id: str + """The identifier of the Account to where the Account Transfer was sent.""" - destination_currency_code: str + source_account_id: str + """The identifier of the Account from where the Account Transfer was sent.""" - foreign_exchange_indicator: str + transfer_id: str + """The identifier of the Account Transfer that led to this Pending Transaction.""" - foreign_exchange_reference: Optional[str] - foreign_exchange_reference_indicator: str +class TransactionSourceACHTransferIntention(BaseModel): + account_number: str - foreign_payment_amount: int + amount: int + """The amount in the minor unit of the transaction's currency. - foreign_trace_number: Optional[str] + For dollars, for example, this is cents. + """ - international_transaction_type_code: str + routing_number: str - originating_currency_code: str + statement_descriptor: str - originating_depository_financial_institution_branch_country: str + transfer_id: str + """The identifier of the ACH Transfer that led to this Transaction.""" - originating_depository_financial_institution_id: str - originating_depository_financial_institution_id_qualifier: str +class TransactionSourceACHTransferRejection(BaseModel): + transfer_id: str + """The identifier of the ACH Transfer that led to this Transaction.""" - originating_depository_financial_institution_name: str - originator_city: str +class TransactionSourceACHTransferReturn(BaseModel): + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was created. + """ - originator_company_entry_description: str + raw_return_reason_code: str + """The three character ACH return code, in the range R01 to R85.""" - originator_country: str + return_reason_code: Literal[ + "insufficient_fund", + "no_account", + "account_closed", + "invalid_account_number_structure", + "account_frozen_entry_returned_per_ofac_instruction", + "credit_entry_refused_by_receiver", + "unauthorized_debit_to_consumer_account_using_corporate_sec_code", + "corporate_customer_advised_not_authorized", + "payment_stopped", + "non_transaction_account", + "uncollected_funds", + "routing_number_check_digit_error", + "customer_advised_unauthorized_improper_ineligible_or_incomplete", + "amount_field_error", + "authorization_revoked_by_customer", + "invalid_ach_routing_number", + "file_record_edit_criteria", + "enr_invalid_individual_name", + "returned_per_odfi_request", + "limited_participation_dfi", + "incorrectly_coded_outbound_international_payment", + "account_sold_to_another_dfi", + "addenda_error", + "beneficiary_or_account_holder_deceased", + "customer_advised_not_within_authorization_terms", + "corrected_return", + "duplicate_entry", + "duplicate_return", + "enr_duplicate_enrollment", + "enr_invalid_dfi_account_number", + "enr_invalid_individual_id_number", + "enr_invalid_representative_payee_indicator", + "enr_invalid_transaction_code", + "enr_return_of_enr_entry", + "enr_routing_number_check_digit_error", + "entry_not_processed_by_gateway", + "field_error", + "foreign_receiving_dfi_unable_to_settle", + "iat_entry_coding_error", + "improper_effective_entry_date", + "improper_source_document_source_document_presented", + "invalid_company_id", + "invalid_foreign_receiving_dfi_identification", + "invalid_individual_id_number", + "item_and_rck_entry_presented_for_payment", + "item_related_to_rck_entry_is_ineligible", + "mandatory_field_error", + "misrouted_dishonored_return", + "misrouted_return", + "no_errors_found", + "non_acceptance_of_r62_dishonored_return", + "non_participant_in_iat_program", + "permissible_return_entry", + "permissible_return_entry_not_accepted", + "rdfi_non_settlement", + "rdfi_participant_in_check_truncation_program", + "representative_payee_deceased_or_unable_to_continue_in_that_capacity", + "return_not_a_duplicate", + "return_of_erroneous_or_reversing_debit", + "return_of_improper_credit_entry", + "return_of_improper_debit_entry", + "return_of_xck_entry", + "source_document_presented_for_payment", + "state_law_affecting_rck_acceptance", + "stop_payment_on_item_related_to_rck_entry", + "stop_payment_on_source_document", + "timely_original_return", + "trace_number_error", + "untimely_dishonored_return", + "untimely_return", + ] + """Why the ACH Transfer was returned.""" - originator_identification: str + transaction_id: str + """The identifier of the Tranasaction associated with this return.""" - originator_name: str + transfer_id: str + """The identifier of the ACH Transfer associated with this return.""" - originator_postal_code: Optional[str] - originator_state_or_province: Optional[str] +class TransactionSourceCardDisputeAcceptance(BaseModel): + accepted_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the Card Dispute was accepted. + """ - originator_street_address: str + card_dispute_id: str + """The identifier of the Card Dispute that was accepted.""" - payment_related_information: Optional[str] + transaction_id: str + """ + The identifier of the Transaction that was created to return the disputed funds + to your account. + """ - payment_related_information2: Optional[str] - receiver_city: str +class TransactionSourceCardRefund(BaseModel): + id: str + """The Card Refund identifier.""" - receiver_country: str + amount: int + """The pending amount in the minor unit of the transaction's currency. - receiver_identification_number: Optional[str] + For dollars, for example, this is cents. + """ - receiver_postal_code: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - receiver_state_or_province: Optional[str] + merchant_acceptor_id: Optional[str] + """ + The merchant identifier (commonly abbreviated as MID) of the merchant the card + is transacting with. + """ - receiver_street_address: str + merchant_category_code: str + """The 4-digit MCC describing the merchant's business.""" - receiving_company_or_individual_name: str + merchant_city: Optional[str] + """The city the merchant resides in.""" - receiving_depository_financial_institution_country: str + merchant_country: str + """The country the merchant resides in.""" - receiving_depository_financial_institution_id: str + merchant_name: Optional[str] + """The name of the merchant.""" - receiving_depository_financial_institution_id_qualifier: str + merchant_state: Optional[str] + """The state the merchant resides in.""" - receiving_depository_financial_institution_name: str + type: Literal["card_refund"] + """A constant representing the object's type. - trace_number: str + For this resource it will always be `card_refund`. + """ -class TransactionSourceInboundRealTimePaymentsTransferConfirmation(BaseModel): +class TransactionSourceCardRevenuePayment(BaseModel): amount: int - """The amount in the minor unit of the transfer's currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - creditor_name: str - """The name the sender of the transfer specified as the recipient of the transfer.""" - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's - currency. This will always be "USD" for a Real Time Payments transfer. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + currency. """ - debtor_account_number: str - """The account number of the account that sent the transfer.""" - - debtor_name: str - """The name provided by the sender of the transfer.""" + period_end: datetime + """The end of the period for which this transaction paid interest.""" - debtor_routing_number: str - """The routing number of the account that sent the transfer.""" + period_start: datetime + """The start of the period for which this transaction paid interest.""" - remittance_information: Optional[str] - """Additional information included with the transfer.""" + transacted_on_account_id: Optional[str] + """The account the card belonged to.""" - transaction_identification: str - """The Real Time Payments network identification of the transfer""" +class TransactionSourceCardSettlement(BaseModel): + id: str + """The Card Settlement identifier.""" -class TransactionSourceInboundWireDrawdownPayment(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The amount in the minor unit of the transaction's settlement currency. For dollars, for example, this is cents. """ - beneficiary_address_line1: Optional[str] + card_authorization: Optional[str] + """ + The Card Authorization that was created prior to this Card Settlement, if on + exists. + """ - beneficiary_address_line2: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's settlement currency. + """ - beneficiary_address_line3: Optional[str] + merchant_acceptor_id: Optional[str] + """ + The merchant identifier (commonly abbreviated as MID) of the merchant the card + is transacting with. + """ - beneficiary_name: Optional[str] + merchant_category_code: str + """The 4-digit MCC describing the merchant's business.""" - beneficiary_reference: Optional[str] + merchant_city: Optional[str] + """The city the merchant resides in.""" - description: str + merchant_country: str + """The country the merchant resides in.""" - input_message_accountability_data: Optional[str] + merchant_name: Optional[str] + """The name of the merchant.""" - originator_address_line1: Optional[str] + merchant_state: Optional[str] + """The state the merchant resides in.""" - originator_address_line2: Optional[str] + pending_transaction_id: Optional[str] + """The identifier of the Pending Transaction associated with this Transaction.""" - originator_address_line3: Optional[str] + presentment_amount: int + """The amount in the minor unit of the transaction's presentment currency.""" - originator_name: Optional[str] + presentment_currency: str + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's presentment currency. + """ - originator_to_beneficiary_information: Optional[str] + type: Literal["card_settlement"] + """A constant representing the object's type. + For this resource it will always be `card_settlement`. + """ -class TransactionSourceInboundWireDrawdownPaymentReversal(BaseModel): - amount: int - """The amount that was reversed.""" - description: str - """The description on the reversal message from Fedwire.""" +class TransactionSourceCheckDepositAcceptance(BaseModel): + account_number: str + """The account number printed on the check.""" - input_cycle_date: date - """The Fedwire cycle date for the wire reversal.""" + amount: int + """The amount to be deposited in the minor unit of the transaction's currency. - input_message_accountability_data: str - """The Fedwire transaction identifier.""" + For dollars, for example, this is cents. + """ - input_sequence_number: str - """The Fedwire sequence number.""" + auxiliary_on_us: Optional[str] + """An additional line of metadata printed on the check. - input_source: str - """The Fedwire input source identifier.""" + This typically includes the check number for business checks. + """ - previous_message_input_cycle_date: date - """The Fedwire cycle date for the wire transfer that was reversed.""" + check_deposit_id: str + """The ID of the Check Deposit that was accepted.""" - previous_message_input_message_accountability_data: str - """The Fedwire transaction identifier for the wire transfer that was reversed.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - previous_message_input_sequence_number: str - """The Fedwire sequence number for the wire transfer that was reversed.""" + routing_number: str + """The routing number printed on the check.""" - previous_message_input_source: str - """The Fedwire input source identifier for the wire transfer that was reversed.""" + serial_number: Optional[str] + """The check serial number, if present, for consumer checks. + + For business checks, the serial number is usually in the `auxiliary_on_us` + field. + """ -class TransactionSourceInboundWireReversal(BaseModel): +class TransactionSourceCheckDepositReturn(BaseModel): amount: int - """The amount that was reversed.""" + """The amount in the minor unit of the transaction's currency. - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the reversal was created. + For dollars, for example, this is cents. """ - description: str - """The description on the reversal message from Fedwire.""" + check_deposit_id: str + """The identifier of the Check Deposit that was returned.""" - financial_institution_to_financial_institution_information: Optional[str] - """Additional financial institution information included in the wire reversal.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - input_cycle_date: date - """The Fedwire cycle date for the wire reversal.""" + return_reason: Literal[ + "ach_conversion_not_supported", + "closed_account", + "duplicate_submission", + "insufficient_funds", + "no_account", + "not_authorized", + "stale_dated", + "stop_payment", + "unknown_reason", + "unmatched_details", + "unreadable_image", + "endorsement_irregular", + ] - input_message_accountability_data: str - """The Fedwire transaction identifier.""" + returned_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the check deposit was returned. + """ - input_sequence_number: str - """The Fedwire sequence number.""" + transaction_id: str + """ + The identifier of the transaction that reversed the original check deposit + transaction. + """ - input_source: str - """The Fedwire input source identifier.""" - previous_message_input_cycle_date: date - """The Fedwire cycle date for the wire transfer that was reversed.""" +class TransactionSourceCheckTransferDeposit(BaseModel): + back_image_file_id: Optional[str] + """ + The identifier of the API File object containing an image of the back of the + deposited check. + """ - previous_message_input_message_accountability_data: str - """The Fedwire transaction identifier for the wire transfer that was reversed.""" + deposited_at: datetime + """When the check was deposited.""" - previous_message_input_sequence_number: str - """The Fedwire sequence number for the wire transfer that was reversed.""" + front_image_file_id: Optional[str] + """ + The identifier of the API File object containing an image of the front of the + deposited check. + """ - previous_message_input_source: str - """The Fedwire input source identifier for the wire transfer that was reversed.""" + type: Literal["check_transfer_deposit"] + """A constant representing the object's type. - receiver_financial_institution_information: Optional[str] - """ - Information included in the wire reversal for the receiving financial - institution. + For this resource it will always be `check_transfer_deposit`. """ - transaction_id: Optional[str] - """The ID for the Transaction associated with the transfer reversal.""" - wire_transfer_id: str - """The ID for the Wire Transfer that is being reversed.""" +class TransactionSourceCheckTransferIntention(BaseModel): + address_city: Optional[str] + """The city of the check's destination.""" + address_line1: Optional[str] + """The street address of the check's destination.""" + + address_line2: Optional[str] + """The second line of the address of the check's destination.""" + + address_state: Optional[str] + """The state of the check's destination.""" + + address_zip: Optional[str] + """The postal code of the check's destination.""" -class TransactionSourceInboundWireTransfer(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The transfer amount in USD cents.""" - For dollars, for example, this is cents. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's + currency. """ - beneficiary_address_line1: Optional[str] - - beneficiary_address_line2: Optional[str] + recipient_name: Optional[str] + """The name that will be printed on the check.""" - beneficiary_address_line3: Optional[str] + transfer_id: str + """The identifier of the Check Transfer with which this is associated.""" - beneficiary_name: Optional[str] - beneficiary_reference: Optional[str] +class TransactionSourceCheckTransferRejection(BaseModel): + transfer_id: str + """The identifier of the Check Transfer that led to this Transaction.""" - description: str - input_message_accountability_data: Optional[str] +class TransactionSourceCheckTransferReturn(BaseModel): + file_id: Optional[str] + """If available, a document with additional information about the return.""" - originator_address_line1: Optional[str] + reason: Literal["mail_delivery_failure", "refused_by_recipient", "returned_not_authorized"] + """The reason why the check was returned.""" - originator_address_line2: Optional[str] + returned_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the check was returned. + """ - originator_address_line3: Optional[str] + transaction_id: Optional[str] + """ + The identifier of the Transaction that was created to credit you for the + returned check. + """ - originator_name: Optional[str] + transfer_id: str + """The identifier of the returned Check Transfer.""" - originator_to_beneficiary_information: Optional[str] - originator_to_beneficiary_information_line1: Optional[str] +class TransactionSourceCheckTransferStopPaymentRequest(BaseModel): + requested_at: datetime + """The time the stop-payment was requested.""" - originator_to_beneficiary_information_line2: Optional[str] + transaction_id: str + """The transaction ID of the corresponding credit transaction.""" - originator_to_beneficiary_information_line3: Optional[str] + transfer_id: str + """The ID of the check transfer that was stopped.""" - originator_to_beneficiary_information_line4: Optional[str] + type: Literal["check_transfer_stop_payment_request"] + """A constant representing the object's type. + For this resource it will always be `check_transfer_stop_payment_request`. + """ -class TransactionSourceInterestPayment(BaseModel): - accrued_on_account_id: Optional[str] - """The account on which the interest was accrued.""" +class TransactionSourceFeePayment(BaseModel): amount: int """The amount in the minor unit of the transaction's currency. @@ -860,802 +987,675 @@ class TransactionSourceInterestPayment(BaseModel): currency. """ - period_end: datetime - """The end of the period for which this transaction paid interest.""" - - period_start: datetime - """The start of the period for which this transaction paid interest.""" - -class TransactionSourceInternalSource(BaseModel): +class TransactionSourceInboundACHTransfer(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - currency. - """ - - reason: Literal[ - "account_closure", - "bank_migration", - "cashback", - "collection_receivable", - "empyreal_adjustment", - "error", - "error_correction", - "fees", - "interest", - "negative_balance_forgiveness", - "sample_funds", - "sample_funds_return", - ] - - -class TransactionSourceRealTimePaymentsTransferAcknowledgement(BaseModel): - amount: int - """The transfer amount in USD cents.""" + originator_company_descriptive_date: Optional[str] - destination_account_number: str - """The destination account number.""" + originator_company_discretionary_data: Optional[str] - destination_routing_number: str - """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" + originator_company_entry_description: str - remittance_information: str - """Unstructured information that will show on the recipient's bank statement.""" + originator_company_id: str - transfer_id: str - """The identifier of the Real Time Payments Transfer that led to this Transaction.""" + originator_company_name: str + receiver_id_number: Optional[str] -class TransactionSourceSampleFunds(BaseModel): - originator: str - """Where the sample funds came from.""" + receiver_name: Optional[str] + trace_number: str -class TransactionSourceWireTransferIntention(BaseModel): - account_number: str - """The destination account number.""" +class TransactionSourceInboundCheck(BaseModel): amount: int - """The transfer amount in USD cents.""" - - message_to_recipient: str - """The message that will show on the recipient's bank statement.""" - - routing_number: str - """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" - - transfer_id: str + """The amount in the minor unit of the destination account currency. + For dollars, for example, this is cents. + """ -class TransactionSourceWireTransferRejection(BaseModel): - transfer_id: str + check_front_image_file_id: Optional[str] + check_number: Optional[str] -class TransactionSource(BaseModel): - account_transfer_intention: Optional[TransactionSourceAccountTransferIntention] - """A Account Transfer Intention object. + check_rear_image_file_id: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `account_transfer_intention`. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - - ach_transfer_intention: Optional[TransactionSourceACHTransferIntention] - """A ACH Transfer Intention object. - - This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_intention`. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. """ - ach_transfer_rejection: Optional[TransactionSourceACHTransferRejection] - """A ACH Transfer Rejection object. - - This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_rejection`. - """ - ach_transfer_return: Optional[TransactionSourceACHTransferReturn] - """A ACH Transfer Return object. +class TransactionSourceInboundInternationalACHTransfer(BaseModel): + amount: int + """The amount in the minor unit of the destination account currency. - This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_return`. + For dollars, for example, this is cents. """ - card_dispute_acceptance: Optional[TransactionSourceCardDisputeAcceptance] - """A Card Dispute Acceptance object. + destination_country_code: str - This field will be present in the JSON response if and only if `category` is - equal to `card_dispute_acceptance`. - """ + destination_currency_code: str - card_refund: Optional[TransactionSourceCardRefund] - """A Card Refund object. + foreign_exchange_indicator: str - This field will be present in the JSON response if and only if `category` is - equal to `card_refund`. - """ + foreign_exchange_reference: Optional[str] - card_revenue_payment: Optional[TransactionSourceCardRevenuePayment] - """A Card Revenue Payment object. + foreign_exchange_reference_indicator: str - This field will be present in the JSON response if and only if `category` is - equal to `card_revenue_payment`. - """ + foreign_payment_amount: int - card_settlement: Optional[TransactionSourceCardSettlement] - """A Card Settlement object. + foreign_trace_number: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `card_settlement`. - """ + international_transaction_type_code: str - category: Literal[ - "account_transfer_intention", - "ach_transfer_intention", - "ach_transfer_rejection", - "ach_transfer_return", - "card_dispute_acceptance", - "card_refund", - "card_revenue_payment", - "card_settlement", - "check_deposit_acceptance", - "check_deposit_return", - "check_transfer_deposit", - "check_transfer_intention", - "check_transfer_rejection", - "check_transfer_return", - "check_transfer_stop_payment_request", - "fee_payment", - "inbound_ach_transfer", - "inbound_ach_transfer_return_intention", - "inbound_check", - "inbound_international_ach_transfer", - "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", - "inbound_wire_drawdown_payment_reversal", - "inbound_wire_reversal", - "inbound_wire_transfer", - "interest_payment", - "internal_source", - "real_time_payments_transfer_acknowledgement", - "sample_funds", - "wire_transfer_intention", - "wire_transfer_rejection", - "other", - ] - """The type of transaction that took place. + originating_currency_code: str - We may add additional possible values for this enum over time; your application - should be able to handle such additions gracefully. - """ + originating_depository_financial_institution_branch_country: str - check_deposit_acceptance: Optional[TransactionSourceCheckDepositAcceptance] - """A Check Deposit Acceptance object. + originating_depository_financial_institution_id: str - This field will be present in the JSON response if and only if `category` is - equal to `check_deposit_acceptance`. - """ + originating_depository_financial_institution_id_qualifier: str - check_deposit_return: Optional[TransactionSourceCheckDepositReturn] - """A Check Deposit Return object. + originating_depository_financial_institution_name: str - This field will be present in the JSON response if and only if `category` is - equal to `check_deposit_return`. - """ + originator_city: str - check_transfer_deposit: Optional[TransactionSourceCheckTransferDeposit] - """A Check Transfer Deposit object. + originator_company_entry_description: str - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_deposit`. - """ + originator_country: str - check_transfer_intention: Optional[TransactionSourceCheckTransferIntention] - """A Check Transfer Intention object. + originator_identification: str - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_intention`. - """ + originator_name: str - check_transfer_rejection: Optional[TransactionSourceCheckTransferRejection] - """A Check Transfer Rejection object. + originator_postal_code: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_rejection`. - """ + originator_state_or_province: Optional[str] - check_transfer_return: Optional[TransactionSourceCheckTransferReturn] - """A Check Transfer Return object. + originator_street_address: str - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_return`. - """ + payment_related_information: Optional[str] - check_transfer_stop_payment_request: Optional[TransactionSourceCheckTransferStopPaymentRequest] - """A Check Transfer Stop Payment Request object. + payment_related_information2: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_stop_payment_request`. - """ + receiver_city: str + + receiver_country: str - fee_payment: Optional[TransactionSourceFeePayment] - """A Fee Payment object. + receiver_identification_number: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `fee_payment`. - """ + receiver_postal_code: Optional[str] - inbound_ach_transfer: Optional[TransactionSourceInboundACHTransfer] - """A Inbound ACH Transfer object. + receiver_state_or_province: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `inbound_ach_transfer`. - """ + receiver_street_address: str - inbound_check: Optional[TransactionSourceInboundCheck] - """A Inbound Check object. + receiving_company_or_individual_name: str - This field will be present in the JSON response if and only if `category` is - equal to `inbound_check`. - """ + receiving_depository_financial_institution_country: str - inbound_international_ach_transfer: Optional[TransactionSourceInboundInternationalACHTransfer] - """A Inbound International ACH Transfer object. + receiving_depository_financial_institution_id: str - This field will be present in the JSON response if and only if `category` is - equal to `inbound_international_ach_transfer`. - """ + receiving_depository_financial_institution_id_qualifier: str - inbound_real_time_payments_transfer_confirmation: Optional[ - TransactionSourceInboundRealTimePaymentsTransferConfirmation - ] - """A Inbound Real Time Payments Transfer Confirmation object. + receiving_depository_financial_institution_name: str - This field will be present in the JSON response if and only if `category` is - equal to `inbound_real_time_payments_transfer_confirmation`. - """ + trace_number: str - inbound_wire_drawdown_payment: Optional[TransactionSourceInboundWireDrawdownPayment] - """A Inbound Wire Drawdown Payment object. - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_drawdown_payment`. +class TransactionSourceInboundRealTimePaymentsTransferConfirmation(BaseModel): + amount: int + """The amount in the minor unit of the transfer's currency. + + For dollars, for example, this is cents. """ - inbound_wire_drawdown_payment_reversal: Optional[TransactionSourceInboundWireDrawdownPaymentReversal] - """A Inbound Wire Drawdown Payment Reversal object. + creditor_name: str + """The name the sender of the transfer specified as the recipient of the transfer.""" - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_drawdown_payment_reversal`. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's + currency. This will always be "USD" for a Real Time Payments transfer. """ - inbound_wire_reversal: Optional[TransactionSourceInboundWireReversal] - """A Inbound Wire Reversal object. + debtor_account_number: str + """The account number of the account that sent the transfer.""" - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_reversal`. - """ + debtor_name: str + """The name provided by the sender of the transfer.""" - inbound_wire_transfer: Optional[TransactionSourceInboundWireTransfer] - """A Inbound Wire Transfer object. + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_transfer`. - """ + remittance_information: Optional[str] + """Additional information included with the transfer.""" - interest_payment: Optional[TransactionSourceInterestPayment] - """A Interest Payment object. + transaction_identification: str + """The Real Time Payments network identification of the transfer""" - This field will be present in the JSON response if and only if `category` is - equal to `interest_payment`. - """ - internal_source: Optional[TransactionSourceInternalSource] - """A Internal Source object. +class TransactionSourceInboundWireDrawdownPayment(BaseModel): + amount: int + """The amount in the minor unit of the transaction's currency. - This field will be present in the JSON response if and only if `category` is - equal to `internal_source`. + For dollars, for example, this is cents. """ - real_time_payments_transfer_acknowledgement: Optional[TransactionSourceRealTimePaymentsTransferAcknowledgement] - """A Real Time Payments Transfer Acknowledgement object. + beneficiary_address_line1: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `real_time_payments_transfer_acknowledgement`. - """ + beneficiary_address_line2: Optional[str] - sample_funds: Optional[TransactionSourceSampleFunds] - """A Sample Funds object. + beneficiary_address_line3: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `sample_funds`. - """ + beneficiary_name: Optional[str] - wire_transfer_intention: Optional[TransactionSourceWireTransferIntention] - """A Wire Transfer Intention object. + beneficiary_reference: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `wire_transfer_intention`. - """ + description: str - wire_transfer_rejection: Optional[TransactionSourceWireTransferRejection] - """A Wire Transfer Rejection object. + input_message_accountability_data: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `wire_transfer_rejection`. - """ + originator_address_line1: Optional[str] + originator_address_line2: Optional[str] -class Transaction(BaseModel): - account_id: str - """The identifier for the Account the Transaction belongs to.""" + originator_address_line3: Optional[str] - amount: int - """The Transaction amount in the minor unit of its currency. + originator_name: Optional[str] - For dollars, for example, this is cents. - """ + originator_to_beneficiary_information: Optional[str] - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the - Transaction occured. - """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - Transaction's currency. This will match the currency on the Transcation's - Account. - """ +class TransactionSourceInboundWireDrawdownPaymentReversal(BaseModel): + amount: int + """The amount that was reversed.""" description: str - """For a Transaction related to a transfer, this is the description you provide. + """The description on the reversal message from Fedwire.""" - For a Transaction related to a payment, this is the description the vendor - provides. - """ + input_cycle_date: date + """The Fedwire cycle date for the wire reversal.""" - id: str - """The Transaction identifier.""" + input_message_accountability_data: str + """The Fedwire transaction identifier.""" - route_id: Optional[str] - """The identifier for the route this Transaction came through. + input_sequence_number: str + """The Fedwire sequence number.""" - Routes are things like cards and ACH details. - """ + input_source: str + """The Fedwire input source identifier.""" - route_type: Optional[Literal["account_number", "card"]] - """The type of the route this Transaction came through.""" + previous_message_input_cycle_date: date + """The Fedwire cycle date for the wire transfer that was reversed.""" - source: TransactionSource - """ - This is an object giving more details on the network-level event that caused the - Transaction. Note that for backwards compatibility reasons, additional - undocumented keys may appear in this object. These should be treated as - deprecated and will be removed in the future. - """ + previous_message_input_message_accountability_data: str + """The Fedwire transaction identifier for the wire transfer that was reversed.""" - type: Literal["transaction"] - """A constant representing the object's type. + previous_message_input_sequence_number: str + """The Fedwire sequence number for the wire transfer that was reversed.""" - For this resource it will always be `transaction`. - """ + previous_message_input_source: str + """The Fedwire input source identifier for the wire transfer that was reversed.""" -class DeclinedTransactionSourceACHDecline(BaseModel): +class TransactionSourceInboundWireReversal(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount that was reversed.""" - For dollars, for example, this is cents. + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the reversal was created. """ - originator_company_descriptive_date: Optional[str] + description: str + """The description on the reversal message from Fedwire.""" - originator_company_discretionary_data: Optional[str] + financial_institution_to_financial_institution_information: Optional[str] + """Additional financial institution information included in the wire reversal.""" - originator_company_id: str + input_cycle_date: date + """The Fedwire cycle date for the wire reversal.""" - originator_company_name: str + input_message_accountability_data: str + """The Fedwire transaction identifier.""" - reason: Literal[ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed", - ] - """Why the ACH transfer was declined.""" + input_sequence_number: str + """The Fedwire sequence number.""" - receiver_id_number: Optional[str] + input_source: str + """The Fedwire input source identifier.""" - receiver_name: Optional[str] + previous_message_input_cycle_date: date + """The Fedwire cycle date for the wire transfer that was reversed.""" - trace_number: str + previous_message_input_message_accountability_data: str + """The Fedwire transaction identifier for the wire transfer that was reversed.""" + previous_message_input_sequence_number: str + """The Fedwire sequence number for the wire transfer that was reversed.""" -class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): - electronic_commerce_indicator: Optional[ - Literal[ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction", - ] - ] - """ - For electronic commerce transactions, this identifies the level of security used - in obtaining the customer's payment credential. For mail or telephone order - transactions, identifies the type of mail or telephone order. - """ + previous_message_input_source: str + """The Fedwire input source identifier for the wire transfer that was reversed.""" - point_of_service_entry_mode: Optional[shared.PointOfServiceEntryMode] + receiver_financial_institution_information: Optional[str] """ - The method used to enter the cardholder's primary account number and card - expiration date + Information included in the wire reversal for the receiving financial + institution. """ + transaction_id: Optional[str] + """The ID for the Transaction associated with the transfer reversal.""" -class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): - visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa - """Fields specific to the `visa` network""" + wire_transfer_id: str + """The ID for the Wire Transfer that is being reversed.""" -class DeclinedTransactionSourceCardDecline(BaseModel): +class TransactionSourceInboundWireTransfer(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - account currency. - """ + beneficiary_address_line1: Optional[str] - digital_wallet_token_id: Optional[str] - """ - If the authorization was attempted using a Digital Wallet Token (such as an - Apple Pay purchase), the identifier of the token that was used. - """ + beneficiary_address_line2: Optional[str] - merchant_acceptor_id: str - """ - The merchant identifier (commonly abbreviated as MID) of the merchant the card - is transacting with. - """ + beneficiary_address_line3: Optional[str] - merchant_category_code: Optional[str] - """ - The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - card is transacting with. - """ + beneficiary_name: Optional[str] - merchant_city: Optional[str] - """The city the merchant resides in.""" + beneficiary_reference: Optional[str] - merchant_country: Optional[str] - """The country the merchant resides in.""" + description: str - merchant_descriptor: str - """The merchant descriptor of the merchant the card is transacting with.""" + input_message_accountability_data: Optional[str] - merchant_state: Optional[str] - """The state the merchant resides in.""" + originator_address_line1: Optional[str] - network: Literal["visa"] - """The payment network used to process this card authorization""" + originator_address_line2: Optional[str] - network_details: DeclinedTransactionSourceCardDeclineNetworkDetails - """Fields specific to the `network`""" + originator_address_line3: Optional[str] - real_time_decision_id: Optional[str] - """ - The identifier of the Real-Time Decision sent to approve or decline this - transaction. - """ + originator_name: Optional[str] - reason: Literal[ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_internal_limit", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization", - ] - """Why the transaction was declined.""" + originator_to_beneficiary_information: Optional[str] + originator_to_beneficiary_information_line1: Optional[str] + + originator_to_beneficiary_information_line2: Optional[str] + + originator_to_beneficiary_information_line3: Optional[str] + + originator_to_beneficiary_information_line4: Optional[str] + + +class TransactionSourceInterestPayment(BaseModel): + accrued_on_account_id: Optional[str] + """The account on which the interest was accrued.""" -class DeclinedTransactionSourceCheckDecline(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - auxiliary_on_us: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + currency. + """ - reason: Literal[ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "not_our_item", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized", - "altered_or_fictitious", - ] - """Why the check was declined.""" + period_end: datetime + """The end of the period for which this transaction paid interest.""" + + period_start: datetime + """The start of the period for which this transaction paid interest.""" -class DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline(BaseModel): +class TransactionSourceInternalSource(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - creditor_name: str - """The name the sender of the transfer specified as the recipient of the transfer.""" - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined - transfer's currency. This will always be "USD" for a Real Time Payments - transfer. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + currency. """ - debtor_account_number: str - """The account number of the account that sent the transfer.""" + reason: Literal[ + "account_closure", + "bank_migration", + "cashback", + "collection_receivable", + "empyreal_adjustment", + "error", + "error_correction", + "fees", + "interest", + "negative_balance_forgiveness", + "sample_funds", + "sample_funds_return", + ] - debtor_name: str - """The name provided by the sender of the transfer.""" - debtor_routing_number: str - """The routing number of the account that sent the transfer.""" +class TransactionSourceRealTimePaymentsTransferAcknowledgement(BaseModel): + amount: int + """The transfer amount in USD cents.""" - reason: Literal[ - "account_number_canceled", - "account_number_disabled", - "account_restricted", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled", - ] - """Why the transfer was declined.""" + destination_account_number: str + """The destination account number.""" - remittance_information: Optional[str] - """Additional information included with the transfer.""" + destination_routing_number: str + """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" - transaction_identification: str - """The Real Time Payments network identification of the declined transfer.""" + remittance_information: str + """Unstructured information that will show on the recipient's bank statement.""" + transfer_id: str + """The identifier of the Real Time Payments Transfer that led to this Transaction.""" -class DeclinedTransactionSourceInternationalACHDecline(BaseModel): - amount: int - """The declined amount in the minor unit of the destination account currency. - For dollars, for example, this is cents. - """ +class TransactionSourceSampleFunds(BaseModel): + originator: str + """Where the sample funds came from.""" - destination_country_code: str - destination_currency_code: str +class TransactionSourceWireTransferIntention(BaseModel): + account_number: str + """The destination account number.""" - foreign_exchange_indicator: str + amount: int + """The transfer amount in USD cents.""" - foreign_exchange_reference: Optional[str] + message_to_recipient: str + """The message that will show on the recipient's bank statement.""" - foreign_exchange_reference_indicator: str + routing_number: str + """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" - foreign_payment_amount: int + transfer_id: str - foreign_trace_number: Optional[str] - international_transaction_type_code: str +class TransactionSourceWireTransferRejection(BaseModel): + transfer_id: str - originating_currency_code: str - originating_depository_financial_institution_branch_country: str +class TransactionSource(BaseModel): + account_transfer_intention: Optional[TransactionSourceAccountTransferIntention] + """A Account Transfer Intention object. - originating_depository_financial_institution_id: str + This field will be present in the JSON response if and only if `category` is + equal to `account_transfer_intention`. + """ - originating_depository_financial_institution_id_qualifier: str + ach_transfer_intention: Optional[TransactionSourceACHTransferIntention] + """A ACH Transfer Intention object. - originating_depository_financial_institution_name: str + This field will be present in the JSON response if and only if `category` is + equal to `ach_transfer_intention`. + """ - originator_city: str + ach_transfer_rejection: Optional[TransactionSourceACHTransferRejection] + """A ACH Transfer Rejection object. - originator_company_entry_description: str + This field will be present in the JSON response if and only if `category` is + equal to `ach_transfer_rejection`. + """ - originator_country: str + ach_transfer_return: Optional[TransactionSourceACHTransferReturn] + """A ACH Transfer Return object. - originator_identification: str + This field will be present in the JSON response if and only if `category` is + equal to `ach_transfer_return`. + """ - originator_name: str + card_dispute_acceptance: Optional[TransactionSourceCardDisputeAcceptance] + """A Card Dispute Acceptance object. - originator_postal_code: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `card_dispute_acceptance`. + """ - originator_state_or_province: Optional[str] + card_refund: Optional[TransactionSourceCardRefund] + """A Card Refund object. - originator_street_address: str + This field will be present in the JSON response if and only if `category` is + equal to `card_refund`. + """ - payment_related_information: Optional[str] + card_revenue_payment: Optional[TransactionSourceCardRevenuePayment] + """A Card Revenue Payment object. + + This field will be present in the JSON response if and only if `category` is + equal to `card_revenue_payment`. + """ - payment_related_information2: Optional[str] + card_settlement: Optional[TransactionSourceCardSettlement] + """A Card Settlement object. - receiver_city: str + This field will be present in the JSON response if and only if `category` is + equal to `card_settlement`. + """ - receiver_country: str + category: Literal[ + "account_transfer_intention", + "ach_transfer_intention", + "ach_transfer_rejection", + "ach_transfer_return", + "card_dispute_acceptance", + "card_refund", + "card_revenue_payment", + "card_settlement", + "check_deposit_acceptance", + "check_deposit_return", + "check_transfer_deposit", + "check_transfer_intention", + "check_transfer_rejection", + "check_transfer_return", + "check_transfer_stop_payment_request", + "fee_payment", + "inbound_ach_transfer", + "inbound_ach_transfer_return_intention", + "inbound_check", + "inbound_international_ach_transfer", + "inbound_real_time_payments_transfer_confirmation", + "inbound_wire_drawdown_payment", + "inbound_wire_drawdown_payment_reversal", + "inbound_wire_reversal", + "inbound_wire_transfer", + "interest_payment", + "internal_source", + "real_time_payments_transfer_acknowledgement", + "sample_funds", + "wire_transfer_intention", + "wire_transfer_rejection", + "other", + ] + """The type of transaction that took place. - receiver_identification_number: Optional[str] + We may add additional possible values for this enum over time; your application + should be able to handle such additions gracefully. + """ - receiver_postal_code: Optional[str] + check_deposit_acceptance: Optional[TransactionSourceCheckDepositAcceptance] + """A Check Deposit Acceptance object. - receiver_state_or_province: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `check_deposit_acceptance`. + """ - receiver_street_address: str + check_deposit_return: Optional[TransactionSourceCheckDepositReturn] + """A Check Deposit Return object. - receiving_company_or_individual_name: str + This field will be present in the JSON response if and only if `category` is + equal to `check_deposit_return`. + """ - receiving_depository_financial_institution_country: str + check_transfer_deposit: Optional[TransactionSourceCheckTransferDeposit] + """A Check Transfer Deposit object. - receiving_depository_financial_institution_id: str + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_deposit`. + """ - receiving_depository_financial_institution_id_qualifier: str + check_transfer_intention: Optional[TransactionSourceCheckTransferIntention] + """A Check Transfer Intention object. - receiving_depository_financial_institution_name: str + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_intention`. + """ - trace_number: str + check_transfer_rejection: Optional[TransactionSourceCheckTransferRejection] + """A Check Transfer Rejection object. + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_rejection`. + """ -class DeclinedTransactionSourceWireDecline(BaseModel): - amount: int - """The declined amount in the minor unit of the destination account currency. + check_transfer_return: Optional[TransactionSourceCheckTransferReturn] + """A Check Transfer Return object. - For dollars, for example, this is cents. + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_return`. """ - beneficiary_address_line1: Optional[str] + check_transfer_stop_payment_request: Optional[TransactionSourceCheckTransferStopPaymentRequest] + """A Check Transfer Stop Payment Request object. - beneficiary_address_line2: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_stop_payment_request`. + """ - beneficiary_address_line3: Optional[str] + fee_payment: Optional[TransactionSourceFeePayment] + """A Fee Payment object. - beneficiary_name: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `fee_payment`. + """ - beneficiary_reference: Optional[str] + inbound_ach_transfer: Optional[TransactionSourceInboundACHTransfer] + """A Inbound ACH Transfer object. - description: str + This field will be present in the JSON response if and only if `category` is + equal to `inbound_ach_transfer`. + """ - input_message_accountability_data: Optional[str] + inbound_check: Optional[TransactionSourceInboundCheck] + """A Inbound Check object. - originator_address_line1: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_check`. + """ - originator_address_line2: Optional[str] + inbound_international_ach_transfer: Optional[TransactionSourceInboundInternationalACHTransfer] + """A Inbound International ACH Transfer object. - originator_address_line3: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_international_ach_transfer`. + """ - originator_name: Optional[str] + inbound_real_time_payments_transfer_confirmation: Optional[ + TransactionSourceInboundRealTimePaymentsTransferConfirmation + ] + """A Inbound Real Time Payments Transfer Confirmation object. - originator_to_beneficiary_information_line1: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_real_time_payments_transfer_confirmation`. + """ - originator_to_beneficiary_information_line2: Optional[str] + inbound_wire_drawdown_payment: Optional[TransactionSourceInboundWireDrawdownPayment] + """A Inbound Wire Drawdown Payment object. - originator_to_beneficiary_information_line3: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_wire_drawdown_payment`. + """ - originator_to_beneficiary_information_line4: Optional[str] + inbound_wire_drawdown_payment_reversal: Optional[TransactionSourceInboundWireDrawdownPaymentReversal] + """A Inbound Wire Drawdown Payment Reversal object. - reason: Literal[ - "account_number_canceled", - "account_number_disabled", - "entity_not_active", - "group_locked", - "no_account_number", - "transaction_not_allowed", - ] - """Why the wire transfer was declined.""" + This field will be present in the JSON response if and only if `category` is + equal to `inbound_wire_drawdown_payment_reversal`. + """ + inbound_wire_reversal: Optional[TransactionSourceInboundWireReversal] + """A Inbound Wire Reversal object. -class DeclinedTransactionSource(BaseModel): - ach_decline: Optional[DeclinedTransactionSourceACHDecline] - """A ACH Decline object. + This field will be present in the JSON response if and only if `category` is + equal to `inbound_wire_reversal`. + """ + + inbound_wire_transfer: Optional[TransactionSourceInboundWireTransfer] + """A Inbound Wire Transfer object. This field will be present in the JSON response if and only if `category` is - equal to `ach_decline`. + equal to `inbound_wire_transfer`. """ - card_decline: Optional[DeclinedTransactionSourceCardDecline] - """A Card Decline object. + interest_payment: Optional[TransactionSourceInterestPayment] + """A Interest Payment object. This field will be present in the JSON response if and only if `category` is - equal to `card_decline`. + equal to `interest_payment`. """ - category: Literal[ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "wire_decline", - "other", - ] - """The type of decline that took place. + internal_source: Optional[TransactionSourceInternalSource] + """A Internal Source object. - We may add additional possible values for this enum over time; your application - should be able to handle such additions gracefully. + This field will be present in the JSON response if and only if `category` is + equal to `internal_source`. """ - check_decline: Optional[DeclinedTransactionSourceCheckDecline] - """A Check Decline object. + real_time_payments_transfer_acknowledgement: Optional[TransactionSourceRealTimePaymentsTransferAcknowledgement] + """A Real Time Payments Transfer Acknowledgement object. This field will be present in the JSON response if and only if `category` is - equal to `check_decline`. + equal to `real_time_payments_transfer_acknowledgement`. """ - inbound_real_time_payments_transfer_decline: Optional[ - DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline - ] - """A Inbound Real Time Payments Transfer Decline object. + sample_funds: Optional[TransactionSourceSampleFunds] + """A Sample Funds object. This field will be present in the JSON response if and only if `category` is - equal to `inbound_real_time_payments_transfer_decline`. + equal to `sample_funds`. """ - international_ach_decline: Optional[DeclinedTransactionSourceInternationalACHDecline] - """A International ACH Decline object. + wire_transfer_intention: Optional[TransactionSourceWireTransferIntention] + """A Wire Transfer Intention object. This field will be present in the JSON response if and only if `category` is - equal to `international_ach_decline`. + equal to `wire_transfer_intention`. """ - wire_decline: Optional[DeclinedTransactionSourceWireDecline] - """A Wire Decline object. + wire_transfer_rejection: Optional[TransactionSourceWireTransferRejection] + """A Wire Transfer Rejection object. This field will be present in the JSON response if and only if `category` is - equal to `wire_decline`. + equal to `wire_transfer_rejection`. """ -class DeclinedTransaction(BaseModel): +class Transaction(BaseModel): + id: str + """The Transaction identifier.""" + account_id: str - """The identifier for the Account the Declined Transaction belongs to.""" + """The identifier for the Account the Transaction belongs to.""" amount: int - """The Declined Transaction amount in the minor unit of its currency. + """The Transaction amount in the minor unit of its currency. For dollars, for example, this is cents. """ @@ -1668,39 +1668,39 @@ class DeclinedTransaction(BaseModel): currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined - Transaction's currency. This will match the currency on the Declined - Transcation's Account. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + Transaction's currency. This will match the currency on the Transcation's + Account. """ description: str - """This is the description the vendor provides.""" + """For a Transaction related to a transfer, this is the description you provide. - id: str - """The Declined Transaction identifier.""" + For a Transaction related to a payment, this is the description the vendor + provides. + """ route_id: Optional[str] - """The identifier for the route this Declined Transaction came through. + """The identifier for the route this Transaction came through. Routes are things like cards and ACH details. """ route_type: Optional[Literal["account_number", "card"]] - """The type of the route this Declined Transaction came through.""" + """The type of the route this Transaction came through.""" - source: DeclinedTransactionSource + source: TransactionSource """ This is an object giving more details on the network-level event that caused the - Declined Transaction. For example, for a card transaction this lists the - merchant's industry and location. Note that for backwards compatibility reasons, - additional undocumented keys may appear in this object. These should be treated - as deprecated and will be removed in the future. + Transaction. Note that for backwards compatibility reasons, additional + undocumented keys may appear in this object. These should be treated as + deprecated and will be removed in the future. """ - type: Literal["declined_transaction"] + type: Literal["transaction"] """A constant representing the object's type. - For this resource it will always be `declined_transaction`. + For this resource it will always be `transaction`. """ diff --git a/src/increase/types/simulations/card_authorization_simulation.py b/src/increase/types/simulations/card_authorization_simulation.py index a1e1044a8..fa8a3431a 100644 --- a/src/increase/types/simulations/card_authorization_simulation.py +++ b/src/increase/types/simulations/card_authorization_simulation.py @@ -9,6 +9,16 @@ __all__ = [ "CardAuthorizationSimulation", + "DeclinedTransaction", + "DeclinedTransactionSource", + "DeclinedTransactionSourceACHDecline", + "DeclinedTransactionSourceCardDecline", + "DeclinedTransactionSourceCardDeclineNetworkDetails", + "DeclinedTransactionSourceCardDeclineNetworkDetailsVisa", + "DeclinedTransactionSourceCheckDecline", + "DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline", + "DeclinedTransactionSourceInternationalACHDecline", + "DeclinedTransactionSourceWireDecline", "PendingTransaction", "PendingTransactionSource", "PendingTransactionSourceAccountTransferInstruction", @@ -21,48 +31,48 @@ "PendingTransactionSourceInboundFundsHold", "PendingTransactionSourceRealTimePaymentsTransferInstruction", "PendingTransactionSourceWireTransferInstruction", - "DeclinedTransaction", - "DeclinedTransactionSource", - "DeclinedTransactionSourceACHDecline", - "DeclinedTransactionSourceCardDecline", - "DeclinedTransactionSourceCardDeclineNetworkDetails", - "DeclinedTransactionSourceCardDeclineNetworkDetailsVisa", - "DeclinedTransactionSourceCheckDecline", - "DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline", - "DeclinedTransactionSourceInternationalACHDecline", - "DeclinedTransactionSourceWireDecline", ] -class PendingTransactionSourceAccountTransferInstruction(BaseModel): +class DeclinedTransactionSourceACHDecline(BaseModel): amount: int - """The pending amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - account currency. - """ + originator_company_descriptive_date: Optional[str] - transfer_id: str - """The identifier of the Account Transfer that led to this Pending Transaction.""" + originator_company_discretionary_data: Optional[str] + originator_company_id: str -class PendingTransactionSourceACHTransferInstruction(BaseModel): - amount: int - """The pending amount in the minor unit of the transaction's currency. + originator_company_name: str - For dollars, for example, this is cents. - """ + reason: Literal[ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "credit_entry_refused_by_receiver", + "duplicate_return", + "entity_not_active", + "group_locked", + "insufficient_funds", + "misrouted_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed", + ] + """Why the ACH transfer was declined.""" - transfer_id: str - """The identifier of the ACH Transfer that led to this Pending Transaction.""" + receiver_id_number: Optional[str] + receiver_name: Optional[str] -class PendingTransactionSourceCardAuthorizationNetworkDetailsVisa(BaseModel): + trace_number: str + + +class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): electronic_commerce_indicator: Optional[ Literal[ "mail_phone_order", @@ -88,39 +98,30 @@ class PendingTransactionSourceCardAuthorizationNetworkDetailsVisa(BaseModel): """ -class PendingTransactionSourceCardAuthorizationNetworkDetails(BaseModel): - visa: PendingTransactionSourceCardAuthorizationNetworkDetailsVisa +class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): + visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa """Fields specific to the `visa` network""" -class PendingTransactionSourceCardAuthorization(BaseModel): +class DeclinedTransactionSourceCardDecline(BaseModel): amount: int - """The pending amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + account currency. """ digital_wallet_token_id: Optional[str] """ - If the authorization was made via a Digital Wallet Token (such as an Apple Pay - purchase), the identifier of the token that was used. - """ - - expires_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization - will expire and the pending transaction will be released. + If the authorization was attempted using a Digital Wallet Token (such as an + Apple Pay purchase), the identifier of the token that was used. """ - id: str - """The Card Authorization identifier.""" - merchant_acceptor_id: str """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -142,324 +143,381 @@ class PendingTransactionSourceCardAuthorization(BaseModel): merchant_descriptor: str """The merchant descriptor of the merchant the card is transacting with.""" + merchant_state: Optional[str] + """The state the merchant resides in.""" + network: Literal["visa"] """The payment network used to process this card authorization""" - network_details: PendingTransactionSourceCardAuthorizationNetworkDetails + network_details: DeclinedTransactionSourceCardDeclineNetworkDetails """Fields specific to the `network`""" - pending_transaction_id: Optional[str] - """The identifier of the Pending Transaction associated with this Transaction.""" - real_time_decision_id: Optional[str] """ The identifier of the Real-Time Decision sent to approve or decline this transaction. """ - type: Literal["card_authorization"] - """A constant representing the object's type. - - For this resource it will always be `card_authorization`. - """ + reason: Literal[ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_internal_limit", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization", + ] + """Why the transaction was declined.""" -class PendingTransactionSourceCheckDepositInstruction(BaseModel): +class DeclinedTransactionSourceCheckDecline(BaseModel): amount: int - """The pending amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - back_image_file_id: Optional[str] - """ - The identifier of the File containing the image of the back of the check that - was deposited. - """ - - check_deposit_id: Optional[str] - """The identifier of the Check Deposit.""" - - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. - """ + auxiliary_on_us: Optional[str] - front_image_file_id: str - """ - The identifier of the File containing the image of the front of the check that - was deposited. - """ + reason: Literal[ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "not_our_item", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized", + "altered_or_fictitious", + ] + """Why the check was declined.""" -class PendingTransactionSourceCheckTransferInstruction(BaseModel): +class DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline(BaseModel): amount: int - """The pending amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ + creditor_name: str + """The name the sender of the transfer specified as the recipient of the transfer.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's - currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined + transfer's currency. This will always be "USD" for a Real Time Payments + transfer. """ - transfer_id: str - """The identifier of the Check Transfer that led to this Pending Transaction.""" + debtor_account_number: str + """The account number of the account that sent the transfer.""" + debtor_name: str + """The name provided by the sender of the transfer.""" -class PendingTransactionSourceInboundFundsHold(BaseModel): - amount: int - """The held amount in the minor unit of the account's currency. + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" - For dollars, for example, this is cents. - """ + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "account_restricted", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled", + ] + """Why the transfer was declined.""" - automatically_releases_at: datetime - """When the hold will be released automatically. + remittance_information: Optional[str] + """Additional information included with the transfer.""" - Certain conditions may cause it to be released before this time. - """ + transaction_identification: str + """The Real Time Payments network identification of the declined transfer.""" - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the hold - was created. - """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the hold's - currency. +class DeclinedTransactionSourceInternationalACHDecline(BaseModel): + amount: int + """The declined amount in the minor unit of the destination account currency. + + For dollars, for example, this is cents. """ - held_transaction_id: Optional[str] - """The ID of the Transaction for which funds were held.""" + destination_country_code: str - pending_transaction_id: Optional[str] - """The ID of the Pending Transaction representing the held funds.""" + destination_currency_code: str - released_at: Optional[datetime] - """When the hold was released (if it has been released).""" + foreign_exchange_indicator: str - status: Literal["held", "complete"] - """The status of the hold.""" + foreign_exchange_reference: Optional[str] + foreign_exchange_reference_indicator: str -class PendingTransactionSourceRealTimePaymentsTransferInstruction(BaseModel): - amount: int - """The pending amount in the minor unit of the transaction's currency. + foreign_payment_amount: int - For dollars, for example, this is cents. - """ + foreign_trace_number: Optional[str] - transfer_id: str - """ - The identifier of the Real Time Payments Transfer that led to this Pending - Transaction. - """ + international_transaction_type_code: str + originating_currency_code: str -class PendingTransactionSourceWireTransferInstruction(BaseModel): - account_number: str + originating_depository_financial_institution_branch_country: str - amount: int - """The pending amount in the minor unit of the transaction's currency. + originating_depository_financial_institution_id: str - For dollars, for example, this is cents. - """ + originating_depository_financial_institution_id_qualifier: str - message_to_recipient: str + originating_depository_financial_institution_name: str - routing_number: str + originator_city: str - transfer_id: str + originator_company_entry_description: str + originator_country: str -class PendingTransactionSource(BaseModel): - account_transfer_instruction: Optional[PendingTransactionSourceAccountTransferInstruction] - """A Account Transfer Instruction object. + originator_identification: str - This field will be present in the JSON response if and only if `category` is - equal to `account_transfer_instruction`. + originator_name: str + + originator_postal_code: Optional[str] + + originator_state_or_province: Optional[str] + + originator_street_address: str + + payment_related_information: Optional[str] + + payment_related_information2: Optional[str] + + receiver_city: str + + receiver_country: str + + receiver_identification_number: Optional[str] + + receiver_postal_code: Optional[str] + + receiver_state_or_province: Optional[str] + + receiver_street_address: str + + receiving_company_or_individual_name: str + + receiving_depository_financial_institution_country: str + + receiving_depository_financial_institution_id: str + + receiving_depository_financial_institution_id_qualifier: str + + receiving_depository_financial_institution_name: str + + trace_number: str + + +class DeclinedTransactionSourceWireDecline(BaseModel): + amount: int + """The declined amount in the minor unit of the destination account currency. + + For dollars, for example, this is cents. """ - ach_transfer_instruction: Optional[PendingTransactionSourceACHTransferInstruction] - """A ACH Transfer Instruction object. + beneficiary_address_line1: Optional[str] + + beneficiary_address_line2: Optional[str] + + beneficiary_address_line3: Optional[str] + + beneficiary_name: Optional[str] + + beneficiary_reference: Optional[str] + + description: str + + input_message_accountability_data: Optional[str] + + originator_address_line1: Optional[str] + + originator_address_line2: Optional[str] + + originator_address_line3: Optional[str] + + originator_name: Optional[str] + + originator_to_beneficiary_information_line1: Optional[str] + + originator_to_beneficiary_information_line2: Optional[str] + + originator_to_beneficiary_information_line3: Optional[str] + + originator_to_beneficiary_information_line4: Optional[str] + + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "entity_not_active", + "group_locked", + "no_account_number", + "transaction_not_allowed", + ] + """Why the wire transfer was declined.""" + + +class DeclinedTransactionSource(BaseModel): + ach_decline: Optional[DeclinedTransactionSourceACHDecline] + """A ACH Decline object. This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_instruction`. + equal to `ach_decline`. """ - card_authorization: Optional[PendingTransactionSourceCardAuthorization] - """A Card Authorization object. + card_decline: Optional[DeclinedTransactionSourceCardDecline] + """A Card Decline object. This field will be present in the JSON response if and only if `category` is - equal to `card_authorization`. + equal to `card_decline`. """ category: Literal[ - "account_transfer_instruction", - "ach_transfer_instruction", - "card_authorization", - "check_deposit_instruction", - "check_transfer_instruction", - "inbound_funds_hold", - "real_time_payments_transfer_instruction", - "wire_transfer_instruction", + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "wire_decline", "other", ] - """The type of transaction that took place. + """The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully. """ - check_deposit_instruction: Optional[PendingTransactionSourceCheckDepositInstruction] - """A Check Deposit Instruction object. + check_decline: Optional[DeclinedTransactionSourceCheckDecline] + """A Check Decline object. This field will be present in the JSON response if and only if `category` is - equal to `check_deposit_instruction`. + equal to `check_decline`. """ - check_transfer_instruction: Optional[PendingTransactionSourceCheckTransferInstruction] - """A Check Transfer Instruction object. + inbound_real_time_payments_transfer_decline: Optional[ + DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline + ] + """A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_instruction`. + equal to `inbound_real_time_payments_transfer_decline`. """ - inbound_funds_hold: Optional[PendingTransactionSourceInboundFundsHold] - """A Inbound Funds Hold object. + international_ach_decline: Optional[DeclinedTransactionSourceInternationalACHDecline] + """A International ACH Decline object. This field will be present in the JSON response if and only if `category` is - equal to `inbound_funds_hold`. + equal to `international_ach_decline`. """ - real_time_payments_transfer_instruction: Optional[PendingTransactionSourceRealTimePaymentsTransferInstruction] - """A Real Time Payments Transfer Instruction object. + wire_decline: Optional[DeclinedTransactionSourceWireDecline] + """A Wire Decline object. This field will be present in the JSON response if and only if `category` is - equal to `real_time_payments_transfer_instruction`. + equal to `wire_decline`. """ - wire_transfer_instruction: Optional[PendingTransactionSourceWireTransferInstruction] - """A Wire Transfer Instruction object. - - This field will be present in the JSON response if and only if `category` is - equal to `wire_transfer_instruction`. - """ +class DeclinedTransaction(BaseModel): + id: str + """The Declined Transaction identifier.""" -class PendingTransaction(BaseModel): account_id: str - """The identifier for the account this Pending Transaction belongs to.""" + """The identifier for the Account the Declined Transaction belongs to.""" amount: int - """The Pending Transaction amount in the minor unit of its currency. + """The Declined Transaction amount in the minor unit of its currency. For dollars, for example, this is cents. """ - completed_at: Optional[datetime] - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending - Transaction was completed. - """ - created_at: datetime """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Transaction occured. """ currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Pending - Transaction's currency. This will match the currency on the Pending + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined + Transaction's currency. This will match the currency on the Declined Transcation's Account. """ description: str - """ - For a Pending Transaction related to a transfer, this is the description you - provide. For a Pending Transaction related to a payment, this is the description - the vendor provides. - """ - - id: str - """The Pending Transaction identifier.""" + """This is the description the vendor provides.""" route_id: Optional[str] - """The identifier for the route this Pending Transaction came through. + """The identifier for the route this Declined Transaction came through. Routes are things like cards and ACH details. """ route_type: Optional[Literal["account_number", "card"]] - """The type of the route this Pending Transaction came through.""" + """The type of the route this Declined Transaction came through.""" - source: PendingTransactionSource + source: DeclinedTransactionSource """ This is an object giving more details on the network-level event that caused the - Pending Transaction. For example, for a card transaction this lists the - merchant's industry and location. - """ - - status: Literal["pending", "complete"] - """ - Whether the Pending Transaction has been confirmed and has an associated - Transaction. + Declined Transaction. For example, for a card transaction this lists the + merchant's industry and location. Note that for backwards compatibility reasons, + additional undocumented keys may appear in this object. These should be treated + as deprecated and will be removed in the future. """ - type: Literal["pending_transaction"] + type: Literal["declined_transaction"] """A constant representing the object's type. - For this resource it will always be `pending_transaction`. + For this resource it will always be `declined_transaction`. """ -class DeclinedTransactionSourceACHDecline(BaseModel): +class PendingTransactionSourceAccountTransferInstruction(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The pending amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - originator_company_descriptive_date: Optional[str] - - originator_company_discretionary_data: Optional[str] - - originator_company_id: str + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + account currency. + """ - originator_company_name: str + transfer_id: str + """The identifier of the Account Transfer that led to this Pending Transaction.""" - reason: Literal[ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed", - ] - """Why the ACH transfer was declined.""" - receiver_id_number: Optional[str] +class PendingTransactionSourceACHTransferInstruction(BaseModel): + amount: int + """The pending amount in the minor unit of the transaction's currency. - receiver_name: Optional[str] + For dollars, for example, this is cents. + """ - trace_number: str + transfer_id: str + """The identifier of the ACH Transfer that led to this Pending Transaction.""" -class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): +class PendingTransactionSourceCardAuthorizationNetworkDetailsVisa(BaseModel): electronic_commerce_indicator: Optional[ Literal[ "mail_phone_order", @@ -485,28 +543,37 @@ class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): """ -class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): - visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa +class PendingTransactionSourceCardAuthorizationNetworkDetails(BaseModel): + visa: PendingTransactionSourceCardAuthorizationNetworkDetailsVisa """Fields specific to the `visa` network""" -class DeclinedTransactionSourceCardDecline(BaseModel): - amount: int - """The declined amount in the minor unit of the destination account currency. - +class PendingTransactionSourceCardAuthorization(BaseModel): + id: str + """The Card Authorization identifier.""" + + amount: int + """The pending amount in the minor unit of the transaction's currency. + For dollars, for example, this is cents. """ currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - account currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. """ digital_wallet_token_id: Optional[str] """ - If the authorization was attempted using a Digital Wallet Token (such as an - Apple Pay purchase), the identifier of the token that was used. + If the authorization was made via a Digital Wallet Token (such as an Apple Pay + purchase), the identifier of the token that was used. + """ + + expires_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization + will expire and the pending transaction will be released. """ merchant_acceptor_id: str @@ -530,349 +597,282 @@ class DeclinedTransactionSourceCardDecline(BaseModel): merchant_descriptor: str """The merchant descriptor of the merchant the card is transacting with.""" - merchant_state: Optional[str] - """The state the merchant resides in.""" - network: Literal["visa"] """The payment network used to process this card authorization""" - network_details: DeclinedTransactionSourceCardDeclineNetworkDetails + network_details: PendingTransactionSourceCardAuthorizationNetworkDetails """Fields specific to the `network`""" + pending_transaction_id: Optional[str] + """The identifier of the Pending Transaction associated with this Transaction.""" + real_time_decision_id: Optional[str] """ The identifier of the Real-Time Decision sent to approve or decline this transaction. """ - reason: Literal[ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_internal_limit", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization", - ] - """Why the transaction was declined.""" - - -class DeclinedTransactionSourceCheckDecline(BaseModel): - amount: int - """The declined amount in the minor unit of the destination account currency. + type: Literal["card_authorization"] + """A constant representing the object's type. - For dollars, for example, this is cents. + For this resource it will always be `card_authorization`. """ - auxiliary_on_us: Optional[str] - - reason: Literal[ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "not_our_item", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized", - "altered_or_fictitious", - ] - """Why the check was declined.""" - -class DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline(BaseModel): +class PendingTransactionSourceCheckDepositInstruction(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The pending amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - creditor_name: str - """The name the sender of the transfer specified as the recipient of the transfer.""" - - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + back_image_file_id: Optional[str] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined - transfer's currency. This will always be "USD" for a Real Time Payments - transfer. + The identifier of the File containing the image of the back of the check that + was deposited. """ - debtor_account_number: str - """The account number of the account that sent the transfer.""" - - debtor_name: str - """The name provided by the sender of the transfer.""" - - debtor_routing_number: str - """The routing number of the account that sent the transfer.""" - - reason: Literal[ - "account_number_canceled", - "account_number_disabled", - "account_restricted", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled", - ] - """Why the transfer was declined.""" + check_deposit_id: Optional[str] + """The identifier of the Check Deposit.""" - remittance_information: Optional[str] - """Additional information included with the transfer.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - transaction_identification: str - """The Real Time Payments network identification of the declined transfer.""" + front_image_file_id: str + """ + The identifier of the File containing the image of the front of the check that + was deposited. + """ -class DeclinedTransactionSourceInternationalACHDecline(BaseModel): +class PendingTransactionSourceCheckTransferInstruction(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The pending amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - destination_country_code: str - - destination_currency_code: str - - foreign_exchange_indicator: str - - foreign_exchange_reference: Optional[str] - - foreign_exchange_reference_indicator: str - - foreign_payment_amount: int - - foreign_trace_number: Optional[str] - - international_transaction_type_code: str - - originating_currency_code: str - - originating_depository_financial_institution_branch_country: str - - originating_depository_financial_institution_id: str - - originating_depository_financial_institution_id_qualifier: str - - originating_depository_financial_institution_name: str - - originator_city: str - - originator_company_entry_description: str - - originator_country: str - - originator_identification: str - - originator_name: str - - originator_postal_code: Optional[str] - - originator_state_or_province: Optional[str] - - originator_street_address: str - - payment_related_information: Optional[str] - - payment_related_information2: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's + currency. + """ - receiver_city: str + transfer_id: str + """The identifier of the Check Transfer that led to this Pending Transaction.""" - receiver_country: str - receiver_identification_number: Optional[str] +class PendingTransactionSourceInboundFundsHold(BaseModel): + amount: int + """The held amount in the minor unit of the account's currency. - receiver_postal_code: Optional[str] + For dollars, for example, this is cents. + """ - receiver_state_or_province: Optional[str] + automatically_releases_at: datetime + """When the hold will be released automatically. - receiver_street_address: str + Certain conditions may cause it to be released before this time. + """ - receiving_company_or_individual_name: str + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the hold + was created. + """ - receiving_depository_financial_institution_country: str + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the hold's + currency. + """ - receiving_depository_financial_institution_id: str + held_transaction_id: Optional[str] + """The ID of the Transaction for which funds were held.""" - receiving_depository_financial_institution_id_qualifier: str + pending_transaction_id: Optional[str] + """The ID of the Pending Transaction representing the held funds.""" - receiving_depository_financial_institution_name: str + released_at: Optional[datetime] + """When the hold was released (if it has been released).""" - trace_number: str + status: Literal["held", "complete"] + """The status of the hold.""" -class DeclinedTransactionSourceWireDecline(BaseModel): +class PendingTransactionSourceRealTimePaymentsTransferInstruction(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The pending amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - beneficiary_address_line1: Optional[str] - - beneficiary_address_line2: Optional[str] - - beneficiary_address_line3: Optional[str] - - beneficiary_name: Optional[str] - - beneficiary_reference: Optional[str] - - description: str - - input_message_accountability_data: Optional[str] + transfer_id: str + """ + The identifier of the Real Time Payments Transfer that led to this Pending + Transaction. + """ - originator_address_line1: Optional[str] - originator_address_line2: Optional[str] +class PendingTransactionSourceWireTransferInstruction(BaseModel): + account_number: str - originator_address_line3: Optional[str] + amount: int + """The pending amount in the minor unit of the transaction's currency. - originator_name: Optional[str] + For dollars, for example, this is cents. + """ - originator_to_beneficiary_information_line1: Optional[str] + message_to_recipient: str - originator_to_beneficiary_information_line2: Optional[str] + routing_number: str - originator_to_beneficiary_information_line3: Optional[str] + transfer_id: str - originator_to_beneficiary_information_line4: Optional[str] - reason: Literal[ - "account_number_canceled", - "account_number_disabled", - "entity_not_active", - "group_locked", - "no_account_number", - "transaction_not_allowed", - ] - """Why the wire transfer was declined.""" +class PendingTransactionSource(BaseModel): + account_transfer_instruction: Optional[PendingTransactionSourceAccountTransferInstruction] + """A Account Transfer Instruction object. + This field will be present in the JSON response if and only if `category` is + equal to `account_transfer_instruction`. + """ -class DeclinedTransactionSource(BaseModel): - ach_decline: Optional[DeclinedTransactionSourceACHDecline] - """A ACH Decline object. + ach_transfer_instruction: Optional[PendingTransactionSourceACHTransferInstruction] + """A ACH Transfer Instruction object. This field will be present in the JSON response if and only if `category` is - equal to `ach_decline`. + equal to `ach_transfer_instruction`. """ - card_decline: Optional[DeclinedTransactionSourceCardDecline] - """A Card Decline object. + card_authorization: Optional[PendingTransactionSourceCardAuthorization] + """A Card Authorization object. This field will be present in the JSON response if and only if `category` is - equal to `card_decline`. + equal to `card_authorization`. """ category: Literal[ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "wire_decline", + "account_transfer_instruction", + "ach_transfer_instruction", + "card_authorization", + "check_deposit_instruction", + "check_transfer_instruction", + "inbound_funds_hold", + "real_time_payments_transfer_instruction", + "wire_transfer_instruction", "other", ] - """The type of decline that took place. + """The type of transaction that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully. """ - check_decline: Optional[DeclinedTransactionSourceCheckDecline] - """A Check Decline object. + check_deposit_instruction: Optional[PendingTransactionSourceCheckDepositInstruction] + """A Check Deposit Instruction object. This field will be present in the JSON response if and only if `category` is - equal to `check_decline`. + equal to `check_deposit_instruction`. """ - inbound_real_time_payments_transfer_decline: Optional[ - DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline - ] - """A Inbound Real Time Payments Transfer Decline object. + check_transfer_instruction: Optional[PendingTransactionSourceCheckTransferInstruction] + """A Check Transfer Instruction object. This field will be present in the JSON response if and only if `category` is - equal to `inbound_real_time_payments_transfer_decline`. + equal to `check_transfer_instruction`. """ - international_ach_decline: Optional[DeclinedTransactionSourceInternationalACHDecline] - """A International ACH Decline object. + inbound_funds_hold: Optional[PendingTransactionSourceInboundFundsHold] + """A Inbound Funds Hold object. This field will be present in the JSON response if and only if `category` is - equal to `international_ach_decline`. + equal to `inbound_funds_hold`. """ - wire_decline: Optional[DeclinedTransactionSourceWireDecline] - """A Wire Decline object. + real_time_payments_transfer_instruction: Optional[PendingTransactionSourceRealTimePaymentsTransferInstruction] + """A Real Time Payments Transfer Instruction object. This field will be present in the JSON response if and only if `category` is - equal to `wire_decline`. + equal to `real_time_payments_transfer_instruction`. """ + wire_transfer_instruction: Optional[PendingTransactionSourceWireTransferInstruction] + """A Wire Transfer Instruction object. + + This field will be present in the JSON response if and only if `category` is + equal to `wire_transfer_instruction`. + """ + + +class PendingTransaction(BaseModel): + id: str + """The Pending Transaction identifier.""" -class DeclinedTransaction(BaseModel): account_id: str - """The identifier for the Account the Declined Transaction belongs to.""" + """The identifier for the account this Pending Transaction belongs to.""" amount: int - """The Declined Transaction amount in the minor unit of its currency. + """The Pending Transaction amount in the minor unit of its currency. For dollars, for example, this is cents. """ + completed_at: Optional[datetime] + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending + Transaction was completed. + """ + created_at: datetime """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending Transaction occured. """ currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined - Transaction's currency. This will match the currency on the Declined + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Pending + Transaction's currency. This will match the currency on the Pending Transcation's Account. """ description: str - """This is the description the vendor provides.""" - - id: str - """The Declined Transaction identifier.""" + """ + For a Pending Transaction related to a transfer, this is the description you + provide. For a Pending Transaction related to a payment, this is the description + the vendor provides. + """ route_id: Optional[str] - """The identifier for the route this Declined Transaction came through. + """The identifier for the route this Pending Transaction came through. Routes are things like cards and ACH details. """ route_type: Optional[Literal["account_number", "card"]] - """The type of the route this Declined Transaction came through.""" + """The type of the route this Pending Transaction came through.""" - source: DeclinedTransactionSource + source: PendingTransactionSource """ This is an object giving more details on the network-level event that caused the - Declined Transaction. For example, for a card transaction this lists the - merchant's industry and location. Note that for backwards compatibility reasons, - additional undocumented keys may appear in this object. These should be treated - as deprecated and will be removed in the future. + Pending Transaction. For example, for a card transaction this lists the + merchant's industry and location. """ - type: Literal["declined_transaction"] + status: Literal["pending", "complete"] + """ + Whether the Pending Transaction has been confirmed and has an associated + Transaction. + """ + + type: Literal["pending_transaction"] """A constant representing the object's type. - For this resource it will always be `declined_transaction`. + For this resource it will always be `pending_transaction`. """ diff --git a/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py b/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py index 91c0277df..47a93d761 100644 --- a/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py +++ b/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py @@ -9,6 +9,16 @@ __all__ = [ "InboundRealTimePaymentsTransferSimulationResult", + "DeclinedTransaction", + "DeclinedTransactionSource", + "DeclinedTransactionSourceACHDecline", + "DeclinedTransactionSourceCardDecline", + "DeclinedTransactionSourceCardDeclineNetworkDetails", + "DeclinedTransactionSourceCardDeclineNetworkDetailsVisa", + "DeclinedTransactionSourceCheckDecline", + "DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline", + "DeclinedTransactionSourceInternationalACHDecline", + "DeclinedTransactionSourceWireDecline", "Transaction", "TransactionSource", "TransactionSourceAccountTransferIntention", @@ -41,813 +51,930 @@ "TransactionSourceSampleFunds", "TransactionSourceWireTransferIntention", "TransactionSourceWireTransferRejection", - "DeclinedTransaction", - "DeclinedTransactionSource", - "DeclinedTransactionSourceACHDecline", - "DeclinedTransactionSourceCardDecline", - "DeclinedTransactionSourceCardDeclineNetworkDetails", - "DeclinedTransactionSourceCardDeclineNetworkDetailsVisa", - "DeclinedTransactionSourceCheckDecline", - "DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline", - "DeclinedTransactionSourceInternationalACHDecline", - "DeclinedTransactionSourceWireDecline", ] -class TransactionSourceAccountTransferIntention(BaseModel): - amount: int - """The pending amount in the minor unit of the transaction's currency. - - For dollars, for example, this is cents. - """ - - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - account currency. - """ - - description: str - """The description you chose to give the transfer.""" - - destination_account_id: str - """The identifier of the Account to where the Account Transfer was sent.""" - - source_account_id: str - """The identifier of the Account from where the Account Transfer was sent.""" - - transfer_id: str - """The identifier of the Account Transfer that led to this Pending Transaction.""" - - -class TransactionSourceACHTransferIntention(BaseModel): - account_number: str - +class DeclinedTransactionSourceACHDecline(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - routing_number: str - - statement_descriptor: str - - transfer_id: str - """The identifier of the ACH Transfer that led to this Transaction.""" - - -class TransactionSourceACHTransferRejection(BaseModel): - transfer_id: str - """The identifier of the ACH Transfer that led to this Transaction.""" + originator_company_descriptive_date: Optional[str] + originator_company_discretionary_data: Optional[str] -class TransactionSourceACHTransferReturn(BaseModel): - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the transfer was created. - """ + originator_company_id: str - raw_return_reason_code: str - """The three character ACH return code, in the range R01 to R85.""" + originator_company_name: str - return_reason_code: Literal[ - "insufficient_fund", - "no_account", - "account_closed", - "invalid_account_number_structure", - "account_frozen_entry_returned_per_ofac_instruction", + reason: Literal[ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", "credit_entry_refused_by_receiver", - "unauthorized_debit_to_consumer_account_using_corporate_sec_code", - "corporate_customer_advised_not_authorized", - "payment_stopped", - "non_transaction_account", - "uncollected_funds", - "routing_number_check_digit_error", - "customer_advised_unauthorized_improper_ineligible_or_incomplete", - "amount_field_error", - "authorization_revoked_by_customer", - "invalid_ach_routing_number", - "file_record_edit_criteria", - "enr_invalid_individual_name", - "returned_per_odfi_request", - "limited_participation_dfi", - "incorrectly_coded_outbound_international_payment", - "account_sold_to_another_dfi", - "addenda_error", - "beneficiary_or_account_holder_deceased", - "customer_advised_not_within_authorization_terms", - "corrected_return", - "duplicate_entry", "duplicate_return", - "enr_duplicate_enrollment", - "enr_invalid_dfi_account_number", - "enr_invalid_individual_id_number", - "enr_invalid_representative_payee_indicator", - "enr_invalid_transaction_code", - "enr_return_of_enr_entry", - "enr_routing_number_check_digit_error", - "entry_not_processed_by_gateway", - "field_error", - "foreign_receiving_dfi_unable_to_settle", - "iat_entry_coding_error", - "improper_effective_entry_date", - "improper_source_document_source_document_presented", - "invalid_company_id", - "invalid_foreign_receiving_dfi_identification", - "invalid_individual_id_number", - "item_and_rck_entry_presented_for_payment", - "item_related_to_rck_entry_is_ineligible", - "mandatory_field_error", - "misrouted_dishonored_return", + "entity_not_active", + "group_locked", + "insufficient_funds", "misrouted_return", - "no_errors_found", - "non_acceptance_of_r62_dishonored_return", - "non_participant_in_iat_program", - "permissible_return_entry", - "permissible_return_entry_not_accepted", - "rdfi_non_settlement", - "rdfi_participant_in_check_truncation_program", - "representative_payee_deceased_or_unable_to_continue_in_that_capacity", - "return_not_a_duplicate", - "return_of_erroneous_or_reversing_debit", - "return_of_improper_credit_entry", - "return_of_improper_debit_entry", - "return_of_xck_entry", - "source_document_presented_for_payment", - "state_law_affecting_rck_acceptance", - "stop_payment_on_item_related_to_rck_entry", - "stop_payment_on_source_document", - "timely_original_return", - "trace_number_error", - "untimely_dishonored_return", - "untimely_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed", ] - """Why the ACH Transfer was returned.""" + """Why the ACH transfer was declined.""" - transaction_id: str - """The identifier of the Tranasaction associated with this return.""" + receiver_id_number: Optional[str] - transfer_id: str - """The identifier of the ACH Transfer associated with this return.""" + receiver_name: Optional[str] + trace_number: str -class TransactionSourceCardDisputeAcceptance(BaseModel): - accepted_at: datetime + +class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): + electronic_commerce_indicator: Optional[ + Literal[ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction", + ] + ] """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the Card Dispute was accepted. + For electronic commerce transactions, this identifies the level of security used + in obtaining the customer's payment credential. For mail or telephone order + transactions, identifies the type of mail or telephone order. """ - card_dispute_id: str - """The identifier of the Card Dispute that was accepted.""" - - transaction_id: str + point_of_service_entry_mode: Optional[shared.PointOfServiceEntryMode] """ - The identifier of the Transaction that was created to return the disputed funds - to your account. + The method used to enter the cardholder's primary account number and card + expiration date """ -class TransactionSourceCardRefund(BaseModel): +class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): + visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa + """Fields specific to the `visa` network""" + + +class DeclinedTransactionSourceCardDecline(BaseModel): amount: int - """The pending amount in the minor unit of the transaction's currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + account currency. """ - id: str - """The Card Refund identifier.""" + digital_wallet_token_id: Optional[str] + """ + If the authorization was attempted using a Digital Wallet Token (such as an + Apple Pay purchase), the identifier of the token that was used. + """ - merchant_acceptor_id: Optional[str] + merchant_acceptor_id: str """ The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with. """ - merchant_category_code: str - """The 4-digit MCC describing the merchant's business.""" + merchant_category_code: Optional[str] + """ + The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + card is transacting with. + """ merchant_city: Optional[str] """The city the merchant resides in.""" - merchant_country: str + merchant_country: Optional[str] """The country the merchant resides in.""" - merchant_name: Optional[str] - """The name of the merchant.""" + merchant_descriptor: str + """The merchant descriptor of the merchant the card is transacting with.""" merchant_state: Optional[str] """The state the merchant resides in.""" - type: Literal["card_refund"] - """A constant representing the object's type. - - For this resource it will always be `card_refund`. - """ - - -class TransactionSourceCardRevenuePayment(BaseModel): - amount: int - """The amount in the minor unit of the transaction's currency. + network: Literal["visa"] + """The payment network used to process this card authorization""" - For dollars, for example, this is cents. - """ + network_details: DeclinedTransactionSourceCardDeclineNetworkDetails + """Fields specific to the `network`""" - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + real_time_decision_id: Optional[str] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - currency. + The identifier of the Real-Time Decision sent to approve or decline this + transaction. """ - period_end: datetime - """The end of the period for which this transaction paid interest.""" - - period_start: datetime - """The start of the period for which this transaction paid interest.""" - - transacted_on_account_id: Optional[str] - """The account the card belonged to.""" + reason: Literal[ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_internal_limit", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization", + ] + """Why the transaction was declined.""" -class TransactionSourceCardSettlement(BaseModel): +class DeclinedTransactionSourceCheckDecline(BaseModel): amount: int - """The amount in the minor unit of the transaction's settlement currency. + """The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - card_authorization: Optional[str] - """ - The Card Authorization that was created prior to this Card Settlement, if on - exists. - """ + auxiliary_on_us: Optional[str] - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's settlement currency. + reason: Literal[ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "not_our_item", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized", + "altered_or_fictitious", + ] + """Why the check was declined.""" + + +class DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline(BaseModel): + amount: int + """The declined amount in the minor unit of the destination account currency. + + For dollars, for example, this is cents. """ - id: str - """The Card Settlement identifier.""" + creditor_name: str + """The name the sender of the transfer specified as the recipient of the transfer.""" - merchant_acceptor_id: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The merchant identifier (commonly abbreviated as MID) of the merchant the card - is transacting with. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined + transfer's currency. This will always be "USD" for a Real Time Payments + transfer. """ - merchant_category_code: str - """The 4-digit MCC describing the merchant's business.""" + debtor_account_number: str + """The account number of the account that sent the transfer.""" - merchant_city: Optional[str] - """The city the merchant resides in.""" + debtor_name: str + """The name provided by the sender of the transfer.""" - merchant_country: str - """The country the merchant resides in.""" + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" - merchant_name: Optional[str] - """The name of the merchant.""" + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "account_restricted", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled", + ] + """Why the transfer was declined.""" - merchant_state: Optional[str] - """The state the merchant resides in.""" + remittance_information: Optional[str] + """Additional information included with the transfer.""" - pending_transaction_id: Optional[str] - """The identifier of the Pending Transaction associated with this Transaction.""" + transaction_identification: str + """The Real Time Payments network identification of the declined transfer.""" - presentment_amount: int - """The amount in the minor unit of the transaction's presentment currency.""" - presentment_currency: str - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's presentment currency. +class DeclinedTransactionSourceInternationalACHDecline(BaseModel): + amount: int + """The declined amount in the minor unit of the destination account currency. + + For dollars, for example, this is cents. """ - type: Literal["card_settlement"] - """A constant representing the object's type. + destination_country_code: str - For this resource it will always be `card_settlement`. - """ + destination_currency_code: str + foreign_exchange_indicator: str -class TransactionSourceCheckDepositAcceptance(BaseModel): - account_number: str - """The account number printed on the check.""" + foreign_exchange_reference: Optional[str] - amount: int - """The amount to be deposited in the minor unit of the transaction's currency. + foreign_exchange_reference_indicator: str - For dollars, for example, this is cents. - """ + foreign_payment_amount: int - auxiliary_on_us: Optional[str] - """An additional line of metadata printed on the check. + foreign_trace_number: Optional[str] - This typically includes the check number for business checks. - """ + international_transaction_type_code: str - check_deposit_id: str - """The ID of the Check Deposit that was accepted.""" + originating_currency_code: str - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. - """ + originating_depository_financial_institution_branch_country: str - routing_number: str - """The routing number printed on the check.""" + originating_depository_financial_institution_id: str - serial_number: Optional[str] - """The check serial number, if present, for consumer checks. + originating_depository_financial_institution_id_qualifier: str - For business checks, the serial number is usually in the `auxiliary_on_us` - field. - """ + originating_depository_financial_institution_name: str + originator_city: str -class TransactionSourceCheckDepositReturn(BaseModel): - amount: int - """The amount in the minor unit of the transaction's currency. + originator_company_entry_description: str - For dollars, for example, this is cents. - """ + originator_country: str - check_deposit_id: str - """The identifier of the Check Deposit that was returned.""" + originator_identification: str - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. - """ + originator_name: str - return_reason: Literal[ - "ach_conversion_not_supported", - "closed_account", - "duplicate_submission", - "insufficient_funds", - "no_account", - "not_authorized", - "stale_dated", - "stop_payment", - "unknown_reason", - "unmatched_details", - "unreadable_image", - "endorsement_irregular", - ] + originator_postal_code: Optional[str] - returned_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the check deposit was returned. - """ + originator_state_or_province: Optional[str] - transaction_id: str - """ - The identifier of the transaction that reversed the original check deposit - transaction. - """ + originator_street_address: str + payment_related_information: Optional[str] -class TransactionSourceCheckTransferDeposit(BaseModel): - back_image_file_id: Optional[str] - """ - The identifier of the API File object containing an image of the back of the - deposited check. - """ + payment_related_information2: Optional[str] - deposited_at: datetime - """When the check was deposited.""" + receiver_city: str - front_image_file_id: Optional[str] - """ - The identifier of the API File object containing an image of the front of the - deposited check. - """ + receiver_country: str - type: Literal["check_transfer_deposit"] - """A constant representing the object's type. + receiver_identification_number: Optional[str] - For this resource it will always be `check_transfer_deposit`. - """ + receiver_postal_code: Optional[str] + receiver_state_or_province: Optional[str] -class TransactionSourceCheckTransferIntention(BaseModel): - address_city: Optional[str] - """The city of the check's destination.""" + receiver_street_address: str - address_line1: Optional[str] - """The street address of the check's destination.""" + receiving_company_or_individual_name: str - address_line2: Optional[str] - """The second line of the address of the check's destination.""" + receiving_depository_financial_institution_country: str - address_state: Optional[str] - """The state of the check's destination.""" + receiving_depository_financial_institution_id: str - address_zip: Optional[str] - """The postal code of the check's destination.""" + receiving_depository_financial_institution_id_qualifier: str + + receiving_depository_financial_institution_name: str + + trace_number: str + +class DeclinedTransactionSourceWireDecline(BaseModel): amount: int - """The transfer amount in USD cents.""" + """The declined amount in the minor unit of the destination account currency. - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's - currency. + For dollars, for example, this is cents. """ - recipient_name: Optional[str] - """The name that will be printed on the check.""" + beneficiary_address_line1: Optional[str] - transfer_id: str - """The identifier of the Check Transfer with which this is associated.""" + beneficiary_address_line2: Optional[str] + beneficiary_address_line3: Optional[str] -class TransactionSourceCheckTransferRejection(BaseModel): - transfer_id: str - """The identifier of the Check Transfer that led to this Transaction.""" + beneficiary_name: Optional[str] + beneficiary_reference: Optional[str] -class TransactionSourceCheckTransferReturn(BaseModel): - file_id: Optional[str] - """If available, a document with additional information about the return.""" + description: str - reason: Literal["mail_delivery_failure", "refused_by_recipient", "returned_not_authorized"] - """The reason why the check was returned.""" + input_message_accountability_data: Optional[str] - returned_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the check was returned. + originator_address_line1: Optional[str] + + originator_address_line2: Optional[str] + + originator_address_line3: Optional[str] + + originator_name: Optional[str] + + originator_to_beneficiary_information_line1: Optional[str] + + originator_to_beneficiary_information_line2: Optional[str] + + originator_to_beneficiary_information_line3: Optional[str] + + originator_to_beneficiary_information_line4: Optional[str] + + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "entity_not_active", + "group_locked", + "no_account_number", + "transaction_not_allowed", + ] + """Why the wire transfer was declined.""" + + +class DeclinedTransactionSource(BaseModel): + ach_decline: Optional[DeclinedTransactionSourceACHDecline] + """A ACH Decline object. + + This field will be present in the JSON response if and only if `category` is + equal to `ach_decline`. """ - transaction_id: Optional[str] + card_decline: Optional[DeclinedTransactionSourceCardDecline] + """A Card Decline object. + + This field will be present in the JSON response if and only if `category` is + equal to `card_decline`. """ - The identifier of the Transaction that was created to credit you for the - returned check. + + category: Literal[ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "wire_decline", + "other", + ] + """The type of decline that took place. + + We may add additional possible values for this enum over time; your application + should be able to handle such additions gracefully. """ - transfer_id: str - """The identifier of the returned Check Transfer.""" + check_decline: Optional[DeclinedTransactionSourceCheckDecline] + """A Check Decline object. + This field will be present in the JSON response if and only if `category` is + equal to `check_decline`. + """ -class TransactionSourceCheckTransferStopPaymentRequest(BaseModel): - requested_at: datetime - """The time the stop-payment was requested.""" + inbound_real_time_payments_transfer_decline: Optional[ + DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline + ] + """A Inbound Real Time Payments Transfer Decline object. - transaction_id: str - """The transaction ID of the corresponding credit transaction.""" + This field will be present in the JSON response if and only if `category` is + equal to `inbound_real_time_payments_transfer_decline`. + """ - transfer_id: str - """The ID of the check transfer that was stopped.""" + international_ach_decline: Optional[DeclinedTransactionSourceInternationalACHDecline] + """A International ACH Decline object. - type: Literal["check_transfer_stop_payment_request"] - """A constant representing the object's type. + This field will be present in the JSON response if and only if `category` is + equal to `international_ach_decline`. + """ - For this resource it will always be `check_transfer_stop_payment_request`. + wire_decline: Optional[DeclinedTransactionSourceWireDecline] + """A Wire Decline object. + + This field will be present in the JSON response if and only if `category` is + equal to `wire_decline`. """ -class TransactionSourceFeePayment(BaseModel): +class DeclinedTransaction(BaseModel): + id: str + """The Declined Transaction identifier.""" + + account_id: str + """The identifier for the Account the Declined Transaction belongs to.""" + amount: int - """The amount in the minor unit of the transaction's currency. + """The Declined Transaction amount in the minor unit of its currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + created_at: datetime """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - currency. + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the + Transaction occured. """ - -class TransactionSourceInboundACHTransfer(BaseModel): - amount: int - """The amount in the minor unit of the destination account currency. - - For dollars, for example, this is cents. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined + Transaction's currency. This will match the currency on the Declined + Transcation's Account. """ - originator_company_descriptive_date: Optional[str] - - originator_company_discretionary_data: Optional[str] + description: str + """This is the description the vendor provides.""" - originator_company_entry_description: str + route_id: Optional[str] + """The identifier for the route this Declined Transaction came through. - originator_company_id: str + Routes are things like cards and ACH details. + """ - originator_company_name: str + route_type: Optional[Literal["account_number", "card"]] + """The type of the route this Declined Transaction came through.""" - receiver_id_number: Optional[str] + source: DeclinedTransactionSource + """ + This is an object giving more details on the network-level event that caused the + Declined Transaction. For example, for a card transaction this lists the + merchant's industry and location. Note that for backwards compatibility reasons, + additional undocumented keys may appear in this object. These should be treated + as deprecated and will be removed in the future. + """ - receiver_name: Optional[str] + type: Literal["declined_transaction"] + """A constant representing the object's type. - trace_number: str + For this resource it will always be `declined_transaction`. + """ -class TransactionSourceInboundCheck(BaseModel): +class TransactionSourceAccountTransferIntention(BaseModel): amount: int - """The amount in the minor unit of the destination account currency. + """The pending amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - check_front_image_file_id: Optional[str] - - check_number: Optional[str] - - check_rear_image_file_id: Optional[str] - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - transaction's currency. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + account currency. """ + description: str + """The description you chose to give the transfer.""" -class TransactionSourceInboundInternationalACHTransfer(BaseModel): - amount: int - """The amount in the minor unit of the destination account currency. - - For dollars, for example, this is cents. - """ - - destination_country_code: str + destination_account_id: str + """The identifier of the Account to where the Account Transfer was sent.""" - destination_currency_code: str + source_account_id: str + """The identifier of the Account from where the Account Transfer was sent.""" - foreign_exchange_indicator: str + transfer_id: str + """The identifier of the Account Transfer that led to this Pending Transaction.""" - foreign_exchange_reference: Optional[str] - foreign_exchange_reference_indicator: str +class TransactionSourceACHTransferIntention(BaseModel): + account_number: str - foreign_payment_amount: int + amount: int + """The amount in the minor unit of the transaction's currency. - foreign_trace_number: Optional[str] + For dollars, for example, this is cents. + """ - international_transaction_type_code: str + routing_number: str - originating_currency_code: str + statement_descriptor: str - originating_depository_financial_institution_branch_country: str + transfer_id: str + """The identifier of the ACH Transfer that led to this Transaction.""" - originating_depository_financial_institution_id: str - originating_depository_financial_institution_id_qualifier: str +class TransactionSourceACHTransferRejection(BaseModel): + transfer_id: str + """The identifier of the ACH Transfer that led to this Transaction.""" - originating_depository_financial_institution_name: str - originator_city: str +class TransactionSourceACHTransferReturn(BaseModel): + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was created. + """ - originator_company_entry_description: str + raw_return_reason_code: str + """The three character ACH return code, in the range R01 to R85.""" - originator_country: str + return_reason_code: Literal[ + "insufficient_fund", + "no_account", + "account_closed", + "invalid_account_number_structure", + "account_frozen_entry_returned_per_ofac_instruction", + "credit_entry_refused_by_receiver", + "unauthorized_debit_to_consumer_account_using_corporate_sec_code", + "corporate_customer_advised_not_authorized", + "payment_stopped", + "non_transaction_account", + "uncollected_funds", + "routing_number_check_digit_error", + "customer_advised_unauthorized_improper_ineligible_or_incomplete", + "amount_field_error", + "authorization_revoked_by_customer", + "invalid_ach_routing_number", + "file_record_edit_criteria", + "enr_invalid_individual_name", + "returned_per_odfi_request", + "limited_participation_dfi", + "incorrectly_coded_outbound_international_payment", + "account_sold_to_another_dfi", + "addenda_error", + "beneficiary_or_account_holder_deceased", + "customer_advised_not_within_authorization_terms", + "corrected_return", + "duplicate_entry", + "duplicate_return", + "enr_duplicate_enrollment", + "enr_invalid_dfi_account_number", + "enr_invalid_individual_id_number", + "enr_invalid_representative_payee_indicator", + "enr_invalid_transaction_code", + "enr_return_of_enr_entry", + "enr_routing_number_check_digit_error", + "entry_not_processed_by_gateway", + "field_error", + "foreign_receiving_dfi_unable_to_settle", + "iat_entry_coding_error", + "improper_effective_entry_date", + "improper_source_document_source_document_presented", + "invalid_company_id", + "invalid_foreign_receiving_dfi_identification", + "invalid_individual_id_number", + "item_and_rck_entry_presented_for_payment", + "item_related_to_rck_entry_is_ineligible", + "mandatory_field_error", + "misrouted_dishonored_return", + "misrouted_return", + "no_errors_found", + "non_acceptance_of_r62_dishonored_return", + "non_participant_in_iat_program", + "permissible_return_entry", + "permissible_return_entry_not_accepted", + "rdfi_non_settlement", + "rdfi_participant_in_check_truncation_program", + "representative_payee_deceased_or_unable_to_continue_in_that_capacity", + "return_not_a_duplicate", + "return_of_erroneous_or_reversing_debit", + "return_of_improper_credit_entry", + "return_of_improper_debit_entry", + "return_of_xck_entry", + "source_document_presented_for_payment", + "state_law_affecting_rck_acceptance", + "stop_payment_on_item_related_to_rck_entry", + "stop_payment_on_source_document", + "timely_original_return", + "trace_number_error", + "untimely_dishonored_return", + "untimely_return", + ] + """Why the ACH Transfer was returned.""" - originator_identification: str + transaction_id: str + """The identifier of the Tranasaction associated with this return.""" - originator_name: str + transfer_id: str + """The identifier of the ACH Transfer associated with this return.""" - originator_postal_code: Optional[str] - originator_state_or_province: Optional[str] +class TransactionSourceCardDisputeAcceptance(BaseModel): + accepted_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the Card Dispute was accepted. + """ - originator_street_address: str + card_dispute_id: str + """The identifier of the Card Dispute that was accepted.""" - payment_related_information: Optional[str] + transaction_id: str + """ + The identifier of the Transaction that was created to return the disputed funds + to your account. + """ - payment_related_information2: Optional[str] - receiver_city: str +class TransactionSourceCardRefund(BaseModel): + id: str + """The Card Refund identifier.""" - receiver_country: str + amount: int + """The pending amount in the minor unit of the transaction's currency. - receiver_identification_number: Optional[str] + For dollars, for example, this is cents. + """ - receiver_postal_code: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - receiver_state_or_province: Optional[str] + merchant_acceptor_id: Optional[str] + """ + The merchant identifier (commonly abbreviated as MID) of the merchant the card + is transacting with. + """ - receiver_street_address: str + merchant_category_code: str + """The 4-digit MCC describing the merchant's business.""" - receiving_company_or_individual_name: str + merchant_city: Optional[str] + """The city the merchant resides in.""" - receiving_depository_financial_institution_country: str + merchant_country: str + """The country the merchant resides in.""" - receiving_depository_financial_institution_id: str + merchant_name: Optional[str] + """The name of the merchant.""" - receiving_depository_financial_institution_id_qualifier: str + merchant_state: Optional[str] + """The state the merchant resides in.""" - receiving_depository_financial_institution_name: str + type: Literal["card_refund"] + """A constant representing the object's type. - trace_number: str + For this resource it will always be `card_refund`. + """ -class TransactionSourceInboundRealTimePaymentsTransferConfirmation(BaseModel): +class TransactionSourceCardRevenuePayment(BaseModel): amount: int - """The amount in the minor unit of the transfer's currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - creditor_name: str - """The name the sender of the transfer specified as the recipient of the transfer.""" - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's - currency. This will always be "USD" for a Real Time Payments transfer. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + currency. """ - debtor_account_number: str - """The account number of the account that sent the transfer.""" - - debtor_name: str - """The name provided by the sender of the transfer.""" + period_end: datetime + """The end of the period for which this transaction paid interest.""" - debtor_routing_number: str - """The routing number of the account that sent the transfer.""" + period_start: datetime + """The start of the period for which this transaction paid interest.""" - remittance_information: Optional[str] - """Additional information included with the transfer.""" + transacted_on_account_id: Optional[str] + """The account the card belonged to.""" - transaction_identification: str - """The Real Time Payments network identification of the transfer""" +class TransactionSourceCardSettlement(BaseModel): + id: str + """The Card Settlement identifier.""" -class TransactionSourceInboundWireDrawdownPayment(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The amount in the minor unit of the transaction's settlement currency. For dollars, for example, this is cents. """ - beneficiary_address_line1: Optional[str] + card_authorization: Optional[str] + """ + The Card Authorization that was created prior to this Card Settlement, if on + exists. + """ - beneficiary_address_line2: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's settlement currency. + """ - beneficiary_address_line3: Optional[str] + merchant_acceptor_id: Optional[str] + """ + The merchant identifier (commonly abbreviated as MID) of the merchant the card + is transacting with. + """ - beneficiary_name: Optional[str] + merchant_category_code: str + """The 4-digit MCC describing the merchant's business.""" - beneficiary_reference: Optional[str] + merchant_city: Optional[str] + """The city the merchant resides in.""" - description: str + merchant_country: str + """The country the merchant resides in.""" - input_message_accountability_data: Optional[str] + merchant_name: Optional[str] + """The name of the merchant.""" - originator_address_line1: Optional[str] + merchant_state: Optional[str] + """The state the merchant resides in.""" - originator_address_line2: Optional[str] + pending_transaction_id: Optional[str] + """The identifier of the Pending Transaction associated with this Transaction.""" - originator_address_line3: Optional[str] + presentment_amount: int + """The amount in the minor unit of the transaction's presentment currency.""" - originator_name: Optional[str] + presentment_currency: str + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's presentment currency. + """ - originator_to_beneficiary_information: Optional[str] + type: Literal["card_settlement"] + """A constant representing the object's type. + For this resource it will always be `card_settlement`. + """ -class TransactionSourceInboundWireDrawdownPaymentReversal(BaseModel): - amount: int - """The amount that was reversed.""" - description: str - """The description on the reversal message from Fedwire.""" +class TransactionSourceCheckDepositAcceptance(BaseModel): + account_number: str + """The account number printed on the check.""" - input_cycle_date: date - """The Fedwire cycle date for the wire reversal.""" + amount: int + """The amount to be deposited in the minor unit of the transaction's currency. - input_message_accountability_data: str - """The Fedwire transaction identifier.""" + For dollars, for example, this is cents. + """ - input_sequence_number: str - """The Fedwire sequence number.""" + auxiliary_on_us: Optional[str] + """An additional line of metadata printed on the check. - input_source: str - """The Fedwire input source identifier.""" + This typically includes the check number for business checks. + """ - previous_message_input_cycle_date: date - """The Fedwire cycle date for the wire transfer that was reversed.""" + check_deposit_id: str + """The ID of the Check Deposit that was accepted.""" - previous_message_input_message_accountability_data: str - """The Fedwire transaction identifier for the wire transfer that was reversed.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - previous_message_input_sequence_number: str - """The Fedwire sequence number for the wire transfer that was reversed.""" + routing_number: str + """The routing number printed on the check.""" - previous_message_input_source: str - """The Fedwire input source identifier for the wire transfer that was reversed.""" + serial_number: Optional[str] + """The check serial number, if present, for consumer checks. + + For business checks, the serial number is usually in the `auxiliary_on_us` + field. + """ -class TransactionSourceInboundWireReversal(BaseModel): +class TransactionSourceCheckDepositReturn(BaseModel): amount: int - """The amount that was reversed.""" + """The amount in the minor unit of the transaction's currency. - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which - the reversal was created. + For dollars, for example, this is cents. """ - description: str - """The description on the reversal message from Fedwire.""" + check_deposit_id: str + """The identifier of the Check Deposit that was returned.""" - financial_institution_to_financial_institution_information: Optional[str] - """Additional financial institution information included in the wire reversal.""" + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. + """ - input_cycle_date: date - """The Fedwire cycle date for the wire reversal.""" + return_reason: Literal[ + "ach_conversion_not_supported", + "closed_account", + "duplicate_submission", + "insufficient_funds", + "no_account", + "not_authorized", + "stale_dated", + "stop_payment", + "unknown_reason", + "unmatched_details", + "unreadable_image", + "endorsement_irregular", + ] - input_message_accountability_data: str - """The Fedwire transaction identifier.""" + returned_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the check deposit was returned. + """ - input_sequence_number: str - """The Fedwire sequence number.""" + transaction_id: str + """ + The identifier of the transaction that reversed the original check deposit + transaction. + """ - input_source: str - """The Fedwire input source identifier.""" - previous_message_input_cycle_date: date - """The Fedwire cycle date for the wire transfer that was reversed.""" +class TransactionSourceCheckTransferDeposit(BaseModel): + back_image_file_id: Optional[str] + """ + The identifier of the API File object containing an image of the back of the + deposited check. + """ - previous_message_input_message_accountability_data: str - """The Fedwire transaction identifier for the wire transfer that was reversed.""" + deposited_at: datetime + """When the check was deposited.""" - previous_message_input_sequence_number: str - """The Fedwire sequence number for the wire transfer that was reversed.""" + front_image_file_id: Optional[str] + """ + The identifier of the API File object containing an image of the front of the + deposited check. + """ - previous_message_input_source: str - """The Fedwire input source identifier for the wire transfer that was reversed.""" + type: Literal["check_transfer_deposit"] + """A constant representing the object's type. - receiver_financial_institution_information: Optional[str] - """ - Information included in the wire reversal for the receiving financial - institution. + For this resource it will always be `check_transfer_deposit`. """ - transaction_id: Optional[str] - """The ID for the Transaction associated with the transfer reversal.""" - wire_transfer_id: str - """The ID for the Wire Transfer that is being reversed.""" +class TransactionSourceCheckTransferIntention(BaseModel): + address_city: Optional[str] + """The city of the check's destination.""" + address_line1: Optional[str] + """The street address of the check's destination.""" + + address_line2: Optional[str] + """The second line of the address of the check's destination.""" + + address_state: Optional[str] + """The state of the check's destination.""" + + address_zip: Optional[str] + """The postal code of the check's destination.""" -class TransactionSourceInboundWireTransfer(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The transfer amount in USD cents.""" - For dollars, for example, this is cents. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's + currency. """ - beneficiary_address_line1: Optional[str] - - beneficiary_address_line2: Optional[str] + recipient_name: Optional[str] + """The name that will be printed on the check.""" - beneficiary_address_line3: Optional[str] + transfer_id: str + """The identifier of the Check Transfer with which this is associated.""" - beneficiary_name: Optional[str] - beneficiary_reference: Optional[str] +class TransactionSourceCheckTransferRejection(BaseModel): + transfer_id: str + """The identifier of the Check Transfer that led to this Transaction.""" - description: str - input_message_accountability_data: Optional[str] +class TransactionSourceCheckTransferReturn(BaseModel): + file_id: Optional[str] + """If available, a document with additional information about the return.""" - originator_address_line1: Optional[str] + reason: Literal["mail_delivery_failure", "refused_by_recipient", "returned_not_authorized"] + """The reason why the check was returned.""" - originator_address_line2: Optional[str] + returned_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the check was returned. + """ - originator_address_line3: Optional[str] + transaction_id: Optional[str] + """ + The identifier of the Transaction that was created to credit you for the + returned check. + """ - originator_name: Optional[str] + transfer_id: str + """The identifier of the returned Check Transfer.""" - originator_to_beneficiary_information: Optional[str] - originator_to_beneficiary_information_line1: Optional[str] +class TransactionSourceCheckTransferStopPaymentRequest(BaseModel): + requested_at: datetime + """The time the stop-payment was requested.""" - originator_to_beneficiary_information_line2: Optional[str] + transaction_id: str + """The transaction ID of the corresponding credit transaction.""" - originator_to_beneficiary_information_line3: Optional[str] + transfer_id: str + """The ID of the check transfer that was stopped.""" - originator_to_beneficiary_information_line4: Optional[str] + type: Literal["check_transfer_stop_payment_request"] + """A constant representing the object's type. + For this resource it will always be `check_transfer_stop_payment_request`. + """ -class TransactionSourceInterestPayment(BaseModel): - accrued_on_account_id: Optional[str] - """The account on which the interest was accrued.""" +class TransactionSourceFeePayment(BaseModel): amount: int """The amount in the minor unit of the transaction's currency. @@ -860,802 +987,675 @@ class TransactionSourceInterestPayment(BaseModel): currency. """ - period_end: datetime - """The end of the period for which this transaction paid interest.""" - - period_start: datetime - """The start of the period for which this transaction paid interest.""" - -class TransactionSourceInternalSource(BaseModel): +class TransactionSourceInboundACHTransfer(BaseModel): amount: int - """The amount in the minor unit of the transaction's currency. + """The amount in the minor unit of the destination account currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - currency. - """ - - reason: Literal[ - "account_closure", - "bank_migration", - "cashback", - "collection_receivable", - "empyreal_adjustment", - "error", - "error_correction", - "fees", - "interest", - "negative_balance_forgiveness", - "sample_funds", - "sample_funds_return", - ] - - -class TransactionSourceRealTimePaymentsTransferAcknowledgement(BaseModel): - amount: int - """The transfer amount in USD cents.""" + originator_company_descriptive_date: Optional[str] - destination_account_number: str - """The destination account number.""" + originator_company_discretionary_data: Optional[str] - destination_routing_number: str - """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" + originator_company_entry_description: str - remittance_information: str - """Unstructured information that will show on the recipient's bank statement.""" + originator_company_id: str - transfer_id: str - """The identifier of the Real Time Payments Transfer that led to this Transaction.""" + originator_company_name: str + receiver_id_number: Optional[str] -class TransactionSourceSampleFunds(BaseModel): - originator: str - """Where the sample funds came from.""" + receiver_name: Optional[str] + trace_number: str -class TransactionSourceWireTransferIntention(BaseModel): - account_number: str - """The destination account number.""" +class TransactionSourceInboundCheck(BaseModel): amount: int - """The transfer amount in USD cents.""" - - message_to_recipient: str - """The message that will show on the recipient's bank statement.""" - - routing_number: str - """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" - - transfer_id: str + """The amount in the minor unit of the destination account currency. + For dollars, for example, this is cents. + """ -class TransactionSourceWireTransferRejection(BaseModel): - transfer_id: str + check_front_image_file_id: Optional[str] + check_number: Optional[str] -class TransactionSource(BaseModel): - account_transfer_intention: Optional[TransactionSourceAccountTransferIntention] - """A Account Transfer Intention object. + check_rear_image_file_id: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `account_transfer_intention`. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - - ach_transfer_intention: Optional[TransactionSourceACHTransferIntention] - """A ACH Transfer Intention object. - - This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_intention`. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + transaction's currency. """ - ach_transfer_rejection: Optional[TransactionSourceACHTransferRejection] - """A ACH Transfer Rejection object. - - This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_rejection`. - """ - ach_transfer_return: Optional[TransactionSourceACHTransferReturn] - """A ACH Transfer Return object. +class TransactionSourceInboundInternationalACHTransfer(BaseModel): + amount: int + """The amount in the minor unit of the destination account currency. - This field will be present in the JSON response if and only if `category` is - equal to `ach_transfer_return`. + For dollars, for example, this is cents. """ - card_dispute_acceptance: Optional[TransactionSourceCardDisputeAcceptance] - """A Card Dispute Acceptance object. + destination_country_code: str - This field will be present in the JSON response if and only if `category` is - equal to `card_dispute_acceptance`. - """ + destination_currency_code: str - card_refund: Optional[TransactionSourceCardRefund] - """A Card Refund object. + foreign_exchange_indicator: str - This field will be present in the JSON response if and only if `category` is - equal to `card_refund`. - """ + foreign_exchange_reference: Optional[str] - card_revenue_payment: Optional[TransactionSourceCardRevenuePayment] - """A Card Revenue Payment object. + foreign_exchange_reference_indicator: str - This field will be present in the JSON response if and only if `category` is - equal to `card_revenue_payment`. - """ + foreign_payment_amount: int - card_settlement: Optional[TransactionSourceCardSettlement] - """A Card Settlement object. + foreign_trace_number: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `card_settlement`. - """ + international_transaction_type_code: str - category: Literal[ - "account_transfer_intention", - "ach_transfer_intention", - "ach_transfer_rejection", - "ach_transfer_return", - "card_dispute_acceptance", - "card_refund", - "card_revenue_payment", - "card_settlement", - "check_deposit_acceptance", - "check_deposit_return", - "check_transfer_deposit", - "check_transfer_intention", - "check_transfer_rejection", - "check_transfer_return", - "check_transfer_stop_payment_request", - "fee_payment", - "inbound_ach_transfer", - "inbound_ach_transfer_return_intention", - "inbound_check", - "inbound_international_ach_transfer", - "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", - "inbound_wire_drawdown_payment_reversal", - "inbound_wire_reversal", - "inbound_wire_transfer", - "interest_payment", - "internal_source", - "real_time_payments_transfer_acknowledgement", - "sample_funds", - "wire_transfer_intention", - "wire_transfer_rejection", - "other", - ] - """The type of transaction that took place. + originating_currency_code: str - We may add additional possible values for this enum over time; your application - should be able to handle such additions gracefully. - """ + originating_depository_financial_institution_branch_country: str - check_deposit_acceptance: Optional[TransactionSourceCheckDepositAcceptance] - """A Check Deposit Acceptance object. + originating_depository_financial_institution_id: str - This field will be present in the JSON response if and only if `category` is - equal to `check_deposit_acceptance`. - """ + originating_depository_financial_institution_id_qualifier: str - check_deposit_return: Optional[TransactionSourceCheckDepositReturn] - """A Check Deposit Return object. + originating_depository_financial_institution_name: str - This field will be present in the JSON response if and only if `category` is - equal to `check_deposit_return`. - """ + originator_city: str - check_transfer_deposit: Optional[TransactionSourceCheckTransferDeposit] - """A Check Transfer Deposit object. + originator_company_entry_description: str - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_deposit`. - """ + originator_country: str - check_transfer_intention: Optional[TransactionSourceCheckTransferIntention] - """A Check Transfer Intention object. + originator_identification: str - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_intention`. - """ + originator_name: str - check_transfer_rejection: Optional[TransactionSourceCheckTransferRejection] - """A Check Transfer Rejection object. + originator_postal_code: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_rejection`. - """ + originator_state_or_province: Optional[str] - check_transfer_return: Optional[TransactionSourceCheckTransferReturn] - """A Check Transfer Return object. + originator_street_address: str - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_return`. - """ + payment_related_information: Optional[str] - check_transfer_stop_payment_request: Optional[TransactionSourceCheckTransferStopPaymentRequest] - """A Check Transfer Stop Payment Request object. + payment_related_information2: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `check_transfer_stop_payment_request`. - """ + receiver_city: str + + receiver_country: str - fee_payment: Optional[TransactionSourceFeePayment] - """A Fee Payment object. + receiver_identification_number: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `fee_payment`. - """ + receiver_postal_code: Optional[str] - inbound_ach_transfer: Optional[TransactionSourceInboundACHTransfer] - """A Inbound ACH Transfer object. + receiver_state_or_province: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `inbound_ach_transfer`. - """ + receiver_street_address: str - inbound_check: Optional[TransactionSourceInboundCheck] - """A Inbound Check object. + receiving_company_or_individual_name: str - This field will be present in the JSON response if and only if `category` is - equal to `inbound_check`. - """ + receiving_depository_financial_institution_country: str - inbound_international_ach_transfer: Optional[TransactionSourceInboundInternationalACHTransfer] - """A Inbound International ACH Transfer object. + receiving_depository_financial_institution_id: str - This field will be present in the JSON response if and only if `category` is - equal to `inbound_international_ach_transfer`. - """ + receiving_depository_financial_institution_id_qualifier: str - inbound_real_time_payments_transfer_confirmation: Optional[ - TransactionSourceInboundRealTimePaymentsTransferConfirmation - ] - """A Inbound Real Time Payments Transfer Confirmation object. + receiving_depository_financial_institution_name: str - This field will be present in the JSON response if and only if `category` is - equal to `inbound_real_time_payments_transfer_confirmation`. - """ + trace_number: str - inbound_wire_drawdown_payment: Optional[TransactionSourceInboundWireDrawdownPayment] - """A Inbound Wire Drawdown Payment object. - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_drawdown_payment`. +class TransactionSourceInboundRealTimePaymentsTransferConfirmation(BaseModel): + amount: int + """The amount in the minor unit of the transfer's currency. + + For dollars, for example, this is cents. """ - inbound_wire_drawdown_payment_reversal: Optional[TransactionSourceInboundWireDrawdownPaymentReversal] - """A Inbound Wire Drawdown Payment Reversal object. + creditor_name: str + """The name the sender of the transfer specified as the recipient of the transfer.""" - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_drawdown_payment_reversal`. + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's + currency. This will always be "USD" for a Real Time Payments transfer. """ - inbound_wire_reversal: Optional[TransactionSourceInboundWireReversal] - """A Inbound Wire Reversal object. + debtor_account_number: str + """The account number of the account that sent the transfer.""" - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_reversal`. - """ + debtor_name: str + """The name provided by the sender of the transfer.""" - inbound_wire_transfer: Optional[TransactionSourceInboundWireTransfer] - """A Inbound Wire Transfer object. + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" - This field will be present in the JSON response if and only if `category` is - equal to `inbound_wire_transfer`. - """ + remittance_information: Optional[str] + """Additional information included with the transfer.""" - interest_payment: Optional[TransactionSourceInterestPayment] - """A Interest Payment object. + transaction_identification: str + """The Real Time Payments network identification of the transfer""" - This field will be present in the JSON response if and only if `category` is - equal to `interest_payment`. - """ - internal_source: Optional[TransactionSourceInternalSource] - """A Internal Source object. +class TransactionSourceInboundWireDrawdownPayment(BaseModel): + amount: int + """The amount in the minor unit of the transaction's currency. - This field will be present in the JSON response if and only if `category` is - equal to `internal_source`. + For dollars, for example, this is cents. """ - real_time_payments_transfer_acknowledgement: Optional[TransactionSourceRealTimePaymentsTransferAcknowledgement] - """A Real Time Payments Transfer Acknowledgement object. + beneficiary_address_line1: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `real_time_payments_transfer_acknowledgement`. - """ + beneficiary_address_line2: Optional[str] - sample_funds: Optional[TransactionSourceSampleFunds] - """A Sample Funds object. + beneficiary_address_line3: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `sample_funds`. - """ + beneficiary_name: Optional[str] - wire_transfer_intention: Optional[TransactionSourceWireTransferIntention] - """A Wire Transfer Intention object. + beneficiary_reference: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `wire_transfer_intention`. - """ + description: str - wire_transfer_rejection: Optional[TransactionSourceWireTransferRejection] - """A Wire Transfer Rejection object. + input_message_accountability_data: Optional[str] - This field will be present in the JSON response if and only if `category` is - equal to `wire_transfer_rejection`. - """ + originator_address_line1: Optional[str] + originator_address_line2: Optional[str] -class Transaction(BaseModel): - account_id: str - """The identifier for the Account the Transaction belongs to.""" + originator_address_line3: Optional[str] - amount: int - """The Transaction amount in the minor unit of its currency. + originator_name: Optional[str] - For dollars, for example, this is cents. - """ + originator_to_beneficiary_information: Optional[str] - created_at: datetime - """ - The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the - Transaction occured. - """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - Transaction's currency. This will match the currency on the Transcation's - Account. - """ +class TransactionSourceInboundWireDrawdownPaymentReversal(BaseModel): + amount: int + """The amount that was reversed.""" description: str - """For a Transaction related to a transfer, this is the description you provide. + """The description on the reversal message from Fedwire.""" - For a Transaction related to a payment, this is the description the vendor - provides. - """ + input_cycle_date: date + """The Fedwire cycle date for the wire reversal.""" - id: str - """The Transaction identifier.""" + input_message_accountability_data: str + """The Fedwire transaction identifier.""" - route_id: Optional[str] - """The identifier for the route this Transaction came through. + input_sequence_number: str + """The Fedwire sequence number.""" - Routes are things like cards and ACH details. - """ + input_source: str + """The Fedwire input source identifier.""" - route_type: Optional[Literal["account_number", "card"]] - """The type of the route this Transaction came through.""" + previous_message_input_cycle_date: date + """The Fedwire cycle date for the wire transfer that was reversed.""" - source: TransactionSource - """ - This is an object giving more details on the network-level event that caused the - Transaction. Note that for backwards compatibility reasons, additional - undocumented keys may appear in this object. These should be treated as - deprecated and will be removed in the future. - """ + previous_message_input_message_accountability_data: str + """The Fedwire transaction identifier for the wire transfer that was reversed.""" - type: Literal["transaction"] - """A constant representing the object's type. + previous_message_input_sequence_number: str + """The Fedwire sequence number for the wire transfer that was reversed.""" - For this resource it will always be `transaction`. - """ + previous_message_input_source: str + """The Fedwire input source identifier for the wire transfer that was reversed.""" -class DeclinedTransactionSourceACHDecline(BaseModel): +class TransactionSourceInboundWireReversal(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount that was reversed.""" - For dollars, for example, this is cents. + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the reversal was created. """ - originator_company_descriptive_date: Optional[str] + description: str + """The description on the reversal message from Fedwire.""" - originator_company_discretionary_data: Optional[str] + financial_institution_to_financial_institution_information: Optional[str] + """Additional financial institution information included in the wire reversal.""" - originator_company_id: str + input_cycle_date: date + """The Fedwire cycle date for the wire reversal.""" - originator_company_name: str + input_message_accountability_data: str + """The Fedwire transaction identifier.""" - reason: Literal[ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed", - ] - """Why the ACH transfer was declined.""" + input_sequence_number: str + """The Fedwire sequence number.""" - receiver_id_number: Optional[str] + input_source: str + """The Fedwire input source identifier.""" - receiver_name: Optional[str] + previous_message_input_cycle_date: date + """The Fedwire cycle date for the wire transfer that was reversed.""" - trace_number: str + previous_message_input_message_accountability_data: str + """The Fedwire transaction identifier for the wire transfer that was reversed.""" + previous_message_input_sequence_number: str + """The Fedwire sequence number for the wire transfer that was reversed.""" -class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): - electronic_commerce_indicator: Optional[ - Literal[ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction", - ] - ] - """ - For electronic commerce transactions, this identifies the level of security used - in obtaining the customer's payment credential. For mail or telephone order - transactions, identifies the type of mail or telephone order. - """ + previous_message_input_source: str + """The Fedwire input source identifier for the wire transfer that was reversed.""" - point_of_service_entry_mode: Optional[shared.PointOfServiceEntryMode] + receiver_financial_institution_information: Optional[str] """ - The method used to enter the cardholder's primary account number and card - expiration date + Information included in the wire reversal for the receiving financial + institution. """ + transaction_id: Optional[str] + """The ID for the Transaction associated with the transfer reversal.""" -class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): - visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa - """Fields specific to the `visa` network""" + wire_transfer_id: str + """The ID for the Wire Transfer that is being reversed.""" -class DeclinedTransactionSourceCardDecline(BaseModel): +class TransactionSourceInboundWireTransfer(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] - """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - account currency. - """ + beneficiary_address_line1: Optional[str] - digital_wallet_token_id: Optional[str] - """ - If the authorization was attempted using a Digital Wallet Token (such as an - Apple Pay purchase), the identifier of the token that was used. - """ + beneficiary_address_line2: Optional[str] - merchant_acceptor_id: str - """ - The merchant identifier (commonly abbreviated as MID) of the merchant the card - is transacting with. - """ + beneficiary_address_line3: Optional[str] - merchant_category_code: Optional[str] - """ - The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - card is transacting with. - """ + beneficiary_name: Optional[str] - merchant_city: Optional[str] - """The city the merchant resides in.""" + beneficiary_reference: Optional[str] - merchant_country: Optional[str] - """The country the merchant resides in.""" + description: str - merchant_descriptor: str - """The merchant descriptor of the merchant the card is transacting with.""" + input_message_accountability_data: Optional[str] - merchant_state: Optional[str] - """The state the merchant resides in.""" + originator_address_line1: Optional[str] - network: Literal["visa"] - """The payment network used to process this card authorization""" + originator_address_line2: Optional[str] - network_details: DeclinedTransactionSourceCardDeclineNetworkDetails - """Fields specific to the `network`""" + originator_address_line3: Optional[str] - real_time_decision_id: Optional[str] - """ - The identifier of the Real-Time Decision sent to approve or decline this - transaction. - """ + originator_name: Optional[str] - reason: Literal[ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_internal_limit", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization", - ] - """Why the transaction was declined.""" + originator_to_beneficiary_information: Optional[str] + originator_to_beneficiary_information_line1: Optional[str] + + originator_to_beneficiary_information_line2: Optional[str] + + originator_to_beneficiary_information_line3: Optional[str] + + originator_to_beneficiary_information_line4: Optional[str] + + +class TransactionSourceInterestPayment(BaseModel): + accrued_on_account_id: Optional[str] + """The account on which the interest was accrued.""" -class DeclinedTransactionSourceCheckDecline(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - auxiliary_on_us: Optional[str] + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + currency. + """ - reason: Literal[ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "not_our_item", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized", - "altered_or_fictitious", - ] - """Why the check was declined.""" + period_end: datetime + """The end of the period for which this transaction paid interest.""" + + period_start: datetime + """The start of the period for which this transaction paid interest.""" -class DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline(BaseModel): +class TransactionSourceInternalSource(BaseModel): amount: int - """The declined amount in the minor unit of the destination account currency. + """The amount in the minor unit of the transaction's currency. For dollars, for example, this is cents. """ - creditor_name: str - """The name the sender of the transfer specified as the recipient of the transfer.""" - currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined - transfer's currency. This will always be "USD" for a Real Time Payments - transfer. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + currency. """ - debtor_account_number: str - """The account number of the account that sent the transfer.""" + reason: Literal[ + "account_closure", + "bank_migration", + "cashback", + "collection_receivable", + "empyreal_adjustment", + "error", + "error_correction", + "fees", + "interest", + "negative_balance_forgiveness", + "sample_funds", + "sample_funds_return", + ] - debtor_name: str - """The name provided by the sender of the transfer.""" - debtor_routing_number: str - """The routing number of the account that sent the transfer.""" +class TransactionSourceRealTimePaymentsTransferAcknowledgement(BaseModel): + amount: int + """The transfer amount in USD cents.""" - reason: Literal[ - "account_number_canceled", - "account_number_disabled", - "account_restricted", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled", - ] - """Why the transfer was declined.""" + destination_account_number: str + """The destination account number.""" - remittance_information: Optional[str] - """Additional information included with the transfer.""" + destination_routing_number: str + """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" - transaction_identification: str - """The Real Time Payments network identification of the declined transfer.""" + remittance_information: str + """Unstructured information that will show on the recipient's bank statement.""" + transfer_id: str + """The identifier of the Real Time Payments Transfer that led to this Transaction.""" -class DeclinedTransactionSourceInternationalACHDecline(BaseModel): - amount: int - """The declined amount in the minor unit of the destination account currency. - For dollars, for example, this is cents. - """ +class TransactionSourceSampleFunds(BaseModel): + originator: str + """Where the sample funds came from.""" - destination_country_code: str - destination_currency_code: str +class TransactionSourceWireTransferIntention(BaseModel): + account_number: str + """The destination account number.""" - foreign_exchange_indicator: str + amount: int + """The transfer amount in USD cents.""" - foreign_exchange_reference: Optional[str] + message_to_recipient: str + """The message that will show on the recipient's bank statement.""" - foreign_exchange_reference_indicator: str + routing_number: str + """The American Bankers' Association (ABA) Routing Transit Number (RTN).""" - foreign_payment_amount: int + transfer_id: str - foreign_trace_number: Optional[str] - international_transaction_type_code: str +class TransactionSourceWireTransferRejection(BaseModel): + transfer_id: str - originating_currency_code: str - originating_depository_financial_institution_branch_country: str +class TransactionSource(BaseModel): + account_transfer_intention: Optional[TransactionSourceAccountTransferIntention] + """A Account Transfer Intention object. - originating_depository_financial_institution_id: str + This field will be present in the JSON response if and only if `category` is + equal to `account_transfer_intention`. + """ - originating_depository_financial_institution_id_qualifier: str + ach_transfer_intention: Optional[TransactionSourceACHTransferIntention] + """A ACH Transfer Intention object. - originating_depository_financial_institution_name: str + This field will be present in the JSON response if and only if `category` is + equal to `ach_transfer_intention`. + """ - originator_city: str + ach_transfer_rejection: Optional[TransactionSourceACHTransferRejection] + """A ACH Transfer Rejection object. - originator_company_entry_description: str + This field will be present in the JSON response if and only if `category` is + equal to `ach_transfer_rejection`. + """ - originator_country: str + ach_transfer_return: Optional[TransactionSourceACHTransferReturn] + """A ACH Transfer Return object. - originator_identification: str + This field will be present in the JSON response if and only if `category` is + equal to `ach_transfer_return`. + """ - originator_name: str + card_dispute_acceptance: Optional[TransactionSourceCardDisputeAcceptance] + """A Card Dispute Acceptance object. - originator_postal_code: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `card_dispute_acceptance`. + """ - originator_state_or_province: Optional[str] + card_refund: Optional[TransactionSourceCardRefund] + """A Card Refund object. - originator_street_address: str + This field will be present in the JSON response if and only if `category` is + equal to `card_refund`. + """ - payment_related_information: Optional[str] + card_revenue_payment: Optional[TransactionSourceCardRevenuePayment] + """A Card Revenue Payment object. + + This field will be present in the JSON response if and only if `category` is + equal to `card_revenue_payment`. + """ - payment_related_information2: Optional[str] + card_settlement: Optional[TransactionSourceCardSettlement] + """A Card Settlement object. - receiver_city: str + This field will be present in the JSON response if and only if `category` is + equal to `card_settlement`. + """ - receiver_country: str + category: Literal[ + "account_transfer_intention", + "ach_transfer_intention", + "ach_transfer_rejection", + "ach_transfer_return", + "card_dispute_acceptance", + "card_refund", + "card_revenue_payment", + "card_settlement", + "check_deposit_acceptance", + "check_deposit_return", + "check_transfer_deposit", + "check_transfer_intention", + "check_transfer_rejection", + "check_transfer_return", + "check_transfer_stop_payment_request", + "fee_payment", + "inbound_ach_transfer", + "inbound_ach_transfer_return_intention", + "inbound_check", + "inbound_international_ach_transfer", + "inbound_real_time_payments_transfer_confirmation", + "inbound_wire_drawdown_payment", + "inbound_wire_drawdown_payment_reversal", + "inbound_wire_reversal", + "inbound_wire_transfer", + "interest_payment", + "internal_source", + "real_time_payments_transfer_acknowledgement", + "sample_funds", + "wire_transfer_intention", + "wire_transfer_rejection", + "other", + ] + """The type of transaction that took place. - receiver_identification_number: Optional[str] + We may add additional possible values for this enum over time; your application + should be able to handle such additions gracefully. + """ - receiver_postal_code: Optional[str] + check_deposit_acceptance: Optional[TransactionSourceCheckDepositAcceptance] + """A Check Deposit Acceptance object. - receiver_state_or_province: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `check_deposit_acceptance`. + """ - receiver_street_address: str + check_deposit_return: Optional[TransactionSourceCheckDepositReturn] + """A Check Deposit Return object. - receiving_company_or_individual_name: str + This field will be present in the JSON response if and only if `category` is + equal to `check_deposit_return`. + """ - receiving_depository_financial_institution_country: str + check_transfer_deposit: Optional[TransactionSourceCheckTransferDeposit] + """A Check Transfer Deposit object. - receiving_depository_financial_institution_id: str + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_deposit`. + """ - receiving_depository_financial_institution_id_qualifier: str + check_transfer_intention: Optional[TransactionSourceCheckTransferIntention] + """A Check Transfer Intention object. - receiving_depository_financial_institution_name: str + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_intention`. + """ - trace_number: str + check_transfer_rejection: Optional[TransactionSourceCheckTransferRejection] + """A Check Transfer Rejection object. + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_rejection`. + """ -class DeclinedTransactionSourceWireDecline(BaseModel): - amount: int - """The declined amount in the minor unit of the destination account currency. + check_transfer_return: Optional[TransactionSourceCheckTransferReturn] + """A Check Transfer Return object. - For dollars, for example, this is cents. + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_return`. """ - beneficiary_address_line1: Optional[str] + check_transfer_stop_payment_request: Optional[TransactionSourceCheckTransferStopPaymentRequest] + """A Check Transfer Stop Payment Request object. - beneficiary_address_line2: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `check_transfer_stop_payment_request`. + """ - beneficiary_address_line3: Optional[str] + fee_payment: Optional[TransactionSourceFeePayment] + """A Fee Payment object. - beneficiary_name: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `fee_payment`. + """ - beneficiary_reference: Optional[str] + inbound_ach_transfer: Optional[TransactionSourceInboundACHTransfer] + """A Inbound ACH Transfer object. - description: str + This field will be present in the JSON response if and only if `category` is + equal to `inbound_ach_transfer`. + """ - input_message_accountability_data: Optional[str] + inbound_check: Optional[TransactionSourceInboundCheck] + """A Inbound Check object. - originator_address_line1: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_check`. + """ - originator_address_line2: Optional[str] + inbound_international_ach_transfer: Optional[TransactionSourceInboundInternationalACHTransfer] + """A Inbound International ACH Transfer object. - originator_address_line3: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_international_ach_transfer`. + """ - originator_name: Optional[str] + inbound_real_time_payments_transfer_confirmation: Optional[ + TransactionSourceInboundRealTimePaymentsTransferConfirmation + ] + """A Inbound Real Time Payments Transfer Confirmation object. - originator_to_beneficiary_information_line1: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_real_time_payments_transfer_confirmation`. + """ - originator_to_beneficiary_information_line2: Optional[str] + inbound_wire_drawdown_payment: Optional[TransactionSourceInboundWireDrawdownPayment] + """A Inbound Wire Drawdown Payment object. - originator_to_beneficiary_information_line3: Optional[str] + This field will be present in the JSON response if and only if `category` is + equal to `inbound_wire_drawdown_payment`. + """ - originator_to_beneficiary_information_line4: Optional[str] + inbound_wire_drawdown_payment_reversal: Optional[TransactionSourceInboundWireDrawdownPaymentReversal] + """A Inbound Wire Drawdown Payment Reversal object. - reason: Literal[ - "account_number_canceled", - "account_number_disabled", - "entity_not_active", - "group_locked", - "no_account_number", - "transaction_not_allowed", - ] - """Why the wire transfer was declined.""" + This field will be present in the JSON response if and only if `category` is + equal to `inbound_wire_drawdown_payment_reversal`. + """ + inbound_wire_reversal: Optional[TransactionSourceInboundWireReversal] + """A Inbound Wire Reversal object. -class DeclinedTransactionSource(BaseModel): - ach_decline: Optional[DeclinedTransactionSourceACHDecline] - """A ACH Decline object. + This field will be present in the JSON response if and only if `category` is + equal to `inbound_wire_reversal`. + """ + + inbound_wire_transfer: Optional[TransactionSourceInboundWireTransfer] + """A Inbound Wire Transfer object. This field will be present in the JSON response if and only if `category` is - equal to `ach_decline`. + equal to `inbound_wire_transfer`. """ - card_decline: Optional[DeclinedTransactionSourceCardDecline] - """A Card Decline object. + interest_payment: Optional[TransactionSourceInterestPayment] + """A Interest Payment object. This field will be present in the JSON response if and only if `category` is - equal to `card_decline`. + equal to `interest_payment`. """ - category: Literal[ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "wire_decline", - "other", - ] - """The type of decline that took place. + internal_source: Optional[TransactionSourceInternalSource] + """A Internal Source object. - We may add additional possible values for this enum over time; your application - should be able to handle such additions gracefully. + This field will be present in the JSON response if and only if `category` is + equal to `internal_source`. """ - check_decline: Optional[DeclinedTransactionSourceCheckDecline] - """A Check Decline object. + real_time_payments_transfer_acknowledgement: Optional[TransactionSourceRealTimePaymentsTransferAcknowledgement] + """A Real Time Payments Transfer Acknowledgement object. This field will be present in the JSON response if and only if `category` is - equal to `check_decline`. + equal to `real_time_payments_transfer_acknowledgement`. """ - inbound_real_time_payments_transfer_decline: Optional[ - DeclinedTransactionSourceInboundRealTimePaymentsTransferDecline - ] - """A Inbound Real Time Payments Transfer Decline object. + sample_funds: Optional[TransactionSourceSampleFunds] + """A Sample Funds object. This field will be present in the JSON response if and only if `category` is - equal to `inbound_real_time_payments_transfer_decline`. + equal to `sample_funds`. """ - international_ach_decline: Optional[DeclinedTransactionSourceInternationalACHDecline] - """A International ACH Decline object. + wire_transfer_intention: Optional[TransactionSourceWireTransferIntention] + """A Wire Transfer Intention object. This field will be present in the JSON response if and only if `category` is - equal to `international_ach_decline`. + equal to `wire_transfer_intention`. """ - wire_decline: Optional[DeclinedTransactionSourceWireDecline] - """A Wire Decline object. + wire_transfer_rejection: Optional[TransactionSourceWireTransferRejection] + """A Wire Transfer Rejection object. This field will be present in the JSON response if and only if `category` is - equal to `wire_decline`. + equal to `wire_transfer_rejection`. """ -class DeclinedTransaction(BaseModel): +class Transaction(BaseModel): + id: str + """The Transaction identifier.""" + account_id: str - """The identifier for the Account the Declined Transaction belongs to.""" + """The identifier for the Account the Transaction belongs to.""" amount: int - """The Declined Transaction amount in the minor unit of its currency. + """The Transaction amount in the minor unit of its currency. For dollars, for example, this is cents. """ @@ -1668,39 +1668,39 @@ class DeclinedTransaction(BaseModel): currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] """ - The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined - Transaction's currency. This will match the currency on the Declined - Transcation's Account. + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + Transaction's currency. This will match the currency on the Transcation's + Account. """ description: str - """This is the description the vendor provides.""" + """For a Transaction related to a transfer, this is the description you provide. - id: str - """The Declined Transaction identifier.""" + For a Transaction related to a payment, this is the description the vendor + provides. + """ route_id: Optional[str] - """The identifier for the route this Declined Transaction came through. + """The identifier for the route this Transaction came through. Routes are things like cards and ACH details. """ route_type: Optional[Literal["account_number", "card"]] - """The type of the route this Declined Transaction came through.""" + """The type of the route this Transaction came through.""" - source: DeclinedTransactionSource + source: TransactionSource """ This is an object giving more details on the network-level event that caused the - Declined Transaction. For example, for a card transaction this lists the - merchant's industry and location. Note that for backwards compatibility reasons, - additional undocumented keys may appear in this object. These should be treated - as deprecated and will be removed in the future. + Transaction. Note that for backwards compatibility reasons, additional + undocumented keys may appear in this object. These should be treated as + deprecated and will be removed in the future. """ - type: Literal["declined_transaction"] + type: Literal["transaction"] """A constant representing the object's type. - For this resource it will always be `declined_transaction`. + For this resource it will always be `transaction`. """ diff --git a/src/increase/types/simulations/interest_payment_simulation_result.py b/src/increase/types/simulations/interest_payment_simulation_result.py index fac5d5034..2609b66db 100644 --- a/src/increase/types/simulations/interest_payment_simulation_result.py +++ b/src/increase/types/simulations/interest_payment_simulation_result.py @@ -200,6 +200,9 @@ class TransactionSourceCardDisputeAcceptance(BaseModel): class TransactionSourceCardRefund(BaseModel): + id: str + """The Card Refund identifier.""" + amount: int """The pending amount in the minor unit of the transaction's currency. @@ -212,9 +215,6 @@ class TransactionSourceCardRefund(BaseModel): transaction's currency. """ - id: str - """The Card Refund identifier.""" - merchant_acceptor_id: Optional[str] """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -267,6 +267,9 @@ class TransactionSourceCardRevenuePayment(BaseModel): class TransactionSourceCardSettlement(BaseModel): + id: str + """The Card Settlement identifier.""" + amount: int """The amount in the minor unit of the transaction's settlement currency. @@ -285,9 +288,6 @@ class TransactionSourceCardSettlement(BaseModel): transaction's settlement currency. """ - id: str - """The Card Settlement identifier.""" - merchant_acceptor_id: Optional[str] """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -1182,6 +1182,9 @@ class TransactionSource(BaseModel): class Transaction(BaseModel): + id: str + """The Transaction identifier.""" + account_id: str """The identifier for the Account the Transaction belongs to.""" @@ -1211,9 +1214,6 @@ class Transaction(BaseModel): provides. """ - id: str - """The Transaction identifier.""" - route_id: Optional[str] """The identifier for the route this Transaction came through. diff --git a/src/increase/types/simulations/wire_transfer_simulation.py b/src/increase/types/simulations/wire_transfer_simulation.py index f73eb0829..bcaa279d6 100644 --- a/src/increase/types/simulations/wire_transfer_simulation.py +++ b/src/increase/types/simulations/wire_transfer_simulation.py @@ -200,6 +200,9 @@ class TransactionSourceCardDisputeAcceptance(BaseModel): class TransactionSourceCardRefund(BaseModel): + id: str + """The Card Refund identifier.""" + amount: int """The pending amount in the minor unit of the transaction's currency. @@ -212,9 +215,6 @@ class TransactionSourceCardRefund(BaseModel): transaction's currency. """ - id: str - """The Card Refund identifier.""" - merchant_acceptor_id: Optional[str] """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -267,6 +267,9 @@ class TransactionSourceCardRevenuePayment(BaseModel): class TransactionSourceCardSettlement(BaseModel): + id: str + """The Card Settlement identifier.""" + amount: int """The amount in the minor unit of the transaction's settlement currency. @@ -285,9 +288,6 @@ class TransactionSourceCardSettlement(BaseModel): transaction's settlement currency. """ - id: str - """The Card Settlement identifier.""" - merchant_acceptor_id: Optional[str] """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -1182,6 +1182,9 @@ class TransactionSource(BaseModel): class Transaction(BaseModel): + id: str + """The Transaction identifier.""" + account_id: str """The identifier for the Account the Transaction belongs to.""" @@ -1211,9 +1214,6 @@ class Transaction(BaseModel): provides. """ - id: str - """The Transaction identifier.""" - route_id: Optional[str] """The identifier for the route this Transaction came through. diff --git a/src/increase/types/transaction.py b/src/increase/types/transaction.py index 0fea9fcc4..7587b7a2b 100644 --- a/src/increase/types/transaction.py +++ b/src/increase/types/transaction.py @@ -199,6 +199,9 @@ class SourceCardDisputeAcceptance(BaseModel): class SourceCardRefund(BaseModel): + id: str + """The Card Refund identifier.""" + amount: int """The pending amount in the minor unit of the transaction's currency. @@ -211,9 +214,6 @@ class SourceCardRefund(BaseModel): transaction's currency. """ - id: str - """The Card Refund identifier.""" - merchant_acceptor_id: Optional[str] """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -266,6 +266,9 @@ class SourceCardRevenuePayment(BaseModel): class SourceCardSettlement(BaseModel): + id: str + """The Card Settlement identifier.""" + amount: int """The amount in the minor unit of the transaction's settlement currency. @@ -284,9 +287,6 @@ class SourceCardSettlement(BaseModel): transaction's settlement currency. """ - id: str - """The Card Settlement identifier.""" - merchant_acceptor_id: Optional[str] """ The merchant identifier (commonly abbreviated as MID) of the merchant the card @@ -1179,6 +1179,9 @@ class Source(BaseModel): class Transaction(BaseModel): + id: str + """The Transaction identifier.""" + account_id: str """The identifier for the Account the Transaction belongs to.""" @@ -1208,9 +1211,6 @@ class Transaction(BaseModel): provides. """ - id: str - """The Transaction identifier.""" - route_id: Optional[str] """The identifier for the route this Transaction came through. diff --git a/src/increase/types/wire_drawdown_request.py b/src/increase/types/wire_drawdown_request.py index f26197c4d..67d69f6d8 100644 --- a/src/increase/types/wire_drawdown_request.py +++ b/src/increase/types/wire_drawdown_request.py @@ -17,6 +17,9 @@ class Submission(BaseModel): class WireDrawdownRequest(BaseModel): + id: str + """The Wire drawdown request identifier.""" + account_number_id: str """ The Account Number to which the recipient of this request is being requested to @@ -38,9 +41,6 @@ class WireDrawdownRequest(BaseModel): be the identifier of the corresponding Transaction. """ - id: str - """The Wire drawdown request identifier.""" - message_to_recipient: str """The message the recipient will see as part of the drawdown request.""" diff --git a/src/increase/types/wire_transfer.py b/src/increase/types/wire_transfer.py index c3cf96186..bef8596b0 100644 --- a/src/increase/types/wire_transfer.py +++ b/src/increase/types/wire_transfer.py @@ -99,6 +99,9 @@ class Submission(BaseModel): class WireTransfer(BaseModel): + id: str + """The wire transfer's identifier.""" + account_id: str """The Account to which the transfer belongs.""" @@ -147,9 +150,6 @@ class WireTransfer(BaseModel): external_account_id: Optional[str] """The identifier of the External Account the transfer was made to, if any.""" - id: str - """The wire transfer's identifier.""" - message_to_recipient: Optional[str] """The message that will show on the recipient's bank statement."""