2121
2222AccountCapabilitiesLiterals = Literal [
2323 'payments:receive' ,
24- 'payments:send'
24+ 'payments:send' ,
25+ 'data:retrieve'
2526]
2627
2728
3031 'disabled'
3132]
3233
34+ AccountDetailTypesLiterals = Literal [
35+ 'bnpl_loan' ,
36+ 'depository' ,
37+ 'credit_card' ,
38+ 'student_loan'
39+ ]
40+
3341
3442class AccountACH (TypedDict ):
3543 routing : int
@@ -74,6 +82,68 @@ class AccountCreateOpts(TypedDict):
7482 metadata : Optional [Dict [str , Any ]]
7583
7684
85+ class AccountDetailBNPLLoanUpcomingPaymentDue (TypedDict ):
86+ amount : int
87+ date : str
88+
89+
90+ class AccountDetailBNPLLoan (TypedDict ):
91+ name : Optional [str ]
92+ reference_id : str
93+ balance : int
94+ purchase_date : str
95+ next_payment_due_date : Optional [str ]
96+ total_payments_count : int
97+ payments_made_count : int
98+ remaining_payments_count : int
99+ autopay_enabled : bool
100+ payoff_progress : int
101+ interest_rate : int
102+ description : Optional [str ]
103+ total_cost : int
104+ total_paid : int
105+ status : Literal ['paid_off' , 'refunded' , 'in_progress' ]
106+ upcoming_payments_due : List [AccountDetailBNPLLoanUpcomingPaymentDue ]
107+
108+
109+ class AccountDetailDepository (TypedDict ):
110+ name : Optional [str ]
111+ reference_number : str
112+ balance : int
113+
114+
115+ class AccountDetailCreditCard (TypedDict ):
116+ name : Optional [str ]
117+ reference_number : str
118+ balance : int
119+ last_payment_amount : int
120+ last_payment_date : Optional [str ]
121+ next_payment_due_date : Optional [str ]
122+ next_payment_minimum_amount : int
123+
124+
125+ # TODO[mdelcarmen]
126+ class AccountDetailStudentLoan (TypedDict ):
127+ pass
128+
129+
130+ class AccountDetail (TypedDict ):
131+ type : AccountDetailTypesLiterals
132+ bnpl_loan : Optional [AccountDetailBNPLLoan ]
133+ depository : Optional [AccountDetailDepository ]
134+ credit_card : Optional [AccountDetailCreditCard ]
135+ student_loan : Optional [AccountDetailStudentLoan ]
136+
137+
138+ class AccountTransaction (TypedDict ):
139+ id : str
140+ reference_id : str
141+ date : str
142+ amount : int
143+ status : Literal ['pending' , 'success' ]
144+ description : Optional [str ]
145+
146+
77147class AccountListOpts (TypedDict ):
78148 holder_id : Optional [str ]
79149
@@ -100,3 +170,9 @@ def list(self, params: Optional[AccountListOpts] = None) -> List[Account]:
100170
101171 def create (self , opts : AccountCreateOpts , request_opts : Optional [RequestOpts ] = None ) -> Account :
102172 return super (AccountResource , self )._create (opts , request_opts )
173+
174+ def get_detail (self , _id : str ) -> AccountDetail :
175+ return super (AccountResource , self )._get_with_sub_path ('{_id}/detail' .format (_id = _id ))
176+
177+ def get_transactions (self , _id : str ) -> List [AccountTransaction ]:
178+ return super (AccountResource , self )._get_with_sub_path ('{_id}/transactions' .format (_id = _id ))
0 commit comments