inttegro.async_resources.financial_accounts
Generated public typing surface. Do not edit by hand.
1# Generated by scripts/generate_async_resources.py; do not edit by hand. 2"""Financial accounts resource for connecting payout destinations.""" 3from __future__ import annotations 4from ..async_http_client import AsyncHttpClient 5from inttegro.search import Page as SearchPage, Request as SearchRequest 6 7class AsyncFinancialAccounts: 8 """ 9 Financial accounts resource for connecting and managing payout destinations. 10 11 Financial accounts represent bank accounts, mobile money wallets, or Dosh accounts 12 where you receive payouts. Before you can receive funds from Inttegro, you must connect 13 and verify at least one financial account, then configure it as a payout destination. 14 15 The typical flow is: 16 1. Connect a financial account (bank_account, mobile money, or dosh_account) 17 2. Verify ownership via OTP 18 3. Set as payout destination via Payouts resource 19 4. Receive automatic or manual payouts 20 21 See https://studio.inttegro.com/set-up-financial-account for detailed guides. 22 """ 23 24 def __init__(self, http: AsyncHttpClient): 25 """Initialize FinancialAccounts resource with HTTP client.""" 26 self.http = http 27 28 async def create(self, payload: dict): 29 """ 30 Create a new financial account. 31 32 Args: 33 payload: Account creation parameters 34 35 Returns: 36 domain object with created financial account 37 38 """ 39 return await self.http.post('/financial_accounts/create', payload) 40 41 async def lookup(self, account_id: str): 42 """ 43 Retrieve details of a financial account. 44 45 Fetches information about a connected financial account including its type, 46 verification status, and masked details. 47 48 Args: 49 account_id: The financial account ID (e.g., "fa_abc123") 50 51 Returns: 52 domain object containing the financial_account object 53 54 Example: 55 ```python 56 result = client.financial_accounts.lookup("fa_abc123") 57 account = result 58 print(f"Type: {account['type']}, Verified: {account['verified']}") 59 ``` 60 61 See Also: 62 - connect(): Add new financial accounts 63 - page(): List all financial accounts 64 """ 65 return await self.http.post('/financial_accounts/lookup', {'account_id': account_id}) 66 67 async def connect(self, payload: dict): 68 """ 69 Connect a new financial account for receiving payouts. 70 71 Adds a bank account, mobile money wallet, or Dosh account as a payout destination. 72 Financial accounts must include basic information like label, type, currency, and 73 type-specific configuration. Most account types require verification before they 74 can receive funds. 75 76 Args: 77 payload: Connection parameters including: 78 - label: Account label (5-40 characters) (required) 79 - type: Account type ("wallet", "bank_account", or "dosh_account") (required) 80 - reference: External reference ID (5-40 characters) (required) 81 - currency: Account currency (currently only "ghs" supported) (required) 82 - description: Optional account description (0-200 characters) 83 - owner: Account owner information (required): 84 - name: Owner full name 85 - address: Owner address details (name, line_1, city, region, country) 86 - wallet: Wallet configuration (required if type is "wallet"): 87 - type: "mobile_money" 88 - mobile_money: 89 - account_number: Phone number (e.g., "0241234567") 90 - network: Network operator ("mtn", "vodafone", "airteltigo") 91 - bank_account: Bank account configuration (required if type is "bank_account"): 92 - type: "ghana_bank_account" 93 - ghana_bank_account: 94 - number: Bank account number 95 - sort_code: Bank sort code (required if swift_code is not provided) 96 - swift_code: Bank SWIFT/BIC code (required if sort_code is not provided) 97 - holder: 98 - name: Account holder full name 99 - address: 100 - name: Address label 101 - line_1: Address line 1 102 - city: City or town 103 - region: Region or state 104 - country: Country code or name 105 - push_configuration: Configuration for sending funds to this account: 106 - enabled: Whether payouts to this account are enabled (default: true) 107 - pull_configuration: Configuration for collecting funds from this account: 108 - enabled: Whether pulling funds is enabled (default: false) 109 - mandate: Optional mandate parameters (created automatically using request metadata) 110 - custom_data: Optional key-value metadata (string-to-string) 111 112 Returns: 113 domain object containing: 114 - financial_account: Created financial account with id, type, status, etc. 115 - requires_verification: Whether verification is needed before use 116 117 Raises: 118 ApiError: If parameters are invalid or connection fails 119 120 Example: 121 ```python 122 # Connect mobile money wallet 123 result = client.financial_accounts.connect({ 124 "type": "wallet", 125 "currency": "ghs", 126 "label": "Primary MTN Wallet", 127 "description": "Main business mobile money account", 128 "reference": "WALLET-MTN-001", 129 "wallet": { 130 "type": "mobile_money", 131 "mobile_money": { 132 "account_number": "0241234567", 133 "network": "mtn" 134 } 135 }, 136 "push_configuration": { 137 "enabled": True 138 } 139 }) 140 141 fa = result 142 print(f"Financial account created: {fa['id']}") 143 144 # Verify if needed 145 if result.verification is not None: 146 # Initiate verification (sends OTP) 147 client.financial_accounts.verify({"account_id": fa["id"]}) 148 149 # Collect OTP from user 150 otp = input("Enter OTP: ") 151 152 # Complete verification 153 client.financial_accounts.verify({ 154 "account_id": fa["id"], 155 "token": otp 156 }) 157 158 # Connect Vodafone wallet 159 result = client.financial_accounts.connect({ 160 "type": "wallet", 161 "currency": "ghs", 162 "label": "Vodafone Cash Account", 163 "reference": "WALLET-VDF-001", 164 "wallet": { 165 "type": "mobile_money", 166 "mobile_money": { 167 "account_number": "0501234567", 168 "network": "vodafone" 169 } 170 }, 171 "push_configuration": {"enabled": True} 172 }) 173 ``` 174 175 Note: 176 - Financial accounts must be verified before they can receive payouts 177 - Only "ghs" currency is currently supported 178 - Dosh account types are placeholders for future functionality 179 180 See Also: 181 - verify(): Verify ownership of financial account 182 - Payouts.set_destinations(): Configure account as payout destination 183 - https://studio.inttegro.com/set-up-financial-account 184 """ 185 return await self.http.post('/financial_accounts/connect', payload) 186 187 async def archive(self, payload: dict): 188 """ 189 Archive a financial account to prevent future use. 190 191 Archives a financial account, marking it inactive. Archived accounts cannot be 192 used as payout destinations but remain in your account history. 193 194 Args: 195 payload: Archive parameters including account_id 196 197 Returns: 198 domain object containing the archived financial_account 199 200 Example: 201 ```python 202 result = client.financial_accounts.archive({"account_id": "fa_abc123"}) 203 ``` 204 205 See Also: 206 - connect(): Add replacement financial account 207 """ 208 return await self.http.post('/financial_accounts/archive', payload) 209 210 async def page(self, payload: dict | None=None): 211 """ 212 List connected financial accounts with pagination and filtering. 213 214 Retrieves a paginated list of your financial accounts with optional filtering 215 by type and status. 216 217 Args: 218 payload: Optional pagination parameters and filters 219 220 Returns: 221 domain object containing data (list of accounts), has_more, and count 222 223 Example: 224 ```python 225 result = client.financial_accounts.page({"limit": 20, "status": "active"}) 226 ``` 227 228 See Also: 229 - connect(): Add new financial accounts 230 """ 231 return await self.http.post('/financial_accounts/page', payload or {}) 232 233 async def search(self, payload: SearchRequest) -> SearchPage: 234 """Search financial-account projections owned by the authenticated application.""" 235 return await self.http.post('/financial_accounts/search', payload) 236 237 async def verify(self, payload: dict): 238 """ 239 Initiate or complete verification of a financial account. 240 241 Verification confirms ownership of the financial account. For mobile money, this 242 sends an OTP that must be submitted to complete verification. 243 244 Args: 245 payload: Verification parameters including account_id and optionally token 246 247 Returns: 248 domain object containing the financial_account with updated verification status 249 250 Example: 251 ```python 252 # Initiate verification 253 client.financial_accounts.verify({"account_id": "fa_abc123"}) 254 # Complete verification 255 result = client.financial_accounts.verify({ 256 "account_id": "fa_abc123", 257 "token": "123456" 258 }) 259 ``` 260 261 See Also: 262 - connect(): Add financial accounts that need verification 263 """ 264 return await self.http.post('/financial_accounts/verify', payload) 265 266 async def update(self, payload: dict): 267 """ 268 Update a financial account (PATCH semantics). 269 270 All fields except account_id are optional. custom_data merges with existing data; null deletes keys. 271 272 Args: 273 payload: Update parameters including account_id and fields to change 274 275 Returns: 276 domain object containing the updated financial_account 277 """ 278 return await self.http.post('/financial_accounts/update', payload) 279 280 async def enable_push(self, account_id: str): 281 """Enable push configuration for payouts. 282 283 API endpoint: ``/financial_accounts/enable_push``. 284 285 Args: 286 account_id (str): Unique identifier of the account. 287 288 Returns: 289 ``FinancialAccount`` decoded from the documented response shape. 290 291 Raises: 292 APIError: The API rejected the request or could not complete it. 293 NetworkError: The request could not reach the Inttegro API. 294 TimeoutError: The configured request deadline elapsed. 295 """ 296 return await self.http.post('/financial_accounts/enable_push', {'account_id': account_id}) 297 298 async def disable_push(self, account_id: str, unset_as_payout_destination: bool | None=None): 299 """ 300 Disable push configuration for payouts. 301 302 If the account is a payout destination, set unset_as_payout_destination to True to 303 automatically remove it before disabling push. 304 """ 305 payload = {'account_id': account_id} 306 if unset_as_payout_destination is not None: 307 payload['unset_as_payout_destination'] = unset_as_payout_destination 308 return await self.http.post('/financial_accounts/disable_push', payload) 309 310 async def disconnect(self, account_id: str, unset_as_payout_destination: bool | None=None): 311 """ 312 Disconnect a financial account. 313 314 If the account is a payout destination, set unset_as_payout_destination to True to 315 automatically remove it before disconnecting. 316 """ 317 payload = {'account_id': account_id} 318 if unset_as_payout_destination is not None: 319 payload['unset_as_payout_destination'] = unset_as_payout_destination 320 return await self.http.post('/financial_accounts/disconnect', payload) 321 322 async def reconnect(self, account_id: str): 323 """ 324 Reconnect a previously disconnected financial account. 325 326 Args: 327 account_id: The financial account ID to reconnect. 328 329 Returns: 330 domain object containing the reconnected financial account. 331 """ 332 return await self.http.post('/financial_accounts/reconnect', {'account_id': account_id}) 333 334 async def enable_pull(self, account_id: str): 335 """Enable pull configuration for charges (creates mandate). 336 337 API endpoint: ``/financial_accounts/enable_pull``. 338 339 Args: 340 account_id (str): Unique identifier of the account. 341 342 Returns: 343 ``FinancialAccount`` decoded from the documented response shape. 344 345 Raises: 346 APIError: The API rejected the request or could not complete it. 347 NetworkError: The request could not reach the Inttegro API. 348 TimeoutError: The configured request deadline elapsed. 349 """ 350 return await self.http.post('/financial_accounts/enable_pull', {'account_id': account_id}) 351 352 async def disable_pull(self, account_id: str): 353 """Disable pull configuration for charges. 354 355 API endpoint: ``/financial_accounts/disable_pull``. 356 357 Args: 358 account_id (str): Unique identifier of the account. 359 360 Returns: 361 ``FinancialAccount`` decoded from the documented response shape. 362 363 Raises: 364 APIError: The API rejected the request or could not complete it. 365 NetworkError: The request could not reach the Inttegro API. 366 TimeoutError: The configured request deadline elapsed. 367 """ 368 return await self.http.post('/financial_accounts/disable_pull', {'account_id': account_id})
8class AsyncFinancialAccounts: 9 """ 10 Financial accounts resource for connecting and managing payout destinations. 11 12 Financial accounts represent bank accounts, mobile money wallets, or Dosh accounts 13 where you receive payouts. Before you can receive funds from Inttegro, you must connect 14 and verify at least one financial account, then configure it as a payout destination. 15 16 The typical flow is: 17 1. Connect a financial account (bank_account, mobile money, or dosh_account) 18 2. Verify ownership via OTP 19 3. Set as payout destination via Payouts resource 20 4. Receive automatic or manual payouts 21 22 See https://studio.inttegro.com/set-up-financial-account for detailed guides. 23 """ 24 25 def __init__(self, http: AsyncHttpClient): 26 """Initialize FinancialAccounts resource with HTTP client.""" 27 self.http = http 28 29 async def create(self, payload: dict): 30 """ 31 Create a new financial account. 32 33 Args: 34 payload: Account creation parameters 35 36 Returns: 37 domain object with created financial account 38 39 """ 40 return await self.http.post('/financial_accounts/create', payload) 41 42 async def lookup(self, account_id: str): 43 """ 44 Retrieve details of a financial account. 45 46 Fetches information about a connected financial account including its type, 47 verification status, and masked details. 48 49 Args: 50 account_id: The financial account ID (e.g., "fa_abc123") 51 52 Returns: 53 domain object containing the financial_account object 54 55 Example: 56 ```python 57 result = client.financial_accounts.lookup("fa_abc123") 58 account = result 59 print(f"Type: {account['type']}, Verified: {account['verified']}") 60 ``` 61 62 See Also: 63 - connect(): Add new financial accounts 64 - page(): List all financial accounts 65 """ 66 return await self.http.post('/financial_accounts/lookup', {'account_id': account_id}) 67 68 async def connect(self, payload: dict): 69 """ 70 Connect a new financial account for receiving payouts. 71 72 Adds a bank account, mobile money wallet, or Dosh account as a payout destination. 73 Financial accounts must include basic information like label, type, currency, and 74 type-specific configuration. Most account types require verification before they 75 can receive funds. 76 77 Args: 78 payload: Connection parameters including: 79 - label: Account label (5-40 characters) (required) 80 - type: Account type ("wallet", "bank_account", or "dosh_account") (required) 81 - reference: External reference ID (5-40 characters) (required) 82 - currency: Account currency (currently only "ghs" supported) (required) 83 - description: Optional account description (0-200 characters) 84 - owner: Account owner information (required): 85 - name: Owner full name 86 - address: Owner address details (name, line_1, city, region, country) 87 - wallet: Wallet configuration (required if type is "wallet"): 88 - type: "mobile_money" 89 - mobile_money: 90 - account_number: Phone number (e.g., "0241234567") 91 - network: Network operator ("mtn", "vodafone", "airteltigo") 92 - bank_account: Bank account configuration (required if type is "bank_account"): 93 - type: "ghana_bank_account" 94 - ghana_bank_account: 95 - number: Bank account number 96 - sort_code: Bank sort code (required if swift_code is not provided) 97 - swift_code: Bank SWIFT/BIC code (required if sort_code is not provided) 98 - holder: 99 - name: Account holder full name 100 - address: 101 - name: Address label 102 - line_1: Address line 1 103 - city: City or town 104 - region: Region or state 105 - country: Country code or name 106 - push_configuration: Configuration for sending funds to this account: 107 - enabled: Whether payouts to this account are enabled (default: true) 108 - pull_configuration: Configuration for collecting funds from this account: 109 - enabled: Whether pulling funds is enabled (default: false) 110 - mandate: Optional mandate parameters (created automatically using request metadata) 111 - custom_data: Optional key-value metadata (string-to-string) 112 113 Returns: 114 domain object containing: 115 - financial_account: Created financial account with id, type, status, etc. 116 - requires_verification: Whether verification is needed before use 117 118 Raises: 119 ApiError: If parameters are invalid or connection fails 120 121 Example: 122 ```python 123 # Connect mobile money wallet 124 result = client.financial_accounts.connect({ 125 "type": "wallet", 126 "currency": "ghs", 127 "label": "Primary MTN Wallet", 128 "description": "Main business mobile money account", 129 "reference": "WALLET-MTN-001", 130 "wallet": { 131 "type": "mobile_money", 132 "mobile_money": { 133 "account_number": "0241234567", 134 "network": "mtn" 135 } 136 }, 137 "push_configuration": { 138 "enabled": True 139 } 140 }) 141 142 fa = result 143 print(f"Financial account created: {fa['id']}") 144 145 # Verify if needed 146 if result.verification is not None: 147 # Initiate verification (sends OTP) 148 client.financial_accounts.verify({"account_id": fa["id"]}) 149 150 # Collect OTP from user 151 otp = input("Enter OTP: ") 152 153 # Complete verification 154 client.financial_accounts.verify({ 155 "account_id": fa["id"], 156 "token": otp 157 }) 158 159 # Connect Vodafone wallet 160 result = client.financial_accounts.connect({ 161 "type": "wallet", 162 "currency": "ghs", 163 "label": "Vodafone Cash Account", 164 "reference": "WALLET-VDF-001", 165 "wallet": { 166 "type": "mobile_money", 167 "mobile_money": { 168 "account_number": "0501234567", 169 "network": "vodafone" 170 } 171 }, 172 "push_configuration": {"enabled": True} 173 }) 174 ``` 175 176 Note: 177 - Financial accounts must be verified before they can receive payouts 178 - Only "ghs" currency is currently supported 179 - Dosh account types are placeholders for future functionality 180 181 See Also: 182 - verify(): Verify ownership of financial account 183 - Payouts.set_destinations(): Configure account as payout destination 184 - https://studio.inttegro.com/set-up-financial-account 185 """ 186 return await self.http.post('/financial_accounts/connect', payload) 187 188 async def archive(self, payload: dict): 189 """ 190 Archive a financial account to prevent future use. 191 192 Archives a financial account, marking it inactive. Archived accounts cannot be 193 used as payout destinations but remain in your account history. 194 195 Args: 196 payload: Archive parameters including account_id 197 198 Returns: 199 domain object containing the archived financial_account 200 201 Example: 202 ```python 203 result = client.financial_accounts.archive({"account_id": "fa_abc123"}) 204 ``` 205 206 See Also: 207 - connect(): Add replacement financial account 208 """ 209 return await self.http.post('/financial_accounts/archive', payload) 210 211 async def page(self, payload: dict | None=None): 212 """ 213 List connected financial accounts with pagination and filtering. 214 215 Retrieves a paginated list of your financial accounts with optional filtering 216 by type and status. 217 218 Args: 219 payload: Optional pagination parameters and filters 220 221 Returns: 222 domain object containing data (list of accounts), has_more, and count 223 224 Example: 225 ```python 226 result = client.financial_accounts.page({"limit": 20, "status": "active"}) 227 ``` 228 229 See Also: 230 - connect(): Add new financial accounts 231 """ 232 return await self.http.post('/financial_accounts/page', payload or {}) 233 234 async def search(self, payload: SearchRequest) -> SearchPage: 235 """Search financial-account projections owned by the authenticated application.""" 236 return await self.http.post('/financial_accounts/search', payload) 237 238 async def verify(self, payload: dict): 239 """ 240 Initiate or complete verification of a financial account. 241 242 Verification confirms ownership of the financial account. For mobile money, this 243 sends an OTP that must be submitted to complete verification. 244 245 Args: 246 payload: Verification parameters including account_id and optionally token 247 248 Returns: 249 domain object containing the financial_account with updated verification status 250 251 Example: 252 ```python 253 # Initiate verification 254 client.financial_accounts.verify({"account_id": "fa_abc123"}) 255 # Complete verification 256 result = client.financial_accounts.verify({ 257 "account_id": "fa_abc123", 258 "token": "123456" 259 }) 260 ``` 261 262 See Also: 263 - connect(): Add financial accounts that need verification 264 """ 265 return await self.http.post('/financial_accounts/verify', payload) 266 267 async def update(self, payload: dict): 268 """ 269 Update a financial account (PATCH semantics). 270 271 All fields except account_id are optional. custom_data merges with existing data; null deletes keys. 272 273 Args: 274 payload: Update parameters including account_id and fields to change 275 276 Returns: 277 domain object containing the updated financial_account 278 """ 279 return await self.http.post('/financial_accounts/update', payload) 280 281 async def enable_push(self, account_id: str): 282 """Enable push configuration for payouts. 283 284 API endpoint: ``/financial_accounts/enable_push``. 285 286 Args: 287 account_id (str): Unique identifier of the account. 288 289 Returns: 290 ``FinancialAccount`` decoded from the documented response shape. 291 292 Raises: 293 APIError: The API rejected the request or could not complete it. 294 NetworkError: The request could not reach the Inttegro API. 295 TimeoutError: The configured request deadline elapsed. 296 """ 297 return await self.http.post('/financial_accounts/enable_push', {'account_id': account_id}) 298 299 async def disable_push(self, account_id: str, unset_as_payout_destination: bool | None=None): 300 """ 301 Disable push configuration for payouts. 302 303 If the account is a payout destination, set unset_as_payout_destination to True to 304 automatically remove it before disabling push. 305 """ 306 payload = {'account_id': account_id} 307 if unset_as_payout_destination is not None: 308 payload['unset_as_payout_destination'] = unset_as_payout_destination 309 return await self.http.post('/financial_accounts/disable_push', payload) 310 311 async def disconnect(self, account_id: str, unset_as_payout_destination: bool | None=None): 312 """ 313 Disconnect a financial account. 314 315 If the account is a payout destination, set unset_as_payout_destination to True to 316 automatically remove it before disconnecting. 317 """ 318 payload = {'account_id': account_id} 319 if unset_as_payout_destination is not None: 320 payload['unset_as_payout_destination'] = unset_as_payout_destination 321 return await self.http.post('/financial_accounts/disconnect', payload) 322 323 async def reconnect(self, account_id: str): 324 """ 325 Reconnect a previously disconnected financial account. 326 327 Args: 328 account_id: The financial account ID to reconnect. 329 330 Returns: 331 domain object containing the reconnected financial account. 332 """ 333 return await self.http.post('/financial_accounts/reconnect', {'account_id': account_id}) 334 335 async def enable_pull(self, account_id: str): 336 """Enable pull configuration for charges (creates mandate). 337 338 API endpoint: ``/financial_accounts/enable_pull``. 339 340 Args: 341 account_id (str): Unique identifier of the account. 342 343 Returns: 344 ``FinancialAccount`` decoded from the documented response shape. 345 346 Raises: 347 APIError: The API rejected the request or could not complete it. 348 NetworkError: The request could not reach the Inttegro API. 349 TimeoutError: The configured request deadline elapsed. 350 """ 351 return await self.http.post('/financial_accounts/enable_pull', {'account_id': account_id}) 352 353 async def disable_pull(self, account_id: str): 354 """Disable pull configuration for charges. 355 356 API endpoint: ``/financial_accounts/disable_pull``. 357 358 Args: 359 account_id (str): Unique identifier of the account. 360 361 Returns: 362 ``FinancialAccount`` decoded from the documented response shape. 363 364 Raises: 365 APIError: The API rejected the request or could not complete it. 366 NetworkError: The request could not reach the Inttegro API. 367 TimeoutError: The configured request deadline elapsed. 368 """ 369 return await self.http.post('/financial_accounts/disable_pull', {'account_id': account_id})
Financial accounts resource for connecting and managing payout destinations.
Financial accounts represent bank accounts, mobile money wallets, or Dosh accounts where you receive payouts. Before you can receive funds from Inttegro, you must connect and verify at least one financial account, then configure it as a payout destination.
The typical flow is:
- Connect a financial account (bank_account, mobile money, or dosh_account)
- Verify ownership via OTP
- Set as payout destination via Payouts resource
- Receive automatic or manual payouts
See https://studio.inttegro.com/set-up-financial-account for detailed guides.
25 def __init__(self, http: AsyncHttpClient): 26 """Initialize FinancialAccounts resource with HTTP client.""" 27 self.http = http
Initialize FinancialAccounts resource with HTTP client.
29 async def create(self, payload: dict): 30 """ 31 Create a new financial account. 32 33 Args: 34 payload: Account creation parameters 35 36 Returns: 37 domain object with created financial account 38 39 """ 40 return await self.http.post('/financial_accounts/create', payload)
Create a new financial account.
Arguments:
- payload: Account creation parameters
Returns:
domain object with created financial account
42 async def lookup(self, account_id: str): 43 """ 44 Retrieve details of a financial account. 45 46 Fetches information about a connected financial account including its type, 47 verification status, and masked details. 48 49 Args: 50 account_id: The financial account ID (e.g., "fa_abc123") 51 52 Returns: 53 domain object containing the financial_account object 54 55 Example: 56 ```python 57 result = client.financial_accounts.lookup("fa_abc123") 58 account = result 59 print(f"Type: {account['type']}, Verified: {account['verified']}") 60 ``` 61 62 See Also: 63 - connect(): Add new financial accounts 64 - page(): List all financial accounts 65 """ 66 return await self.http.post('/financial_accounts/lookup', {'account_id': account_id})
Retrieve details of a financial account.
Fetches information about a connected financial account including its type, verification status, and masked details.
Arguments:
- account_id: The financial account ID (e.g., "fa_abc123")
Returns:
domain object containing the financial_account object
Example:
result = client.financial_accounts.lookup("fa_abc123") account = result print(f"Type: {account['type']}, Verified: {account['verified']}")
See Also:
- connect(): Add new financial accounts
- page(): List all financial accounts
68 async def connect(self, payload: dict): 69 """ 70 Connect a new financial account for receiving payouts. 71 72 Adds a bank account, mobile money wallet, or Dosh account as a payout destination. 73 Financial accounts must include basic information like label, type, currency, and 74 type-specific configuration. Most account types require verification before they 75 can receive funds. 76 77 Args: 78 payload: Connection parameters including: 79 - label: Account label (5-40 characters) (required) 80 - type: Account type ("wallet", "bank_account", or "dosh_account") (required) 81 - reference: External reference ID (5-40 characters) (required) 82 - currency: Account currency (currently only "ghs" supported) (required) 83 - description: Optional account description (0-200 characters) 84 - owner: Account owner information (required): 85 - name: Owner full name 86 - address: Owner address details (name, line_1, city, region, country) 87 - wallet: Wallet configuration (required if type is "wallet"): 88 - type: "mobile_money" 89 - mobile_money: 90 - account_number: Phone number (e.g., "0241234567") 91 - network: Network operator ("mtn", "vodafone", "airteltigo") 92 - bank_account: Bank account configuration (required if type is "bank_account"): 93 - type: "ghana_bank_account" 94 - ghana_bank_account: 95 - number: Bank account number 96 - sort_code: Bank sort code (required if swift_code is not provided) 97 - swift_code: Bank SWIFT/BIC code (required if sort_code is not provided) 98 - holder: 99 - name: Account holder full name 100 - address: 101 - name: Address label 102 - line_1: Address line 1 103 - city: City or town 104 - region: Region or state 105 - country: Country code or name 106 - push_configuration: Configuration for sending funds to this account: 107 - enabled: Whether payouts to this account are enabled (default: true) 108 - pull_configuration: Configuration for collecting funds from this account: 109 - enabled: Whether pulling funds is enabled (default: false) 110 - mandate: Optional mandate parameters (created automatically using request metadata) 111 - custom_data: Optional key-value metadata (string-to-string) 112 113 Returns: 114 domain object containing: 115 - financial_account: Created financial account with id, type, status, etc. 116 - requires_verification: Whether verification is needed before use 117 118 Raises: 119 ApiError: If parameters are invalid or connection fails 120 121 Example: 122 ```python 123 # Connect mobile money wallet 124 result = client.financial_accounts.connect({ 125 "type": "wallet", 126 "currency": "ghs", 127 "label": "Primary MTN Wallet", 128 "description": "Main business mobile money account", 129 "reference": "WALLET-MTN-001", 130 "wallet": { 131 "type": "mobile_money", 132 "mobile_money": { 133 "account_number": "0241234567", 134 "network": "mtn" 135 } 136 }, 137 "push_configuration": { 138 "enabled": True 139 } 140 }) 141 142 fa = result 143 print(f"Financial account created: {fa['id']}") 144 145 # Verify if needed 146 if result.verification is not None: 147 # Initiate verification (sends OTP) 148 client.financial_accounts.verify({"account_id": fa["id"]}) 149 150 # Collect OTP from user 151 otp = input("Enter OTP: ") 152 153 # Complete verification 154 client.financial_accounts.verify({ 155 "account_id": fa["id"], 156 "token": otp 157 }) 158 159 # Connect Vodafone wallet 160 result = client.financial_accounts.connect({ 161 "type": "wallet", 162 "currency": "ghs", 163 "label": "Vodafone Cash Account", 164 "reference": "WALLET-VDF-001", 165 "wallet": { 166 "type": "mobile_money", 167 "mobile_money": { 168 "account_number": "0501234567", 169 "network": "vodafone" 170 } 171 }, 172 "push_configuration": {"enabled": True} 173 }) 174 ``` 175 176 Note: 177 - Financial accounts must be verified before they can receive payouts 178 - Only "ghs" currency is currently supported 179 - Dosh account types are placeholders for future functionality 180 181 See Also: 182 - verify(): Verify ownership of financial account 183 - Payouts.set_destinations(): Configure account as payout destination 184 - https://studio.inttegro.com/set-up-financial-account 185 """ 186 return await self.http.post('/financial_accounts/connect', payload)
Connect a new financial account for receiving payouts.
Adds a bank account, mobile money wallet, or Dosh account as a payout destination. Financial accounts must include basic information like label, type, currency, and type-specific configuration. Most account types require verification before they can receive funds.
Arguments:
- payload: Connection parameters including:
- label: Account label (5-40 characters) (required)
- type: Account type ("wallet", "bank_account", or "dosh_account") (required)
- reference: External reference ID (5-40 characters) (required)
- currency: Account currency (currently only "ghs" supported) (required)
- description: Optional account description (0-200 characters)
- owner: Account owner information (required):
- name: Owner full name
- address: Owner address details (name, line_1, city, region, country)
- wallet: Wallet configuration (required if type is "wallet"):
- type: "mobile_money"
- mobile_money:
- account_number: Phone number (e.g., "0241234567")
- network: Network operator ("mtn", "vodafone", "airteltigo")
- bank_account: Bank account configuration (required if type is "bank_account"):
- type: "ghana_bank_account"
- ghana_bank_account:
- number: Bank account number
- sort_code: Bank sort code (required if swift_code is not provided)
- swift_code: Bank SWIFT/BIC code (required if sort_code is not provided)
- holder:
- name: Account holder full name
- address:
- name: Address label
- line_1: Address line 1
- city: City or town
- region: Region or state
- country: Country code or name
- push_configuration: Configuration for sending funds to this account:
- enabled: Whether payouts to this account are enabled (default: true)
- pull_configuration: Configuration for collecting funds from this account:
- enabled: Whether pulling funds is enabled (default: false)
- mandate: Optional mandate parameters (created automatically using request metadata)
- custom_data: Optional key-value metadata (string-to-string)
Returns:
domain object containing: - financial_account: Created financial account with id, type, status, etc. - requires_verification: Whether verification is needed before use
Raises:
- ApiError: If parameters are invalid or connection fails
Example:
# Connect mobile money wallet result = client.financial_accounts.connect({ "type": "wallet", "currency": "ghs", "label": "Primary MTN Wallet", "description": "Main business mobile money account", "reference": "WALLET-MTN-001", "wallet": { "type": "mobile_money", "mobile_money": { "account_number": "0241234567", "network": "mtn" } }, "push_configuration": { "enabled": True } }) fa = result print(f"Financial account created: {fa['id']}") # Verify if needed if result.verification is not None: # Initiate verification (sends OTP) client.financial_accounts.verify({"account_id": fa["id"]}) # Collect OTP from user otp = input("Enter OTP: ") # Complete verification client.financial_accounts.verify({ "account_id": fa["id"], "token": otp }) # Connect Vodafone wallet result = client.financial_accounts.connect({ "type": "wallet", "currency": "ghs", "label": "Vodafone Cash Account", "reference": "WALLET-VDF-001", "wallet": { "type": "mobile_money", "mobile_money": { "account_number": "0501234567", "network": "vodafone" } }, "push_configuration": {"enabled": True} })
Note:
- Financial accounts must be verified before they can receive payouts
- Only "ghs" currency is currently supported
- Dosh account types are placeholders for future functionality
See Also:
- verify(): Verify ownership of financial account
- Payouts.set_destinations(): Configure account as payout destination
- https://studio.inttegro.com/set-up-financial-account
188 async def archive(self, payload: dict): 189 """ 190 Archive a financial account to prevent future use. 191 192 Archives a financial account, marking it inactive. Archived accounts cannot be 193 used as payout destinations but remain in your account history. 194 195 Args: 196 payload: Archive parameters including account_id 197 198 Returns: 199 domain object containing the archived financial_account 200 201 Example: 202 ```python 203 result = client.financial_accounts.archive({"account_id": "fa_abc123"}) 204 ``` 205 206 See Also: 207 - connect(): Add replacement financial account 208 """ 209 return await self.http.post('/financial_accounts/archive', payload)
Archive a financial account to prevent future use.
Archives a financial account, marking it inactive. Archived accounts cannot be used as payout destinations but remain in your account history.
Arguments:
- payload: Archive parameters including account_id
Returns:
domain object containing the archived financial_account
Example:
result = client.financial_accounts.archive({"account_id": "fa_abc123"})
See Also:
- connect(): Add replacement financial account
211 async def page(self, payload: dict | None=None): 212 """ 213 List connected financial accounts with pagination and filtering. 214 215 Retrieves a paginated list of your financial accounts with optional filtering 216 by type and status. 217 218 Args: 219 payload: Optional pagination parameters and filters 220 221 Returns: 222 domain object containing data (list of accounts), has_more, and count 223 224 Example: 225 ```python 226 result = client.financial_accounts.page({"limit": 20, "status": "active"}) 227 ``` 228 229 See Also: 230 - connect(): Add new financial accounts 231 """ 232 return await self.http.post('/financial_accounts/page', payload or {})
List connected financial accounts with pagination and filtering.
Retrieves a paginated list of your financial accounts with optional filtering by type and status.
Arguments:
- payload: Optional pagination parameters and filters
Returns:
domain object containing data (list of accounts), has_more, and count
Example:
result = client.financial_accounts.page({"limit": 20, "status": "active"})
See Also:
- connect(): Add new financial accounts
234 async def search(self, payload: SearchRequest) -> SearchPage: 235 """Search financial-account projections owned by the authenticated application.""" 236 return await self.http.post('/financial_accounts/search', payload)
Search financial-account projections owned by the authenticated application.
238 async def verify(self, payload: dict): 239 """ 240 Initiate or complete verification of a financial account. 241 242 Verification confirms ownership of the financial account. For mobile money, this 243 sends an OTP that must be submitted to complete verification. 244 245 Args: 246 payload: Verification parameters including account_id and optionally token 247 248 Returns: 249 domain object containing the financial_account with updated verification status 250 251 Example: 252 ```python 253 # Initiate verification 254 client.financial_accounts.verify({"account_id": "fa_abc123"}) 255 # Complete verification 256 result = client.financial_accounts.verify({ 257 "account_id": "fa_abc123", 258 "token": "123456" 259 }) 260 ``` 261 262 See Also: 263 - connect(): Add financial accounts that need verification 264 """ 265 return await self.http.post('/financial_accounts/verify', payload)
Initiate or complete verification of a financial account.
Verification confirms ownership of the financial account. For mobile money, this sends an OTP that must be submitted to complete verification.
Arguments:
- payload: Verification parameters including account_id and optionally token
Returns:
domain object containing the financial_account with updated verification status
Example:
# Initiate verification client.financial_accounts.verify({"account_id": "fa_abc123"}) # Complete verification result = client.financial_accounts.verify({ "account_id": "fa_abc123", "token": "123456" })
See Also:
- connect(): Add financial accounts that need verification
267 async def update(self, payload: dict): 268 """ 269 Update a financial account (PATCH semantics). 270 271 All fields except account_id are optional. custom_data merges with existing data; null deletes keys. 272 273 Args: 274 payload: Update parameters including account_id and fields to change 275 276 Returns: 277 domain object containing the updated financial_account 278 """ 279 return await self.http.post('/financial_accounts/update', payload)
Update a financial account (PATCH semantics).
All fields except account_id are optional. custom_data merges with existing data; null deletes keys.
Arguments:
- payload: Update parameters including account_id and fields to change
Returns:
domain object containing the updated financial_account
281 async def enable_push(self, account_id: str): 282 """Enable push configuration for payouts. 283 284 API endpoint: ``/financial_accounts/enable_push``. 285 286 Args: 287 account_id (str): Unique identifier of the account. 288 289 Returns: 290 ``FinancialAccount`` decoded from the documented response shape. 291 292 Raises: 293 APIError: The API rejected the request or could not complete it. 294 NetworkError: The request could not reach the Inttegro API. 295 TimeoutError: The configured request deadline elapsed. 296 """ 297 return await self.http.post('/financial_accounts/enable_push', {'account_id': account_id})
Enable push configuration for payouts.
API endpoint: /financial_accounts/enable_push.
Arguments:
- account_id (str): Unique identifier of the account.
Returns:
FinancialAccountdecoded from the documented response shape.
Raises:
- APIError: The API rejected the request or could not complete it.
- NetworkError: The request could not reach the Inttegro API.
- TimeoutError: The configured request deadline elapsed.
299 async def disable_push(self, account_id: str, unset_as_payout_destination: bool | None=None): 300 """ 301 Disable push configuration for payouts. 302 303 If the account is a payout destination, set unset_as_payout_destination to True to 304 automatically remove it before disabling push. 305 """ 306 payload = {'account_id': account_id} 307 if unset_as_payout_destination is not None: 308 payload['unset_as_payout_destination'] = unset_as_payout_destination 309 return await self.http.post('/financial_accounts/disable_push', payload)
Disable push configuration for payouts.
If the account is a payout destination, set unset_as_payout_destination to True to automatically remove it before disabling push.
311 async def disconnect(self, account_id: str, unset_as_payout_destination: bool | None=None): 312 """ 313 Disconnect a financial account. 314 315 If the account is a payout destination, set unset_as_payout_destination to True to 316 automatically remove it before disconnecting. 317 """ 318 payload = {'account_id': account_id} 319 if unset_as_payout_destination is not None: 320 payload['unset_as_payout_destination'] = unset_as_payout_destination 321 return await self.http.post('/financial_accounts/disconnect', payload)
Disconnect a financial account.
If the account is a payout destination, set unset_as_payout_destination to True to automatically remove it before disconnecting.
323 async def reconnect(self, account_id: str): 324 """ 325 Reconnect a previously disconnected financial account. 326 327 Args: 328 account_id: The financial account ID to reconnect. 329 330 Returns: 331 domain object containing the reconnected financial account. 332 """ 333 return await self.http.post('/financial_accounts/reconnect', {'account_id': account_id})
Reconnect a previously disconnected financial account.
Arguments:
- account_id: The financial account ID to reconnect.
Returns:
domain object containing the reconnected financial account.
335 async def enable_pull(self, account_id: str): 336 """Enable pull configuration for charges (creates mandate). 337 338 API endpoint: ``/financial_accounts/enable_pull``. 339 340 Args: 341 account_id (str): Unique identifier of the account. 342 343 Returns: 344 ``FinancialAccount`` decoded from the documented response shape. 345 346 Raises: 347 APIError: The API rejected the request or could not complete it. 348 NetworkError: The request could not reach the Inttegro API. 349 TimeoutError: The configured request deadline elapsed. 350 """ 351 return await self.http.post('/financial_accounts/enable_pull', {'account_id': account_id})
Enable pull configuration for charges (creates mandate).
API endpoint: /financial_accounts/enable_pull.
Arguments:
- account_id (str): Unique identifier of the account.
Returns:
FinancialAccountdecoded from the documented response shape.
Raises:
- APIError: The API rejected the request or could not complete it.
- NetworkError: The request could not reach the Inttegro API.
- TimeoutError: The configured request deadline elapsed.
353 async def disable_pull(self, account_id: str): 354 """Disable pull configuration for charges. 355 356 API endpoint: ``/financial_accounts/disable_pull``. 357 358 Args: 359 account_id (str): Unique identifier of the account. 360 361 Returns: 362 ``FinancialAccount`` decoded from the documented response shape. 363 364 Raises: 365 APIError: The API rejected the request or could not complete it. 366 NetworkError: The request could not reach the Inttegro API. 367 TimeoutError: The configured request deadline elapsed. 368 """ 369 return await self.http.post('/financial_accounts/disable_pull', {'account_id': account_id})
Disable pull configuration for charges.
API endpoint: /financial_accounts/disable_pull.
Arguments:
- account_id (str): Unique identifier of the account.
Returns:
FinancialAccountdecoded from the documented response shape.
Raises:
- APIError: The API rejected the request or could not complete it.
- NetworkError: The request could not reach the Inttegro API.
- TimeoutError: The configured request deadline elapsed.