diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 47775e91..f118d043 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.127.0" + ".": "0.128.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0d68f63a..61b1e699 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 213 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-185b3d93b4e6ed5ae02c32f0bc9133b0ac99dcd1263a12b7aa9ba64e71a5461e.yml -openapi_spec_hash: 2418116f58a464afdd5611865e860d30 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-47e9f78d22682623e313f1689f5fa7e3420575ff285a14a2f4704c49ffb6b72e.yml +openapi_spec_hash: 4797fe46d942cb32e648a79015783d01 config_hash: 5bb913c05ebeb301ec925b16e75bb251 diff --git a/CHANGELOG.md b/CHANGELOG.md index f3dcd86b..73d76d74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.128.0 (2026-06-23) + +Full Changelog: [v0.127.0...v0.128.0](https://github.com/lithic-com/lithic-python/compare/v0.127.0...v0.128.0) + +### Features + +* **api:** add claim and claim_document webhook events ([512d4fa](https://github.com/lithic-com/lithic-python/commit/512d4fad7f07a4e9756cd5c5b16693bcd2105262)) +* **api:** add external bank/payment velocity/declines/history features to auth_rules ([11d71e3](https://github.com/lithic-com/lithic-python/commit/11d71e30f57728e98b9d8c90077d355b08cbc89c)) + ## 0.127.0 (2026-06-22) Full Changelog: [v0.126.0...v0.127.0](https://github.com/lithic-com/lithic-python/compare/v0.126.0...v0.127.0) diff --git a/api.md b/api.md index 7a89bb78..21d83b17 100644 --- a/api.md +++ b/api.md @@ -1003,6 +1003,11 @@ from lithic.types import ( CardTransactionUpdatedWebhookEvent, CardTransactionEnhancedDataCreatedWebhookEvent, CardTransactionEnhancedDataUpdatedWebhookEvent, + ClaimCreatedWebhookEvent, + ClaimUpdatedWebhookEvent, + ClaimDocumentUploadedWebhookEvent, + ClaimDocumentAcceptedWebhookEvent, + ClaimDocumentRejectedWebhookEvent, DigitalWalletTokenizationApprovalRequestWebhookEvent, DigitalWalletTokenizationResultWebhookEvent, DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, diff --git a/pyproject.toml b/pyproject.toml index f8881486..0d1491ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.127.0" +version = "0.128.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/lithic/_version.py b/src/lithic/_version.py index 0f07ebf8..4fcbf72e 100644 --- a/src/lithic/_version.py +++ b/src/lithic/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "lithic" -__version__ = "0.127.0" # x-release-please-version +__version__ = "0.128.0" # x-release-please-version diff --git a/src/lithic/resources/events/events.py b/src/lithic/resources/events/events.py index c234e310..e81e5c2f 100644 --- a/src/lithic/resources/events/events.py +++ b/src/lithic/resources/events/events.py @@ -127,6 +127,11 @@ def list( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -403,6 +408,11 @@ def list( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/resources/events/subscriptions.py b/src/lithic/resources/events/subscriptions.py index 80ba0b28..1a622e2a 100644 --- a/src/lithic/resources/events/subscriptions.py +++ b/src/lithic/resources/events/subscriptions.py @@ -79,6 +79,11 @@ def create( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -227,6 +232,11 @@ def update( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -698,6 +708,11 @@ def send_simulated_example( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -823,6 +838,11 @@ async def create( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -971,6 +991,11 @@ async def update( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -1442,6 +1467,11 @@ async def send_simulated_example( "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/types/__init__.py b/src/lithic/types/__init__.py index 8e028bf4..3ea5203b 100644 --- a/src/lithic/types/__init__.py +++ b/src/lithic/types/__init__.py @@ -126,6 +126,8 @@ from .card_bulk_order_list_params import CardBulkOrderListParams as CardBulkOrderListParams from .card_reissued_webhook_event import CardReissuedWebhookEvent as CardReissuedWebhookEvent from .card_web_provision_response import CardWebProvisionResponse as CardWebProvisionResponse +from .claim_created_webhook_event import ClaimCreatedWebhookEvent as ClaimCreatedWebhookEvent +from .claim_updated_webhook_event import ClaimUpdatedWebhookEvent as ClaimUpdatedWebhookEvent from .network_program_list_params import NetworkProgramListParams as NetworkProgramListParams from .tokenization_decline_reason import TokenizationDeclineReason as TokenizationDeclineReason from .account_activity_list_params import AccountActivityListParams as AccountActivityListParams @@ -192,6 +194,15 @@ from .account_holder_upload_document_params import ( AccountHolderUploadDocumentParams as AccountHolderUploadDocumentParams, ) +from .claim_document_accepted_webhook_event import ( + ClaimDocumentAcceptedWebhookEvent as ClaimDocumentAcceptedWebhookEvent, +) +from .claim_document_rejected_webhook_event import ( + ClaimDocumentRejectedWebhookEvent as ClaimDocumentRejectedWebhookEvent, +) +from .claim_document_uploaded_webhook_event import ( + ClaimDocumentUploadedWebhookEvent as ClaimDocumentUploadedWebhookEvent, +) from .external_bank_account_create_response import ( ExternalBankAccountCreateResponse as ExternalBankAccountCreateResponse, ) diff --git a/src/lithic/types/auth_rules/rule_feature.py b/src/lithic/types/auth_rules/rule_feature.py index 132095b2..32bb1250 100644 --- a/src/lithic/types/auth_rules/rule_feature.py +++ b/src/lithic/types/auth_rules/rule_feature.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Dict, List, Union, Optional from typing_extensions import Literal, TypeAlias from ..._models import BaseModel @@ -15,11 +15,16 @@ "ACHReceiptFeature", "CardTransactionFeature", "ACHPaymentFeature", + "ExternalBankAccountFeature", "CardFeature", "AccountHolderFeature", "IPMetadataFeature", "SpendVelocityFeature", + "PaymentVelocityFeature", + "PaymentVelocityFeatureFilters", "TransactionHistorySignalsFeature", + "ConsecutiveDeclinesFeature", + "ACHPaymentHistoryFeature", ] @@ -65,6 +70,13 @@ class ACHPaymentFeature(BaseModel): """The variable name for this feature in the rule function signature""" +class ExternalBankAccountFeature(BaseModel): + type: Literal["EXTERNAL_BANK_ACCOUNT"] + + name: Optional[str] = None + """The variable name for this feature in the rule function signature""" + + class CardFeature(BaseModel): type: Literal["CARD"] @@ -101,6 +113,53 @@ class SpendVelocityFeature(BaseModel): """The variable name for this feature in the rule function signature""" +class PaymentVelocityFeatureFilters(BaseModel): + """Optional filters applied when aggregating ACH payment velocity. + + Payments not matching the provided filters are excluded from the calculated velocity. + """ + + exclude_tags: Optional[Dict[str, str]] = None + """Exclude payments matching any of the provided tag key-value pairs.""" + + include_payment_types: Optional[List[Literal["ORIGINATION", "RECEIPT"]]] = None + """Payment types to include in the velocity calculation.""" + + include_polarities: Optional[List[Literal["CREDIT", "DEBIT"]]] = None + """Payment polarities to include in the velocity calculation.""" + + include_statuses: Optional[List[Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]]] = ( + None + ) + """Payment statuses to include in the velocity calculation.""" + + include_tags: Optional[Dict[str, str]] = None + """Only include payments matching all of the provided tag key-value pairs.""" + + result: Optional[Literal["APPROVED", "DECLINED"]] = None + """Only include payments with the given result.""" + + +class PaymentVelocityFeature(BaseModel): + period: VelocityLimitPeriod + """Velocity over the current day since 00:00 / 12 AM in Eastern Time""" + + scope: Literal["FINANCIAL_ACCOUNT", "GLOBAL"] + """The scope over which the ACH payment velocity is aggregated.""" + + type: Literal["PAYMENT_VELOCITY"] + + filters: Optional[PaymentVelocityFeatureFilters] = None + """Optional filters applied when aggregating ACH payment velocity. + + Payments not matching the provided filters are excluded from the calculated + velocity. + """ + + name: Optional[str] = None + """The variable name for this feature in the rule function signature""" + + class TransactionHistorySignalsFeature(BaseModel): scope: Literal["CARD", "ACCOUNT", "BUSINESS_ACCOUNT"] """The entity scope to load transaction history signals for.""" @@ -111,6 +170,26 @@ class TransactionHistorySignalsFeature(BaseModel): """The variable name for this feature in the rule function signature""" +class ConsecutiveDeclinesFeature(BaseModel): + scope: Literal["CARD", "ACCOUNT"] + """The entity scope to count consecutive declines for.""" + + type: Literal["CONSECUTIVE_DECLINES"] + + name: Optional[str] = None + """The variable name for this feature in the rule function signature""" + + +class ACHPaymentHistoryFeature(BaseModel): + scope: Literal["FINANCIAL_ACCOUNT"] + """The entity scope to load ACH payment history for.""" + + type: Literal["ACH_PAYMENT_HISTORY"] + + name: Optional[str] = None + """The variable name for this feature in the rule function signature""" + + RuleFeature: TypeAlias = Union[ AuthorizationFeature, AuthenticationFeature, @@ -118,9 +197,13 @@ class TransactionHistorySignalsFeature(BaseModel): ACHReceiptFeature, CardTransactionFeature, ACHPaymentFeature, + ExternalBankAccountFeature, CardFeature, AccountHolderFeature, IPMetadataFeature, SpendVelocityFeature, + PaymentVelocityFeature, TransactionHistorySignalsFeature, + ConsecutiveDeclinesFeature, + ACHPaymentHistoryFeature, ] diff --git a/src/lithic/types/auth_rules/rule_feature_param.py b/src/lithic/types/auth_rules/rule_feature_param.py index 85976075..0a420430 100644 --- a/src/lithic/types/auth_rules/rule_feature_param.py +++ b/src/lithic/types/auth_rules/rule_feature_param.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import Dict, List, Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .velocity_limit_period_param import VelocityLimitPeriodParam @@ -16,11 +16,16 @@ "ACHReceiptFeature", "CardTransactionFeature", "ACHPaymentFeature", + "ExternalBankAccountFeature", "CardFeature", "AccountHolderFeature", "IPMetadataFeature", "SpendVelocityFeature", + "PaymentVelocityFeature", + "PaymentVelocityFeatureFilters", "TransactionHistorySignalsFeature", + "ConsecutiveDeclinesFeature", + "ACHPaymentHistoryFeature", ] @@ -66,6 +71,13 @@ class ACHPaymentFeature(TypedDict, total=False): """The variable name for this feature in the rule function signature""" +class ExternalBankAccountFeature(TypedDict, total=False): + type: Required[Literal["EXTERNAL_BANK_ACCOUNT"]] + + name: str + """The variable name for this feature in the rule function signature""" + + class CardFeature(TypedDict, total=False): type: Required[Literal["CARD"]] @@ -102,6 +114,51 @@ class SpendVelocityFeature(TypedDict, total=False): """The variable name for this feature in the rule function signature""" +class PaymentVelocityFeatureFilters(TypedDict, total=False): + """Optional filters applied when aggregating ACH payment velocity. + + Payments not matching the provided filters are excluded from the calculated velocity. + """ + + exclude_tags: Optional[Dict[str, str]] + """Exclude payments matching any of the provided tag key-value pairs.""" + + include_payment_types: Optional[List[Literal["ORIGINATION", "RECEIPT"]]] + """Payment types to include in the velocity calculation.""" + + include_polarities: Optional[List[Literal["CREDIT", "DEBIT"]]] + """Payment polarities to include in the velocity calculation.""" + + include_statuses: Optional[List[Literal["PENDING", "SETTLED", "DECLINED", "REVERSED", "CANCELED", "RETURNED"]]] + """Payment statuses to include in the velocity calculation.""" + + include_tags: Optional[Dict[str, str]] + """Only include payments matching all of the provided tag key-value pairs.""" + + result: Literal["APPROVED", "DECLINED"] + """Only include payments with the given result.""" + + +class PaymentVelocityFeature(TypedDict, total=False): + period: Required[VelocityLimitPeriodParam] + """Velocity over the current day since 00:00 / 12 AM in Eastern Time""" + + scope: Required[Literal["FINANCIAL_ACCOUNT", "GLOBAL"]] + """The scope over which the ACH payment velocity is aggregated.""" + + type: Required[Literal["PAYMENT_VELOCITY"]] + + filters: PaymentVelocityFeatureFilters + """Optional filters applied when aggregating ACH payment velocity. + + Payments not matching the provided filters are excluded from the calculated + velocity. + """ + + name: str + """The variable name for this feature in the rule function signature""" + + class TransactionHistorySignalsFeature(TypedDict, total=False): scope: Required[Literal["CARD", "ACCOUNT", "BUSINESS_ACCOUNT"]] """The entity scope to load transaction history signals for.""" @@ -112,6 +169,26 @@ class TransactionHistorySignalsFeature(TypedDict, total=False): """The variable name for this feature in the rule function signature""" +class ConsecutiveDeclinesFeature(TypedDict, total=False): + scope: Required[Literal["CARD", "ACCOUNT"]] + """The entity scope to count consecutive declines for.""" + + type: Required[Literal["CONSECUTIVE_DECLINES"]] + + name: str + """The variable name for this feature in the rule function signature""" + + +class ACHPaymentHistoryFeature(TypedDict, total=False): + scope: Required[Literal["FINANCIAL_ACCOUNT"]] + """The entity scope to load ACH payment history for.""" + + type: Required[Literal["ACH_PAYMENT_HISTORY"]] + + name: str + """The variable name for this feature in the rule function signature""" + + RuleFeatureParam: TypeAlias = Union[ AuthorizationFeature, AuthenticationFeature, @@ -119,9 +196,13 @@ class TransactionHistorySignalsFeature(TypedDict, total=False): ACHReceiptFeature, CardTransactionFeature, ACHPaymentFeature, + ExternalBankAccountFeature, CardFeature, AccountHolderFeature, IPMetadataFeature, SpendVelocityFeature, + PaymentVelocityFeature, TransactionHistorySignalsFeature, + ConsecutiveDeclinesFeature, + ACHPaymentHistoryFeature, ] diff --git a/src/lithic/types/claim_created_webhook_event.py b/src/lithic/types/claim_created_webhook_event.py new file mode 100644 index 00000000..f8bb744b --- /dev/null +++ b/src/lithic/types/claim_created_webhook_event.py @@ -0,0 +1,83 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ClaimCreatedWebhookEvent", "DisputedTransaction"] + + +class DisputedTransaction(BaseModel): + """ + A transaction included in a claim, along with the specific events being disputed. + """ + + event_tokens: List[str] + """Tokens for the specific events within the transaction being disputed. + + Lithic creates one dispute per event token + """ + + transaction_token: str + """Token for the transaction being disputed, in UUID format""" + + +class ClaimCreatedWebhookEvent(BaseModel): + token: str + """Unique identifier for the claim, in UUID format""" + + account_holder_token: Optional[str] = None + """Token for the account holder that filed the claim""" + + account_token: Optional[str] = None + """Token for the account associated with the claim""" + + card_tokens: List[str] + """Tokens for the cards associated with the disputed transactions""" + + created: datetime + """When the claim was created""" + + disputed_transactions: List[DisputedTransaction] + """Transactions included in this claim""" + + event_type: Literal["claim.created"] + """The type of event that occurred.""" + + outstanding_requirements: List[Literal["QUESTIONNAIRE", "DOCUMENTS"]] + """Requirements that must be fulfilled before the claim can be submitted""" + + reason: Literal[ + "CARD_NOT_PRESENT", + "CARD_LOST", + "CARD_STOLEN", + "CARD_NEVER_RECEIVED", + "COUNTERFEIT", + "ACCOUNT_TAKEOVER", + "PRODUCT_NOT_RECEIVED", + "NOT_AS_DESCRIBED", + "CREDIT_NOT_PROCESSED", + "CANCELLED_RECURRING", + "PAID_BY_OTHER_MEANS", + "DUPLICATE_CHARGE", + "LATE_PRESENTMENT", + "INCORRECT_TRANSACTION_CODE", + "NO_AUTHORIZATION", + "DECLINED", + "INCORRECT_AMOUNT", + "ATM_CASH_NOT_DISPENSED", + "ATM_DEPOSIT_WRONG_AMOUNT", + "ATM_DEPOSIT_MISSING", + ] + """Dispute reason code provided when creating the claim""" + + status: Literal["INITIALIZING", "AWAITING_INFO", "SUBMITTED", "RESOLVED", "ABANDONED"] + """Current lifecycle status of the claim""" + + submitted: Optional[datetime] = None + """When the claim was submitted. Null until the claim reaches `SUBMITTED` status""" + + updated: datetime + """When the claim was last updated""" diff --git a/src/lithic/types/claim_document_accepted_webhook_event.py b/src/lithic/types/claim_document_accepted_webhook_event.py new file mode 100644 index 00000000..60748b18 --- /dev/null +++ b/src/lithic/types/claim_document_accepted_webhook_event.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ClaimDocumentAcceptedWebhookEvent", "UploadConstraints"] + + +class UploadConstraints(BaseModel): + """Constraints that an uploaded file must satisfy.""" + + accepted_mime_types: List[str] + """MIME types accepted for upload""" + + max_size_bytes: Optional[int] = None + """Maximum file size in bytes. Null if there is no enforced size limit""" + + +class ClaimDocumentAcceptedWebhookEvent(BaseModel): + token: str + """Unique identifier for the document, in UUID format""" + + created: datetime + """When the document was created""" + + download_url: Optional[str] = None + """Presigned URL for downloading the uploaded document. + + Available once the document is being validated or has been accepted + (`VALIDATING` or `ACCEPTED`) + """ + + download_url_expires_at: Optional[datetime] = None + """When the download URL expires""" + + event_type: Literal["claim_document.accepted"] + """The type of event that occurred.""" + + failure_reason: Optional[Literal["INVALID_MIME_TYPE", "FILE_TOO_LARGE", "FILE_EMPTY", "CORRUPT_FILE", "OTHER"]] = ( + None + ) + """Reason the document failed validation. Null unless `status` is `REJECTED`""" + + name: str + """Name provided when the upload intent was created""" + + requirement_id: Optional[str] = None + """Identifier of the document requirement this document satisfies. + + Null for supplemental documents not tied to a specific requirement + """ + + status: Literal["PENDING", "VALIDATING", "ACCEPTED", "REJECTED"] + """Current validation status of the document""" + + updated: datetime + """When the document was last updated""" + + upload_constraints: Optional[UploadConstraints] = None + """Constraints that an uploaded file must satisfy.""" + + upload_url: Optional[str] = None + """Presigned URL for uploading the file via HTTP PUT. + + Null after the upload window expires or after the document has been validated + """ + + upload_url_expires_at: Optional[datetime] = None + """When the upload URL expires""" diff --git a/src/lithic/types/claim_document_rejected_webhook_event.py b/src/lithic/types/claim_document_rejected_webhook_event.py new file mode 100644 index 00000000..bcd3fc2b --- /dev/null +++ b/src/lithic/types/claim_document_rejected_webhook_event.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ClaimDocumentRejectedWebhookEvent", "UploadConstraints"] + + +class UploadConstraints(BaseModel): + """Constraints that an uploaded file must satisfy.""" + + accepted_mime_types: List[str] + """MIME types accepted for upload""" + + max_size_bytes: Optional[int] = None + """Maximum file size in bytes. Null if there is no enforced size limit""" + + +class ClaimDocumentRejectedWebhookEvent(BaseModel): + token: str + """Unique identifier for the document, in UUID format""" + + created: datetime + """When the document was created""" + + download_url: Optional[str] = None + """Presigned URL for downloading the uploaded document. + + Available once the document is being validated or has been accepted + (`VALIDATING` or `ACCEPTED`) + """ + + download_url_expires_at: Optional[datetime] = None + """When the download URL expires""" + + event_type: Literal["claim_document.rejected"] + """The type of event that occurred.""" + + failure_reason: Optional[Literal["INVALID_MIME_TYPE", "FILE_TOO_LARGE", "FILE_EMPTY", "CORRUPT_FILE", "OTHER"]] = ( + None + ) + """Reason the document failed validation. Null unless `status` is `REJECTED`""" + + name: str + """Name provided when the upload intent was created""" + + requirement_id: Optional[str] = None + """Identifier of the document requirement this document satisfies. + + Null for supplemental documents not tied to a specific requirement + """ + + status: Literal["PENDING", "VALIDATING", "ACCEPTED", "REJECTED"] + """Current validation status of the document""" + + updated: datetime + """When the document was last updated""" + + upload_constraints: Optional[UploadConstraints] = None + """Constraints that an uploaded file must satisfy.""" + + upload_url: Optional[str] = None + """Presigned URL for uploading the file via HTTP PUT. + + Null after the upload window expires or after the document has been validated + """ + + upload_url_expires_at: Optional[datetime] = None + """When the upload URL expires""" diff --git a/src/lithic/types/claim_document_uploaded_webhook_event.py b/src/lithic/types/claim_document_uploaded_webhook_event.py new file mode 100644 index 00000000..57816392 --- /dev/null +++ b/src/lithic/types/claim_document_uploaded_webhook_event.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ClaimDocumentUploadedWebhookEvent", "UploadConstraints"] + + +class UploadConstraints(BaseModel): + """Constraints that an uploaded file must satisfy.""" + + accepted_mime_types: List[str] + """MIME types accepted for upload""" + + max_size_bytes: Optional[int] = None + """Maximum file size in bytes. Null if there is no enforced size limit""" + + +class ClaimDocumentUploadedWebhookEvent(BaseModel): + token: str + """Unique identifier for the document, in UUID format""" + + created: datetime + """When the document was created""" + + download_url: Optional[str] = None + """Presigned URL for downloading the uploaded document. + + Available once the document is being validated or has been accepted + (`VALIDATING` or `ACCEPTED`) + """ + + download_url_expires_at: Optional[datetime] = None + """When the download URL expires""" + + event_type: Literal["claim_document.uploaded"] + """The type of event that occurred.""" + + failure_reason: Optional[Literal["INVALID_MIME_TYPE", "FILE_TOO_LARGE", "FILE_EMPTY", "CORRUPT_FILE", "OTHER"]] = ( + None + ) + """Reason the document failed validation. Null unless `status` is `REJECTED`""" + + name: str + """Name provided when the upload intent was created""" + + requirement_id: Optional[str] = None + """Identifier of the document requirement this document satisfies. + + Null for supplemental documents not tied to a specific requirement + """ + + status: Literal["PENDING", "VALIDATING", "ACCEPTED", "REJECTED"] + """Current validation status of the document""" + + updated: datetime + """When the document was last updated""" + + upload_constraints: Optional[UploadConstraints] = None + """Constraints that an uploaded file must satisfy.""" + + upload_url: Optional[str] = None + """Presigned URL for uploading the file via HTTP PUT. + + Null after the upload window expires or after the document has been validated + """ + + upload_url_expires_at: Optional[datetime] = None + """When the upload URL expires""" diff --git a/src/lithic/types/claim_updated_webhook_event.py b/src/lithic/types/claim_updated_webhook_event.py new file mode 100644 index 00000000..d7629608 --- /dev/null +++ b/src/lithic/types/claim_updated_webhook_event.py @@ -0,0 +1,83 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ClaimUpdatedWebhookEvent", "DisputedTransaction"] + + +class DisputedTransaction(BaseModel): + """ + A transaction included in a claim, along with the specific events being disputed. + """ + + event_tokens: List[str] + """Tokens for the specific events within the transaction being disputed. + + Lithic creates one dispute per event token + """ + + transaction_token: str + """Token for the transaction being disputed, in UUID format""" + + +class ClaimUpdatedWebhookEvent(BaseModel): + token: str + """Unique identifier for the claim, in UUID format""" + + account_holder_token: Optional[str] = None + """Token for the account holder that filed the claim""" + + account_token: Optional[str] = None + """Token for the account associated with the claim""" + + card_tokens: List[str] + """Tokens for the cards associated with the disputed transactions""" + + created: datetime + """When the claim was created""" + + disputed_transactions: List[DisputedTransaction] + """Transactions included in this claim""" + + event_type: Literal["claim.updated"] + """The type of event that occurred.""" + + outstanding_requirements: List[Literal["QUESTIONNAIRE", "DOCUMENTS"]] + """Requirements that must be fulfilled before the claim can be submitted""" + + reason: Literal[ + "CARD_NOT_PRESENT", + "CARD_LOST", + "CARD_STOLEN", + "CARD_NEVER_RECEIVED", + "COUNTERFEIT", + "ACCOUNT_TAKEOVER", + "PRODUCT_NOT_RECEIVED", + "NOT_AS_DESCRIBED", + "CREDIT_NOT_PROCESSED", + "CANCELLED_RECURRING", + "PAID_BY_OTHER_MEANS", + "DUPLICATE_CHARGE", + "LATE_PRESENTMENT", + "INCORRECT_TRANSACTION_CODE", + "NO_AUTHORIZATION", + "DECLINED", + "INCORRECT_AMOUNT", + "ATM_CASH_NOT_DISPENSED", + "ATM_DEPOSIT_WRONG_AMOUNT", + "ATM_DEPOSIT_MISSING", + ] + """Dispute reason code provided when creating the claim""" + + status: Literal["INITIALIZING", "AWAITING_INFO", "SUBMITTED", "RESOLVED", "ABANDONED"] + """Current lifecycle status of the claim""" + + submitted: Optional[datetime] = None + """When the claim was submitted. Null until the claim reaches `SUBMITTED` status""" + + updated: datetime + """When the claim was last updated""" diff --git a/src/lithic/types/event.py b/src/lithic/types/event.py index 9866fb12..2d663b0a 100644 --- a/src/lithic/types/event.py +++ b/src/lithic/types/event.py @@ -41,6 +41,11 @@ class Event(BaseModel): "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", @@ -109,6 +114,15 @@ class Event(BaseModel): - card.renewed: Occurs when a card is renewed. - card.shipped: Occurs when a card is shipped. - card.updated: Occurs when a card is updated. + - claim_document.accepted: Occurs when a claim document passes validation and is + accepted. + - claim_document.rejected: Occurs when a claim document fails validation and is + rejected. + - claim_document.uploaded: Occurs when a claim document is uploaded and begins + validation. + - claim.created: Occurs when a dispute intake claim is created. + - claim.updated: Occurs when a dispute intake claim is updated, such as a status + change or a change to its outstanding requirements. - digital_wallet.tokenization_result: Occurs when a tokenization request succeeded or failed. diff --git a/src/lithic/types/event_list_params.py b/src/lithic/types/event_list_params.py index b0c037d4..942d5943 100644 --- a/src/lithic/types/event_list_params.py +++ b/src/lithic/types/event_list_params.py @@ -51,6 +51,11 @@ class EventListParams(TypedDict, total=False): "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/types/event_subscription.py b/src/lithic/types/event_subscription.py index 2b49b308..76556966 100644 --- a/src/lithic/types/event_subscription.py +++ b/src/lithic/types/event_subscription.py @@ -44,6 +44,11 @@ class EventSubscription(BaseModel): "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/types/events/subscription_create_params.py b/src/lithic/types/events/subscription_create_params.py index 4c3f5282..965d26f1 100644 --- a/src/lithic/types/events/subscription_create_params.py +++ b/src/lithic/types/events/subscription_create_params.py @@ -39,6 +39,11 @@ class SubscriptionCreateParams(TypedDict, total=False): "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/types/events/subscription_send_simulated_example_params.py b/src/lithic/types/events/subscription_send_simulated_example_params.py index 348c8ef7..f86b8eb7 100644 --- a/src/lithic/types/events/subscription_send_simulated_example_params.py +++ b/src/lithic/types/events/subscription_send_simulated_example_params.py @@ -28,6 +28,11 @@ class SubscriptionSendSimulatedExampleParams(TypedDict, total=False): "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/types/events/subscription_update_params.py b/src/lithic/types/events/subscription_update_params.py index b30bdde0..701e60a9 100644 --- a/src/lithic/types/events/subscription_update_params.py +++ b/src/lithic/types/events/subscription_update_params.py @@ -39,6 +39,11 @@ class SubscriptionUpdateParams(TypedDict, total=False): "card.renewed", "card.shipped", "card.updated", + "claim_document.accepted", + "claim_document.rejected", + "claim_document.uploaded", + "claim.created", + "claim.updated", "digital_wallet.tokenization_result", "digital_wallet.tokenization_two_factor_authentication_code", "digital_wallet.tokenization_two_factor_authentication_code_sent", diff --git a/src/lithic/types/parsed_webhook_event.py b/src/lithic/types/parsed_webhook_event.py index c6116e6c..c5684335 100644 --- a/src/lithic/types/parsed_webhook_event.py +++ b/src/lithic/types/parsed_webhook_event.py @@ -11,6 +11,8 @@ from .card_shipped_webhook_event import CardShippedWebhookEvent from .card_updated_webhook_event import CardUpdatedWebhookEvent from .card_reissued_webhook_event import CardReissuedWebhookEvent +from .claim_created_webhook_event import ClaimCreatedWebhookEvent +from .claim_updated_webhook_event import ClaimUpdatedWebhookEvent from .card_converted_webhook_event import CardConvertedWebhookEvent from .balance_updated_webhook_event import BalanceUpdatedWebhookEvent from .dispute_updated_webhook_event import DisputeUpdatedWebhookEvent @@ -23,6 +25,9 @@ from .network_total_created_webhook_event import NetworkTotalCreatedWebhookEvent from .network_total_updated_webhook_event import NetworkTotalUpdatedWebhookEvent from .account_holder_created_webhook_event import AccountHolderCreatedWebhookEvent +from .claim_document_accepted_webhook_event import ClaimDocumentAcceptedWebhookEvent +from .claim_document_rejected_webhook_event import ClaimDocumentRejectedWebhookEvent +from .claim_document_uploaded_webhook_event import ClaimDocumentUploadedWebhookEvent from .card_transaction_updated_webhook_event import CardTransactionUpdatedWebhookEvent from .external_payment_created_webhook_event import ExternalPaymentCreatedWebhookEvent from .external_payment_updated_webhook_event import ExternalPaymentUpdatedWebhookEvent @@ -448,6 +453,11 @@ class LegacyPayload(BaseModel): CardTransactionUpdatedWebhookEvent, CardTransactionEnhancedDataCreatedWebhookEvent, CardTransactionEnhancedDataUpdatedWebhookEvent, + ClaimCreatedWebhookEvent, + ClaimUpdatedWebhookEvent, + ClaimDocumentUploadedWebhookEvent, + ClaimDocumentAcceptedWebhookEvent, + ClaimDocumentRejectedWebhookEvent, DigitalWalletTokenizationApprovalRequestWebhookEvent, DigitalWalletTokenizationResultWebhookEvent, DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent,