Skip to content

Commit

Permalink
feat(api)!: removes AccountHolder resubmit endpoint and `KYC_ADVANC…
Browse files Browse the repository at this point in the history
…ED` workflow (#659)
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Dec 18, 2024
1 parent 79baa5d commit 8b181ca
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 461 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 153
configured_endpoints: 152
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Methods:
- <code title="patch /v1/account_holders/{account_holder_token}">client.account_holders.<a href="./src/lithic/resources/account_holders.py">update</a>(account_holder_token, \*\*<a href="src/lithic/types/account_holder_update_params.py">params</a>) -> <a href="./src/lithic/types/account_holder_update_response.py">AccountHolderUpdateResponse</a></code>
- <code title="get /v1/account_holders">client.account_holders.<a href="./src/lithic/resources/account_holders.py">list</a>(\*\*<a href="src/lithic/types/account_holder_list_params.py">params</a>) -> <a href="./src/lithic/types/account_holder.py">SyncSinglePage[AccountHolder]</a></code>
- <code title="get /v1/account_holders/{account_holder_token}/documents">client.account_holders.<a href="./src/lithic/resources/account_holders.py">list_documents</a>(account_holder_token) -> <a href="./src/lithic/types/account_holder_list_documents_response.py">AccountHolderListDocumentsResponse</a></code>
- <code title="post /v1/account_holders/{account_holder_token}/resubmit">client.account_holders.<a href="./src/lithic/resources/account_holders.py">resubmit</a>(account_holder_token, \*\*<a href="src/lithic/types/account_holder_resubmit_params.py">params</a>) -> <a href="./src/lithic/types/account_holder.py">AccountHolder</a></code>
- <code title="get /v1/account_holders/{account_holder_token}/documents/{document_token}">client.account_holders.<a href="./src/lithic/resources/account_holders.py">retrieve_document</a>(document_token, \*, account_holder_token) -> <a href="./src/lithic/types/shared/document.py">Document</a></code>
- <code title="post /v1/simulate/account_holders/enrollment_document_review">client.account_holders.<a href="./src/lithic/resources/account_holders.py">simulate_enrollment_document_review</a>(\*\*<a href="src/lithic/types/account_holder_simulate_enrollment_document_review_params.py">params</a>) -> <a href="./src/lithic/types/shared/document.py">Document</a></code>
- <code title="post /v1/simulate/account_holders/enrollment_review">client.account_holders.<a href="./src/lithic/resources/account_holders.py">simulate_enrollment_review</a>(\*\*<a href="src/lithic/types/account_holder_simulate_enrollment_review_params.py">params</a>) -> <a href="./src/lithic/types/account_holder_simulate_enrollment_review_response.py">AccountHolderSimulateEnrollmentReviewResponse</a></code>
Expand Down
153 changes: 6 additions & 147 deletions src/lithic/resources/account_holders.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
account_holder_list_params,
account_holder_create_params,
account_holder_update_params,
account_holder_resubmit_params,
account_holder_upload_document_params,
account_holder_simulate_enrollment_review_params,
account_holder_simulate_enrollment_document_review_params,
Expand Down Expand Up @@ -155,7 +154,7 @@ def create(
*,
individual: account_holder_create_params.KYCIndividual,
tos_timestamp: str,
workflow: Literal["KYC_ADVANCED", "KYC_BASIC", "KYC_BYO"],
workflow: Literal["KYC_BASIC", "KYC_BYO"],
external_id: str | NotGiven = NOT_GIVEN,
kyc_passed_timestamp: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -286,9 +285,7 @@ def create(
control_person: account_holder_create_params.KYBControlPerson | NotGiven = NOT_GIVEN,
nature_of_business: str | NotGiven = NOT_GIVEN,
tos_timestamp: str | NotGiven = NOT_GIVEN,
workflow: Literal["KYB_BASIC", "KYB_BYO"]
| Literal["KYC_ADVANCED", "KYC_BASIC", "KYC_BYO"]
| Literal["KYC_EXEMPT"],
workflow: Literal["KYB_BASIC", "KYB_BYO"] | Literal["KYC_BASIC", "KYC_BYO"] | Literal["KYC_EXEMPT"],
external_id: str | NotGiven = NOT_GIVEN,
kyb_passed_timestamp: str | NotGiven = NOT_GIVEN,
website_url: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -577,67 +574,6 @@ def list_documents(
cast_to=AccountHolderListDocumentsResponse,
)

def resubmit(
self,
account_holder_token: str,
*,
individual: account_holder_resubmit_params.Individual,
tos_timestamp: str,
workflow: Literal["KYC_ADVANCED"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AccountHolder:
"""Resubmit a KYC submission.
This endpoint should be used in cases where a KYC
submission returned a `PENDING_RESUBMIT` result, meaning one or more critical
KYC fields may have been mis-entered and the individual's identity has not yet
been successfully verified. This step must be completed in order to proceed with
the KYC evaluation.
Two resubmission attempts are permitted via this endpoint before a `REJECTED`
status is returned and the account creation process is ended.
Args:
individual: Information on individual for whom the account is being opened and KYC is being
re-run.
tos_timestamp: An RFC 3339 timestamp indicating when the account holder accepted the applicable
legal agreements (e.g., cardholder terms) as agreed upon during API customer's
implementation with Lithic.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not account_holder_token:
raise ValueError(
f"Expected a non-empty value for `account_holder_token` but received {account_holder_token!r}"
)
return self._post(
f"/v1/account_holders/{account_holder_token}/resubmit",
body=maybe_transform(
{
"individual": individual,
"tos_timestamp": tos_timestamp,
"workflow": workflow,
},
account_holder_resubmit_params.AccountHolderResubmitParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AccountHolder,
)

def retrieve_document(
self,
document_token: str,
Expand Down Expand Up @@ -791,8 +727,7 @@ def simulate_enrollment_review(
"""Simulates an enrollment review for an account holder.
This endpoint is only
applicable for workflows that may required intervention such as `KYB_BASIC` or
`KYC_ADVANCED`.
applicable for workflows that may required intervention such as `KYB_BASIC`.
Args:
account_holder_token: The account holder which to perform the simulation upon.
Expand Down Expand Up @@ -1024,7 +959,7 @@ async def create(
*,
individual: account_holder_create_params.KYCIndividual,
tos_timestamp: str,
workflow: Literal["KYC_ADVANCED", "KYC_BASIC", "KYC_BYO"],
workflow: Literal["KYC_BASIC", "KYC_BYO"],
external_id: str | NotGiven = NOT_GIVEN,
kyc_passed_timestamp: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1155,9 +1090,7 @@ async def create(
control_person: account_holder_create_params.KYBControlPerson | NotGiven = NOT_GIVEN,
nature_of_business: str | NotGiven = NOT_GIVEN,
tos_timestamp: str | NotGiven = NOT_GIVEN,
workflow: Literal["KYB_BASIC", "KYB_BYO"]
| Literal["KYC_ADVANCED", "KYC_BASIC", "KYC_BYO"]
| Literal["KYC_EXEMPT"],
workflow: Literal["KYB_BASIC", "KYB_BYO"] | Literal["KYC_BASIC", "KYC_BYO"] | Literal["KYC_EXEMPT"],
external_id: str | NotGiven = NOT_GIVEN,
kyb_passed_timestamp: str | NotGiven = NOT_GIVEN,
website_url: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1446,67 +1379,6 @@ async def list_documents(
cast_to=AccountHolderListDocumentsResponse,
)

async def resubmit(
self,
account_holder_token: str,
*,
individual: account_holder_resubmit_params.Individual,
tos_timestamp: str,
workflow: Literal["KYC_ADVANCED"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AccountHolder:
"""Resubmit a KYC submission.
This endpoint should be used in cases where a KYC
submission returned a `PENDING_RESUBMIT` result, meaning one or more critical
KYC fields may have been mis-entered and the individual's identity has not yet
been successfully verified. This step must be completed in order to proceed with
the KYC evaluation.
Two resubmission attempts are permitted via this endpoint before a `REJECTED`
status is returned and the account creation process is ended.
Args:
individual: Information on individual for whom the account is being opened and KYC is being
re-run.
tos_timestamp: An RFC 3339 timestamp indicating when the account holder accepted the applicable
legal agreements (e.g., cardholder terms) as agreed upon during API customer's
implementation with Lithic.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not account_holder_token:
raise ValueError(
f"Expected a non-empty value for `account_holder_token` but received {account_holder_token!r}"
)
return await self._post(
f"/v1/account_holders/{account_holder_token}/resubmit",
body=await async_maybe_transform(
{
"individual": individual,
"tos_timestamp": tos_timestamp,
"workflow": workflow,
},
account_holder_resubmit_params.AccountHolderResubmitParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AccountHolder,
)

async def retrieve_document(
self,
document_token: str,
Expand Down Expand Up @@ -1660,8 +1532,7 @@ async def simulate_enrollment_review(
"""Simulates an enrollment review for an account holder.
This endpoint is only
applicable for workflows that may required intervention such as `KYB_BASIC` or
`KYC_ADVANCED`.
applicable for workflows that may required intervention such as `KYB_BASIC`.
Args:
account_holder_token: The account holder which to perform the simulation upon.
Expand Down Expand Up @@ -1799,9 +1670,6 @@ def __init__(self, account_holders: AccountHolders) -> None:
self.list_documents = _legacy_response.to_raw_response_wrapper(
account_holders.list_documents,
)
self.resubmit = _legacy_response.to_raw_response_wrapper(
account_holders.resubmit,
)
self.retrieve_document = _legacy_response.to_raw_response_wrapper(
account_holders.retrieve_document,
)
Expand Down Expand Up @@ -1835,9 +1703,6 @@ def __init__(self, account_holders: AsyncAccountHolders) -> None:
self.list_documents = _legacy_response.async_to_raw_response_wrapper(
account_holders.list_documents,
)
self.resubmit = _legacy_response.async_to_raw_response_wrapper(
account_holders.resubmit,
)
self.retrieve_document = _legacy_response.async_to_raw_response_wrapper(
account_holders.retrieve_document,
)
Expand Down Expand Up @@ -1871,9 +1736,6 @@ def __init__(self, account_holders: AccountHolders) -> None:
self.list_documents = to_streamed_response_wrapper(
account_holders.list_documents,
)
self.resubmit = to_streamed_response_wrapper(
account_holders.resubmit,
)
self.retrieve_document = to_streamed_response_wrapper(
account_holders.retrieve_document,
)
Expand Down Expand Up @@ -1907,9 +1769,6 @@ def __init__(self, account_holders: AsyncAccountHolders) -> None:
self.list_documents = async_to_streamed_response_wrapper(
account_holders.list_documents,
)
self.resubmit = async_to_streamed_response_wrapper(
account_holders.resubmit,
)
self.retrieve_document = async_to_streamed_response_wrapper(
account_holders.retrieve_document,
)
Expand Down
16 changes: 10 additions & 6 deletions src/lithic/resources/cards/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,9 @@ def reissue(
card is
physically damaged). The PAN, expiry, and CVC2 will remain the same and the
original card can continue to be used until the new card is activated. A card
can be reissued a maximum of 8 times. Only applies to cards of type `PHYSICAL`.
original card can continue to be used until the new card is activated. Only
applies to cards of type `PHYSICAL`. A card can be replaced or renewed a total
of 8 times.
Args:
carrier: If omitted, the previous carrier will be used.
Expand Down Expand Up @@ -925,7 +926,8 @@ def renew(
code. The original card will keep working for card-present transactions until
the new card is activated. For card-not-present transactions, the original card
details (expiry, CVC2) will also keep working until the new card is activated.
Applies to card types `PHYSICAL` and `VIRTUAL`.
Applies to card types `PHYSICAL` and `VIRTUAL`. A card can be replaced or
renewed a total of 8 times.
Args:
shipping_address: The shipping address this card will be sent to.
Expand Down Expand Up @@ -1831,8 +1833,9 @@ async def reissue(
card is
physically damaged). The PAN, expiry, and CVC2 will remain the same and the
original card can continue to be used until the new card is activated. A card
can be reissued a maximum of 8 times. Only applies to cards of type `PHYSICAL`.
original card can continue to be used until the new card is activated. Only
applies to cards of type `PHYSICAL`. A card can be replaced or renewed a total
of 8 times.
Args:
carrier: If omitted, the previous carrier will be used.
Expand Down Expand Up @@ -1906,7 +1909,8 @@ async def renew(
code. The original card will keep working for card-present transactions until
the new card is activated. For card-not-present transactions, the original card
details (expiry, CVC2) will also keep working until the new card is activated.
Applies to card types `PHYSICAL` and `VIRTUAL`.
Applies to card types `PHYSICAL` and `VIRTUAL`. A card can be replaced or
renewed a total of 8 times.
Args:
shipping_address: The shipping address this card will be sent to.
Expand Down
1 change: 0 additions & 1 deletion src/lithic/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
from .external_bank_account_address import ExternalBankAccountAddress as ExternalBankAccountAddress
from .financial_account_list_params import FinancialAccountListParams as FinancialAccountListParams
from .account_holder_create_response import AccountHolderCreateResponse as AccountHolderCreateResponse
from .account_holder_resubmit_params import AccountHolderResubmitParams as AccountHolderResubmitParams
from .account_holder_update_response import AccountHolderUpdateResponse as AccountHolderUpdateResponse
from .external_payment_cancel_params import ExternalPaymentCancelParams as ExternalPaymentCancelParams
from .external_payment_create_params import ExternalPaymentCreateParams as ExternalPaymentCreateParams
Expand Down
6 changes: 1 addition & 5 deletions src/lithic/types/account_holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ class VerificationApplication(BaseModel):
Note:
- `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
`KYC_ADVANCED` workflow.
- `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
"""

Expand Down Expand Up @@ -282,7 +280,7 @@ class AccountHolder(BaseModel):
"""

required_documents: Optional[List[RequiredDocument]] = None
"""Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows.
"""Only present for "KYB_BASIC" workflow.
A list of documents required for the account holder to be approved.
"""
Expand All @@ -294,8 +292,6 @@ class AccountHolder(BaseModel):
Note:
- `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
`KYC_ADVANCED` workflow.
- `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/lithic/types/account_holder_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class KYC(TypedDict, total=False):
implementation with Lithic.
"""

workflow: Required[Literal["KYC_ADVANCED", "KYC_BASIC", "KYC_BYO"]]
workflow: Required[Literal["KYC_BASIC", "KYC_BYO"]]
"""Specifies the type of KYC workflow to run."""

external_id: str
Expand Down
4 changes: 1 addition & 3 deletions src/lithic/types/account_holder_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class AccountHolderCreateResponse(BaseModel):
Note:
- `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
`KYC_ADVANCED` workflow.
- `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
"""

Expand Down Expand Up @@ -67,7 +65,7 @@ class AccountHolderCreateResponse(BaseModel):
"""

required_documents: Optional[List[RequiredDocument]] = None
"""Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows.
"""Only present for "KYB_BASIC" workflow.
A list of documents required for the account holder to be approved.
"""
Loading

0 comments on commit 8b181ca

Please sign in to comment.