Funding Management
The Funding API provides read access to funding sources, accounts, and transaction history.
Authentication
Authentication Required - All Funding endpoints require authentication. Include your access token in the Authorization header.
Authorization: Bearer YOUR_ACCESS_TOKEN
See Authentication Setup for instructions on obtaining tokens.
Endpoints
| Method | Endpoint | Description |
|---|
GET | /v1/funding/sources | List funding sources |
GET | /v1/funding/accounts | List funding accounts |
PATCH | /v1/funding/accounts/{id} | Update funding account |
GET | /v1/funding/transactions | List transactions |
GET | /v1/funding/transaction-requirements | Get transaction requirements |
List Funding Sources
Retrieve all funding sources (payment methods) available to the user.
Request
GET /v1/funding/sources?fundingSourceType=FUNDING_SOURCE_TYPE_AEROPAY_BANK_ACCOUNT
Query Parameters
| Parameter | Type | Description |
|---|
pageSize | integer | Results per page |
pageToken | string | Pagination token |
fundingSourceIds | array | Filter by source IDs |
fundingSourceType | enum | Filter by type |
Funding Source Types
| Type | Description |
|---|
FUNDING_SOURCE_TYPE_BANK_ACCOUNT | Traditional bank account |
FUNDING_SOURCE_TYPE_AEROPAY_BANK_ACCOUNT | Aeropay-linked bank |
FUNDING_SOURCE_TYPE_CHECKOUT_CARD | Payment card |
FUNDING_SOURCE_TYPE_APPLE_PAY | Apple Pay |
Response
{
"fundingSources": [
{
"id": "fs_abc123",
"type": "FUNDING_SOURCE_TYPE_AEROPAY_BANK_ACCOUNT",
"aeropayBankAccountDetails": {
"userId": "aero_user_123",
"bankAccountId": "ba_123",
"name": "John's Checking",
"bankName": "Chase Bank",
"accountLast4": "4567",
"accountType": "checking"
},
"transactionLimits": {
"currencyLimits": [
{
"currency": "USD",
"maxDepositRequestAmount": {"value": "10000.00"},
"maxDepositDailyAmount": {"value": "25000.00"},
"maxDeposit60dayAmount": {"value": "100000.00"}
}
]
},
"disabled": false
}
],
"nextPageToken": "",
"eof": true
}
List Funding Accounts
Retrieve funding accounts associated with the user.
Request
GET /v1/funding/accounts?accountType=ACCOUNT_TYPE_CLEARING
Query Parameters
| Parameter | Type | Description |
|---|
pageSize | integer | Results per page |
pageToken | string | Pagination token |
accountIds | array | Filter by account IDs |
fundingSourceIds | array | Filter by funding source IDs |
accountType | enum | Filter by account type |
Account Types
| Type | Description |
|---|
ACCOUNT_TYPE_CLEARING | Main trading account |
ACCOUNT_TYPE_REVENUE | Revenue account |
ACCOUNT_TYPE_HOLDING | Holding account |
ACCOUNT_TYPE_ADVANCE | Advance account |
Response
{
"accounts": [
{
"id": "fa_123",
"name": "Main Trading Account",
"accountType": "ACCOUNT_TYPE_CLEARING",
"associatedFundingSources": ["fs_abc123", "fs_def456"],
"riskAccountId": "risk_123",
"creationTime": "2024-01-15T10:00:00Z"
}
],
"nextPageToken": "",
"eof": true
}
List Transactions
Retrieve transaction history with filtering options.
Request
GET /v1/funding/transactions?accountId=fa_123&transactionTypes=TRANSACTION_TYPE_DEPOSIT&newestFirst=true
Query Parameters
| Parameter | Type | Description |
|---|
pageSize | integer | Results per page |
pageToken | string | Pagination token |
accountId | string | Filter by account |
currency | string | Filter by currency |
transactionTypes | array | Filter by transaction type |
transactionStates | array | Filter by state |
startTime | datetime | Start of date range |
endTime | datetime | End of date range |
newestFirst | boolean | Sort order |
Transaction Types
| Type | Description |
|---|
TRANSACTION_TYPE_DEPOSIT | Deposit transaction |
TRANSACTION_TYPE_WITHDRAWAL | Withdrawal transaction |
TRANSACTION_TYPE_TRANSFER | Internal transfer |
TRANSACTION_TYPE_EXECUTION_FEE | Trading fee |
TRANSACTION_TYPE_SETTLEMENT_FEE | Settlement fee |
TRANSACTION_TYPE_MANUAL_ADJUSTMENT | Manual adjustment |
Transaction States
| State | Description |
|---|
TRANSACTION_STATE_ACKNOWLEDGED | Received |
TRANSACTION_STATE_PROCESSING | In progress |
TRANSACTION_STATE_COMPLETED | Completed |
TRANSACTION_STATE_CANCELLED | Cancelled |
TRANSACTION_STATE_REFUNDED | Refunded |
Response
{
"transactions": [
{
"transactionId": "txn_123",
"fundingTransactionId": "ft_deposit_789",
"amount": "100.00",
"currency": "USD",
"description": "Account funding",
"ledgerEntryType": "LEDGER_ENTRY_TYPE_CREDIT",
"transactionType": "TRANSACTION_TYPE_DEPOSIT",
"transactionState": "TRANSACTION_STATE_COMPLETED",
"transactTime": "2024-01-15T10:30:00Z",
"accountId": "fa_123",
"fundingSourceId": "fs_abc123",
"fundingSourceType": "FUNDING_SOURCE_TYPE_AEROPAY_BANK_ACCOUNT",
"beforeBalance": "0.00",
"afterBalance": "100.00"
}
],
"nextPageToken": "",
"eof": true
}
Get Transaction Requirements
Check requirements and limits before initiating transactions. This is especially important for FIFO withdrawal requirements.
Request
GET /v1/funding/transaction-requirements?accountIds=fa_123
Query Parameters
| Parameter | Type | Description |
|---|
pageSize | integer | Results per page |
pageToken | string | Pagination token |
accountIds | array | Filter by account IDs |
Response
{
"transactionRequirements": [
{
"id": "req_123",
"accountId": "fa_123",
"transactionType": "TRANSACTION_TYPE_WITHDRAWAL",
"fundingSourceId": "fs_bank_b",
"amount": "500.00",
"currency": "USD",
"description": "Must withdraw to original deposit source (FIFO)",
"triggers": ["fifo_requirement"]
},
{
"id": "req_124",
"accountId": "fa_123",
"transactionType": "TRANSACTION_TYPE_WITHDRAWAL",
"fundingSourceId": "fs_bank_a",
"amount": "1000.00",
"currency": "USD",
"description": "Must withdraw to original deposit source (FIFO)",
"triggers": ["fifo_requirement"]
}
],
"nextPageToken": "",
"eof": true
}
FIFO Withdrawal Requirements
Withdrawals must follow FIFO (First-In-First-Out) rules. This regulatory requirement ensures that funds are returned to their original deposit source before they can be withdrawn to a different destination.
Why FIFO?
FIFO rules help prevent money laundering by ensuring funds flow back through the same channels they arrived. This is a standard requirement for regulated financial services.
How It Works
When a user deposits funds from multiple sources, withdrawals must be returned in reverse order (most recent deposit first):
Example Scenario:
| Date | Action | Source | Amount |
|---|
| Jan 1 | Deposit | Bank A | $1,000 |
| Jan 5 | Deposit | Bank B | $500 |
| Jan 10 | Deposit | Card C | $200 |
User wants to withdraw $1,200:
The system calculates requirements:
- $200 must go to Card C (most recent)
- $500 must go to Bank B
- $500 can go to Bank A
Checking Requirements Before Withdrawal
Option 1: Use Transaction Requirements API
GET /v1/funding/transaction-requirements?accountIds=fa_123
Look for requirements with transactionType: "TRANSACTION_TYPE_WITHDRAWAL".
Option 2: Use Aeropay Methods API (for ACH)
GET /v1/aeropay/methods?fundingAccountId=fa_123
Each payment method includes withdrawalRequirements:
{
"paymentMethods": [
{
"id": "pm_bank_b",
"bankName": "Chase Bank",
"withdrawalRequirements": [
{
"amount": "500.00",
"currency": "USD",
"fundingSourceId": "fs_bank_b",
"description": "Must withdraw to original deposit source (FIFO)"
}
]
}
]
}
Integration Best Practices
- Always check requirements before showing withdrawal options
- Display clear explanations to users about why they must withdraw to specific sources
- Split withdrawals automatically when the amount exceeds a single source requirement
- Handle partial withdrawals when user balance is less than total requirements
Update Funding Account
Update account settings (limited fields).
Request
PATCH /v1/funding/accounts/fa_123
{
"account": {
"name": "Updated Account Name",
"aliases": {
"display_name": "Trading Account"
}
}
}
Response
{
"account": {
"id": "fa_123",
"name": "Updated Account Name",
...
}
}
All list endpoints support cursor-based pagination:
- Make initial request without
pageToken
- Check
eof field - if false, more results exist
- Use
nextPageToken for subsequent requests
- Continue until
eof is true
page_token = None
while True:
params = {"pageSize": 100}
if page_token:
params["pageToken"] = page_token
response = get_transactions(params)
process(response["transactions"])
if response["eof"]:
break
page_token = response["nextPageToken"]