Skip to main content

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

MethodEndpointDescription
GET/v1/funding/sourcesList funding sources
GET/v1/funding/accountsList funding accounts
PATCH/v1/funding/accounts/{id}Update funding account
GET/v1/funding/transactionsList transactions
GET/v1/funding/transaction-requirementsGet 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

ParameterTypeDescription
pageSizeintegerResults per page
pageTokenstringPagination token
fundingSourceIdsarrayFilter by source IDs
fundingSourceTypeenumFilter by type

Funding Source Types

TypeDescription
FUNDING_SOURCE_TYPE_BANK_ACCOUNTTraditional bank account
FUNDING_SOURCE_TYPE_AEROPAY_BANK_ACCOUNTAeropay-linked bank
FUNDING_SOURCE_TYPE_CHECKOUT_CARDPayment card
FUNDING_SOURCE_TYPE_APPLE_PAYApple 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

ParameterTypeDescription
pageSizeintegerResults per page
pageTokenstringPagination token
accountIdsarrayFilter by account IDs
fundingSourceIdsarrayFilter by funding source IDs
accountTypeenumFilter by account type

Account Types

TypeDescription
ACCOUNT_TYPE_CLEARINGMain trading account
ACCOUNT_TYPE_REVENUERevenue account
ACCOUNT_TYPE_HOLDINGHolding account
ACCOUNT_TYPE_ADVANCEAdvance 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

ParameterTypeDescription
pageSizeintegerResults per page
pageTokenstringPagination token
accountIdstringFilter by account
currencystringFilter by currency
transactionTypesarrayFilter by transaction type
transactionStatesarrayFilter by state
startTimedatetimeStart of date range
endTimedatetimeEnd of date range
newestFirstbooleanSort order

Transaction Types

TypeDescription
TRANSACTION_TYPE_DEPOSITDeposit transaction
TRANSACTION_TYPE_WITHDRAWALWithdrawal transaction
TRANSACTION_TYPE_TRANSFERInternal transfer
TRANSACTION_TYPE_EXECUTION_FEETrading fee
TRANSACTION_TYPE_SETTLEMENT_FEESettlement fee
TRANSACTION_TYPE_MANUAL_ADJUSTMENTManual adjustment

Transaction States

StateDescription
TRANSACTION_STATE_ACKNOWLEDGEDReceived
TRANSACTION_STATE_PROCESSINGIn progress
TRANSACTION_STATE_COMPLETEDCompleted
TRANSACTION_STATE_CANCELLEDCancelled
TRANSACTION_STATE_REFUNDEDRefunded

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

ParameterTypeDescription
pageSizeintegerResults per page
pageTokenstringPagination token
accountIdsarrayFilter 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:
DateActionSourceAmount
Jan 1DepositBank A$1,000
Jan 5DepositBank B$500
Jan 10DepositCard C$200
User wants to withdraw $1,200: The system calculates requirements:
  1. $200 must go to Card C (most recent)
  2. $500 must go to Bank B
  3. $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

  1. Always check requirements before showing withdrawal options
  2. Display clear explanations to users about why they must withdraw to specific sources
  3. Split withdrawals automatically when the amount exceeds a single source requirement
  4. 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",
    ...
  }
}

Pagination

All list endpoints support cursor-based pagination:
  1. Make initial request without pageToken
  2. Check eof field - if false, more results exist
  3. Use nextPageToken for subsequent requests
  4. 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"]