Skip to content

Commit 8e5cdbb

Browse files
feat(api): add claim and claim_document webhook events
1 parent 3133760 commit 8e5cdbb

17 files changed

Lines changed: 489 additions & 2 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 213
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-185b3d93b4e6ed5ae02c32f0bc9133b0ac99dcd1263a12b7aa9ba64e71a5461e.yml
3-
openapi_spec_hash: 2418116f58a464afdd5611865e860d30
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-48e8284d7f1f51f36402cf5f22a23b27071af86110e2aeddb8da06f8c790fd3d.yml
3+
openapi_spec_hash: a64ba9e94686bce4f0a8c5b1b3c704da
44
config_hash: 5bb913c05ebeb301ec925b16e75bb251

api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,11 @@ from lithic.types import (
10031003
CardTransactionUpdatedWebhookEvent,
10041004
CardTransactionEnhancedDataCreatedWebhookEvent,
10051005
CardTransactionEnhancedDataUpdatedWebhookEvent,
1006+
ClaimCreatedWebhookEvent,
1007+
ClaimUpdatedWebhookEvent,
1008+
ClaimDocumentUploadedWebhookEvent,
1009+
ClaimDocumentAcceptedWebhookEvent,
1010+
ClaimDocumentRejectedWebhookEvent,
10061011
DigitalWalletTokenizationApprovalRequestWebhookEvent,
10071012
DigitalWalletTokenizationResultWebhookEvent,
10081013
DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent,

src/lithic/resources/events/events.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ def list(
127127
"card.renewed",
128128
"card.shipped",
129129
"card.updated",
130+
"claim_document.accepted",
131+
"claim_document.rejected",
132+
"claim_document.uploaded",
133+
"claim.created",
134+
"claim.updated",
130135
"digital_wallet.tokenization_result",
131136
"digital_wallet.tokenization_two_factor_authentication_code",
132137
"digital_wallet.tokenization_two_factor_authentication_code_sent",
@@ -403,6 +408,11 @@ def list(
403408
"card.renewed",
404409
"card.shipped",
405410
"card.updated",
411+
"claim_document.accepted",
412+
"claim_document.rejected",
413+
"claim_document.uploaded",
414+
"claim.created",
415+
"claim.updated",
406416
"digital_wallet.tokenization_result",
407417
"digital_wallet.tokenization_two_factor_authentication_code",
408418
"digital_wallet.tokenization_two_factor_authentication_code_sent",

src/lithic/resources/events/subscriptions.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ def create(
7979
"card.renewed",
8080
"card.shipped",
8181
"card.updated",
82+
"claim_document.accepted",
83+
"claim_document.rejected",
84+
"claim_document.uploaded",
85+
"claim.created",
86+
"claim.updated",
8287
"digital_wallet.tokenization_result",
8388
"digital_wallet.tokenization_two_factor_authentication_code",
8489
"digital_wallet.tokenization_two_factor_authentication_code_sent",
@@ -227,6 +232,11 @@ def update(
227232
"card.renewed",
228233
"card.shipped",
229234
"card.updated",
235+
"claim_document.accepted",
236+
"claim_document.rejected",
237+
"claim_document.uploaded",
238+
"claim.created",
239+
"claim.updated",
230240
"digital_wallet.tokenization_result",
231241
"digital_wallet.tokenization_two_factor_authentication_code",
232242
"digital_wallet.tokenization_two_factor_authentication_code_sent",
@@ -698,6 +708,11 @@ def send_simulated_example(
698708
"card.renewed",
699709
"card.shipped",
700710
"card.updated",
711+
"claim_document.accepted",
712+
"claim_document.rejected",
713+
"claim_document.uploaded",
714+
"claim.created",
715+
"claim.updated",
701716
"digital_wallet.tokenization_result",
702717
"digital_wallet.tokenization_two_factor_authentication_code",
703718
"digital_wallet.tokenization_two_factor_authentication_code_sent",
@@ -823,6 +838,11 @@ async def create(
823838
"card.renewed",
824839
"card.shipped",
825840
"card.updated",
841+
"claim_document.accepted",
842+
"claim_document.rejected",
843+
"claim_document.uploaded",
844+
"claim.created",
845+
"claim.updated",
826846
"digital_wallet.tokenization_result",
827847
"digital_wallet.tokenization_two_factor_authentication_code",
828848
"digital_wallet.tokenization_two_factor_authentication_code_sent",
@@ -971,6 +991,11 @@ async def update(
971991
"card.renewed",
972992
"card.shipped",
973993
"card.updated",
994+
"claim_document.accepted",
995+
"claim_document.rejected",
996+
"claim_document.uploaded",
997+
"claim.created",
998+
"claim.updated",
974999
"digital_wallet.tokenization_result",
9751000
"digital_wallet.tokenization_two_factor_authentication_code",
9761001
"digital_wallet.tokenization_two_factor_authentication_code_sent",
@@ -1442,6 +1467,11 @@ async def send_simulated_example(
14421467
"card.renewed",
14431468
"card.shipped",
14441469
"card.updated",
1470+
"claim_document.accepted",
1471+
"claim_document.rejected",
1472+
"claim_document.uploaded",
1473+
"claim.created",
1474+
"claim.updated",
14451475
"digital_wallet.tokenization_result",
14461476
"digital_wallet.tokenization_two_factor_authentication_code",
14471477
"digital_wallet.tokenization_two_factor_authentication_code_sent",

src/lithic/types/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@
126126
from .card_bulk_order_list_params import CardBulkOrderListParams as CardBulkOrderListParams
127127
from .card_reissued_webhook_event import CardReissuedWebhookEvent as CardReissuedWebhookEvent
128128
from .card_web_provision_response import CardWebProvisionResponse as CardWebProvisionResponse
129+
from .claim_created_webhook_event import ClaimCreatedWebhookEvent as ClaimCreatedWebhookEvent
130+
from .claim_updated_webhook_event import ClaimUpdatedWebhookEvent as ClaimUpdatedWebhookEvent
129131
from .network_program_list_params import NetworkProgramListParams as NetworkProgramListParams
130132
from .tokenization_decline_reason import TokenizationDeclineReason as TokenizationDeclineReason
131133
from .account_activity_list_params import AccountActivityListParams as AccountActivityListParams
@@ -192,6 +194,15 @@
192194
from .account_holder_upload_document_params import (
193195
AccountHolderUploadDocumentParams as AccountHolderUploadDocumentParams,
194196
)
197+
from .claim_document_accepted_webhook_event import (
198+
ClaimDocumentAcceptedWebhookEvent as ClaimDocumentAcceptedWebhookEvent,
199+
)
200+
from .claim_document_rejected_webhook_event import (
201+
ClaimDocumentRejectedWebhookEvent as ClaimDocumentRejectedWebhookEvent,
202+
)
203+
from .claim_document_uploaded_webhook_event import (
204+
ClaimDocumentUploadedWebhookEvent as ClaimDocumentUploadedWebhookEvent,
205+
)
195206
from .external_bank_account_create_response import (
196207
ExternalBankAccountCreateResponse as ExternalBankAccountCreateResponse,
197208
)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal
6+
7+
from .._models import BaseModel
8+
9+
__all__ = ["ClaimCreatedWebhookEvent", "DisputedTransaction"]
10+
11+
12+
class DisputedTransaction(BaseModel):
13+
"""
14+
A transaction included in a claim, along with the specific events being disputed.
15+
"""
16+
17+
event_tokens: List[str]
18+
"""Tokens for the specific events within the transaction being disputed.
19+
20+
Lithic creates one dispute per event token
21+
"""
22+
23+
transaction_token: str
24+
"""Token for the transaction being disputed, in UUID format"""
25+
26+
27+
class ClaimCreatedWebhookEvent(BaseModel):
28+
token: str
29+
"""Unique identifier for the claim, in UUID format"""
30+
31+
account_holder_token: Optional[str] = None
32+
"""Token for the account holder that filed the claim"""
33+
34+
account_token: Optional[str] = None
35+
"""Token for the account associated with the claim"""
36+
37+
card_tokens: List[str]
38+
"""Tokens for the cards associated with the disputed transactions"""
39+
40+
created: datetime
41+
"""When the claim was created"""
42+
43+
disputed_transactions: List[DisputedTransaction]
44+
"""Transactions included in this claim"""
45+
46+
event_type: Literal["claim.created"]
47+
"""The type of event that occurred."""
48+
49+
outstanding_requirements: List[Literal["QUESTIONNAIRE", "DOCUMENTS"]]
50+
"""Requirements that must be fulfilled before the claim can be submitted"""
51+
52+
reason: Literal[
53+
"CARD_NOT_PRESENT",
54+
"CARD_LOST",
55+
"CARD_STOLEN",
56+
"CARD_NEVER_RECEIVED",
57+
"COUNTERFEIT",
58+
"ACCOUNT_TAKEOVER",
59+
"PRODUCT_NOT_RECEIVED",
60+
"NOT_AS_DESCRIBED",
61+
"CREDIT_NOT_PROCESSED",
62+
"CANCELLED_RECURRING",
63+
"PAID_BY_OTHER_MEANS",
64+
"DUPLICATE_CHARGE",
65+
"LATE_PRESENTMENT",
66+
"INCORRECT_TRANSACTION_CODE",
67+
"NO_AUTHORIZATION",
68+
"DECLINED",
69+
"INCORRECT_AMOUNT",
70+
"ATM_CASH_NOT_DISPENSED",
71+
"ATM_DEPOSIT_WRONG_AMOUNT",
72+
"ATM_DEPOSIT_MISSING",
73+
]
74+
"""Dispute reason code provided when creating the claim"""
75+
76+
status: Literal["INITIALIZING", "AWAITING_INFO", "SUBMITTED", "RESOLVED", "ABANDONED"]
77+
"""Current lifecycle status of the claim"""
78+
79+
submitted: Optional[datetime] = None
80+
"""When the claim was submitted. Null until the claim reaches `SUBMITTED` status"""
81+
82+
updated: datetime
83+
"""When the claim was last updated"""
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal
6+
7+
from .._models import BaseModel
8+
9+
__all__ = ["ClaimDocumentAcceptedWebhookEvent", "UploadConstraints"]
10+
11+
12+
class UploadConstraints(BaseModel):
13+
"""Constraints that an uploaded file must satisfy."""
14+
15+
accepted_mime_types: List[str]
16+
"""MIME types accepted for upload"""
17+
18+
max_size_bytes: Optional[int] = None
19+
"""Maximum file size in bytes. Null if there is no enforced size limit"""
20+
21+
22+
class ClaimDocumentAcceptedWebhookEvent(BaseModel):
23+
token: str
24+
"""Unique identifier for the document, in UUID format"""
25+
26+
created: datetime
27+
"""When the document was created"""
28+
29+
download_url: Optional[str] = None
30+
"""Presigned URL for downloading the uploaded document.
31+
32+
Available once the document is being validated or has been accepted
33+
(`VALIDATING` or `ACCEPTED`)
34+
"""
35+
36+
download_url_expires_at: Optional[datetime] = None
37+
"""When the download URL expires"""
38+
39+
event_type: Literal["claim_document.accepted"]
40+
"""The type of event that occurred."""
41+
42+
failure_reason: Optional[Literal["INVALID_MIME_TYPE", "FILE_TOO_LARGE", "FILE_EMPTY", "CORRUPT_FILE", "OTHER"]] = (
43+
None
44+
)
45+
"""Reason the document failed validation. Null unless `status` is `REJECTED`"""
46+
47+
name: str
48+
"""Name provided when the upload intent was created"""
49+
50+
requirement_id: Optional[str] = None
51+
"""Identifier of the document requirement this document satisfies.
52+
53+
Null for supplemental documents not tied to a specific requirement
54+
"""
55+
56+
status: Literal["PENDING", "VALIDATING", "ACCEPTED", "REJECTED"]
57+
"""Current validation status of the document"""
58+
59+
updated: datetime
60+
"""When the document was last updated"""
61+
62+
upload_constraints: Optional[UploadConstraints] = None
63+
"""Constraints that an uploaded file must satisfy."""
64+
65+
upload_url: Optional[str] = None
66+
"""Presigned URL for uploading the file via HTTP PUT.
67+
68+
Null after the upload window expires or after the document has been validated
69+
"""
70+
71+
upload_url_expires_at: Optional[datetime] = None
72+
"""When the upload URL expires"""
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal
6+
7+
from .._models import BaseModel
8+
9+
__all__ = ["ClaimDocumentRejectedWebhookEvent", "UploadConstraints"]
10+
11+
12+
class UploadConstraints(BaseModel):
13+
"""Constraints that an uploaded file must satisfy."""
14+
15+
accepted_mime_types: List[str]
16+
"""MIME types accepted for upload"""
17+
18+
max_size_bytes: Optional[int] = None
19+
"""Maximum file size in bytes. Null if there is no enforced size limit"""
20+
21+
22+
class ClaimDocumentRejectedWebhookEvent(BaseModel):
23+
token: str
24+
"""Unique identifier for the document, in UUID format"""
25+
26+
created: datetime
27+
"""When the document was created"""
28+
29+
download_url: Optional[str] = None
30+
"""Presigned URL for downloading the uploaded document.
31+
32+
Available once the document is being validated or has been accepted
33+
(`VALIDATING` or `ACCEPTED`)
34+
"""
35+
36+
download_url_expires_at: Optional[datetime] = None
37+
"""When the download URL expires"""
38+
39+
event_type: Literal["claim_document.rejected"]
40+
"""The type of event that occurred."""
41+
42+
failure_reason: Optional[Literal["INVALID_MIME_TYPE", "FILE_TOO_LARGE", "FILE_EMPTY", "CORRUPT_FILE", "OTHER"]] = (
43+
None
44+
)
45+
"""Reason the document failed validation. Null unless `status` is `REJECTED`"""
46+
47+
name: str
48+
"""Name provided when the upload intent was created"""
49+
50+
requirement_id: Optional[str] = None
51+
"""Identifier of the document requirement this document satisfies.
52+
53+
Null for supplemental documents not tied to a specific requirement
54+
"""
55+
56+
status: Literal["PENDING", "VALIDATING", "ACCEPTED", "REJECTED"]
57+
"""Current validation status of the document"""
58+
59+
updated: datetime
60+
"""When the document was last updated"""
61+
62+
upload_constraints: Optional[UploadConstraints] = None
63+
"""Constraints that an uploaded file must satisfy."""
64+
65+
upload_url: Optional[str] = None
66+
"""Presigned URL for uploading the file via HTTP PUT.
67+
68+
Null after the upload window expires or after the document has been validated
69+
"""
70+
71+
upload_url_expires_at: Optional[datetime] = None
72+
"""When the upload URL expires"""

0 commit comments

Comments
 (0)