Payments API
The Payments API provides multiple funding options for deposits and withdrawals. Users can fund their accounts via bank transfers (ACH) through Aeropay or card payments through Checkout.com.Payment Methods
| Method | Provider | Type | Speed |
|---|---|---|---|
| Bank Transfer (ACH) | Aeropay | Bank account linking | 1-3 business days |
| Debit/Credit Card | Checkout.com | Card payments | Instant |
| Apple Pay | Checkout.com | Mobile wallet | Instant |
APIs
Aeropay API
Bank account linking and ACH transfers. Orchestrated Endpoints (Recommended):| Method | Endpoint | Description |
|---|---|---|
POST | /v1/aeropay/initialize | Start bank linking - handles user creation and MFA automatically |
POST | /v1/aeropay/validate-mfa | Submit MFA code if required |
GET | /v1/aeropay/methods | List payment methods with limits and FIFO rules |
POST | /v1/aeropay/deposits | Create ACH deposit |
POST | /v1/aeropay/withdrawals | Create ACH withdrawal |
Checkout API
Card payment processing:| Method | Endpoint | Description |
|---|---|---|
POST | /v1/checkout/payment-sessions | Request payment session for card tokenization |
POST | /v1/checkout/instruments | Save tokenized card as instrument |
POST | /v1/checkout/deposits | Process card or Apple Pay deposit |
POST | /v1/checkout/withdrawals | Process card or Apple Pay withdrawal |
Funding API
Manage funding sources and transactions:| 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 | View transaction history |
GET | /v1/funding/transaction-requirements | Check FIFO withdrawal requirements |
Typical Integration Flow
New User Onboarding
Deposit Flow
- Select funding source - User chooses linked bank/card
- Check limits - Validate amount against transaction limits
- Enter amount - Collect deposit amount
- Confirm - Process the deposit
- Track status - Monitor transaction completion
Withdrawal Flow
- Check FIFO requirements - Get withdrawal requirements from funding source
- Select destination - User chooses where to send funds (must follow FIFO)
- Enter amount - Validate against available balance and requirements
- Confirm - Process the withdrawal
- Track status - Monitor transaction completion
FIFO Withdrawal Requirements
Withdrawals must follow FIFO (First-In-First-Out) rules. Funds must be returned to their original deposit source before they can be withdrawn elsewhere.Example
- User deposits $1,000 from Bank A
- User deposits $500 from Bank B
- User wants to withdraw $1,200
- $500 to Bank B (most recent deposit)
- $700 to Bank A (remaining amount)
Checking Requirements
Use the/v1/funding/transaction-requirements endpoint or check the withdrawalRequirements field in Aeropay’s GetAeropayMethods response.
Funding Source Types
TheFundingSourceType enum identifies the payment method:
| Type | Description |
|---|---|
FUNDING_SOURCE_TYPE_BANK_ACCOUNT | Traditional bank account |
FUNDING_SOURCE_TYPE_AEROPAY_BANK_ACCOUNT | Aeropay-linked bank account |
FUNDING_SOURCE_TYPE_CHECKOUT_CARD | Tokenized payment card |
FUNDING_SOURCE_TYPE_APPLE_PAY | Apple Pay |
Transaction States
| State | Description |
|---|---|
TRANSACTION_STATE_ACKNOWLEDGED | Transaction received |
TRANSACTION_STATE_PROCESSING | Being processed |
TRANSACTION_STATE_COMPLETED | Successfully completed |
TRANSACTION_STATE_CANCELLED | Cancelled |
TRANSACTION_STATE_ALLOCATED | Funds allocated |
TRANSACTION_STATE_REFUNDED | Fully refunded |
TRANSACTION_STATE_PARTIALLY_REFUNDED | Partially refunded |
Transaction Types
| Type | Description |
|---|---|
TRANSACTION_TYPE_DEPOSIT | Funds deposited |
TRANSACTION_TYPE_WITHDRAWAL | Funds withdrawn |
TRANSACTION_TYPE_TRANSFER | Internal transfer |
TRANSACTION_TYPE_EXECUTION_FEE | Trading fee |
TRANSACTION_TYPE_SETTLEMENT_FEE | Settlement fee |
Best Practices
- Use orchestrated endpoints - For Aeropay, use
/v1/aeropay/initializeinstead of primitive endpoints - Check limits before transactions - Use the Aeropay methods or funding transaction requirements APIs
- Respect FIFO rules - Always check withdrawal requirements before processing
- Handle all states - Implement UI for pending, success, and failure
- Implement webhooks - Don’t rely solely on polling for status updates
- Validate amounts client-side - Reduce failed API calls
- Store payment method IDs - Cache linked payment methods for faster checkout

