1818from ..pagination import SyncCursorPage , AsyncCursorPage
1919from .._base_client import AsyncPaginator , make_request_options
2020from ..types .account import Account
21+ from ..types .signals_response import SignalsResponse
2122from ..types .account_spend_limits import AccountSpendLimits
2223
2324__all__ = ["Accounts" , "AsyncAccounts" ]
@@ -259,6 +260,46 @@ def list(
259260 model = Account ,
260261 )
261262
263+ def retrieve_signals (
264+ self ,
265+ account_token : str ,
266+ * ,
267+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
268+ # The extra values given here take precedence over values defined on the client or passed to this method.
269+ extra_headers : Headers | None = None ,
270+ extra_query : Query | None = None ,
271+ extra_body : Body | None = None ,
272+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
273+ ) -> SignalsResponse :
274+ """
275+ Returns behavioral feature state derived from an account's transaction history.
276+
277+ These signals expose the same data used by behavioral rule attributes (e.g.
278+ `AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`)
279+ and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to
280+ inspect feature values before writing rules and debug rule behavior.
281+
282+ Note: 3DS fields are not available at the account scope and will be null.
283+
284+ Args:
285+ extra_headers: Send extra headers
286+
287+ extra_query: Add additional query parameters to the request
288+
289+ extra_body: Add additional JSON properties to the request
290+
291+ timeout: Override the client-level default timeout for this request, in seconds
292+ """
293+ if not account_token :
294+ raise ValueError (f"Expected a non-empty value for `account_token` but received { account_token !r} " )
295+ return self ._get (
296+ path_template ("/v1/accounts/{account_token}/signals" , account_token = account_token ),
297+ options = make_request_options (
298+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
299+ ),
300+ cast_to = SignalsResponse ,
301+ )
302+
262303 def retrieve_spend_limits (
263304 self ,
264305 account_token : str ,
@@ -533,6 +574,46 @@ def list(
533574 model = Account ,
534575 )
535576
577+ async def retrieve_signals (
578+ self ,
579+ account_token : str ,
580+ * ,
581+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
582+ # The extra values given here take precedence over values defined on the client or passed to this method.
583+ extra_headers : Headers | None = None ,
584+ extra_query : Query | None = None ,
585+ extra_body : Body | None = None ,
586+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
587+ ) -> SignalsResponse :
588+ """
589+ Returns behavioral feature state derived from an account's transaction history.
590+
591+ These signals expose the same data used by behavioral rule attributes (e.g.
592+ `AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`)
593+ and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to
594+ inspect feature values before writing rules and debug rule behavior.
595+
596+ Note: 3DS fields are not available at the account scope and will be null.
597+
598+ Args:
599+ extra_headers: Send extra headers
600+
601+ extra_query: Add additional query parameters to the request
602+
603+ extra_body: Add additional JSON properties to the request
604+
605+ timeout: Override the client-level default timeout for this request, in seconds
606+ """
607+ if not account_token :
608+ raise ValueError (f"Expected a non-empty value for `account_token` but received { account_token !r} " )
609+ return await self ._get (
610+ path_template ("/v1/accounts/{account_token}/signals" , account_token = account_token ),
611+ options = make_request_options (
612+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
613+ ),
614+ cast_to = SignalsResponse ,
615+ )
616+
536617 async def retrieve_spend_limits (
537618 self ,
538619 account_token : str ,
@@ -584,6 +665,9 @@ def __init__(self, accounts: Accounts) -> None:
584665 self .list = _legacy_response .to_raw_response_wrapper (
585666 accounts .list ,
586667 )
668+ self .retrieve_signals = _legacy_response .to_raw_response_wrapper (
669+ accounts .retrieve_signals ,
670+ )
587671 self .retrieve_spend_limits = _legacy_response .to_raw_response_wrapper (
588672 accounts .retrieve_spend_limits ,
589673 )
@@ -602,6 +686,9 @@ def __init__(self, accounts: AsyncAccounts) -> None:
602686 self .list = _legacy_response .async_to_raw_response_wrapper (
603687 accounts .list ,
604688 )
689+ self .retrieve_signals = _legacy_response .async_to_raw_response_wrapper (
690+ accounts .retrieve_signals ,
691+ )
605692 self .retrieve_spend_limits = _legacy_response .async_to_raw_response_wrapper (
606693 accounts .retrieve_spend_limits ,
607694 )
@@ -620,6 +707,9 @@ def __init__(self, accounts: Accounts) -> None:
620707 self .list = to_streamed_response_wrapper (
621708 accounts .list ,
622709 )
710+ self .retrieve_signals = to_streamed_response_wrapper (
711+ accounts .retrieve_signals ,
712+ )
623713 self .retrieve_spend_limits = to_streamed_response_wrapper (
624714 accounts .retrieve_spend_limits ,
625715 )
@@ -638,6 +728,9 @@ def __init__(self, accounts: AsyncAccounts) -> None:
638728 self .list = async_to_streamed_response_wrapper (
639729 accounts .list ,
640730 )
731+ self .retrieve_signals = async_to_streamed_response_wrapper (
732+ accounts .retrieve_signals ,
733+ )
641734 self .retrieve_spend_limits = async_to_streamed_response_wrapper (
642735 accounts .retrieve_spend_limits ,
643736 )
0 commit comments