Mercury Banking API Manage business bank accounts, transactions, transfers, and financial operations via Mercury's REST API. Official docs: https://docs.mercury.com/reference/getaccount When to Use Use this skill when you need to: View account balances and details List and search transactions Create internal transfers between accounts Manage recipients for external transfers Download account statements Access treasury account information Prerequisites Sign up for a Mercury business bank account at https://mercury.com Go to Settings > Developers > API Tokens Create a new API token with appropriate permissions Set environment variable: export MERCURY_TOKEN = "your-api-token" Setup API Wrapper Create a helper script for API calls: cat
/tmp/mercury-curl << 'EOF'
!/bin/bash
- curl -s -H "Content-Type: application/json" -H "Authorization: Bearer $MERCURY_TOKEN" "$@"
- EOF
- chmod
- +x /tmp/mercury-curl
- Usage:
- All examples below use
- /tmp/mercury-curl
- instead of direct
- curl
- calls.
- Accounts
- List All Accounts
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/accounts"
- Get Account by ID
- Replace
- with the actual account ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
" - Get Account Cards
- Replace
- with the actual account ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
/cards" - Transactions
- List Account Transactions
- Replace
- with the actual account ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
/transactions" - List Transactions with Filters
- Filter by date range, status, or limit. Replace
- with the actual account ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
/transactions?limit=50&start=2024-01-01&end=2024-12-31" - Get Transaction by ID
- Replace
- and
- with the actual IDs:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
/transaction/ " - Transfers
- Create Internal Transfer
- Transfer funds between your Mercury accounts.
- Write to
- /tmp/mercury_request.json
- :
- {
- "toAccountId"
- :
- "target-account-id"
- ,
- "amount"
- :
- 100.00
- ,
- "note"
- :
- "Internal transfer"
- }
- Then run. Replace
- with the actual account ID:
- /tmp/mercury-curl
- -X
- POST
- "https://api.mercury.com/api/v1/account/
/internal-transfer" - -d
- @/tmp/mercury_request.json
- Send Money Request
- Initiate a money transfer request.
- Write to
- /tmp/mercury_request.json
- :
- {
- "recipientId"
- :
- "recipient-id"
- ,
- "amount"
- :
- 100.00
- ,
- "paymentMethod"
- :
- "ach"
- ,
- "idempotencyKey"
- :
- "unique-key-123"
- }
- Then run. Replace
- with the actual account ID:
- /tmp/mercury-curl
- -X
- POST
- "https://api.mercury.com/api/v1/account/
/send-money" - -d
- @/tmp/mercury_request.json
- Get Send Money Request Status
- Replace
- with the actual request ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/request-send-money/
" - Recipients
- List All Recipients
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/recipients"
- Get Recipient by ID
- Replace
- with the actual recipient ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/recipient/
" - Create Recipient
- Write to
- /tmp/mercury_request.json
- :
- {
- "name"
- :
- "Vendor Name"
- ,
- "emails"
- :
- [
- "vendor@example.com"
- ]
- ,
- "paymentMethod"
- :
- "ach"
- ,
- "electronicRoutingInfo"
- :
- {
- "accountNumber"
- :
- "123456789"
- ,
- "routingNumber"
- :
- "021000021"
- ,
- "bankName"
- :
- "Example Bank"
- ,
- "electronicAccountType"
- :
- "businessChecking"
- }
- }
- Then run:
- /tmp/mercury-curl
- -X
- POST
- "https://api.mercury.com/api/v1/recipients"
- -d
- @/tmp/mercury_request.json
- Statements
- List Account Statements
- Replace
- with the actual account ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
/statements" - Download Statement PDF
- Replace
- and
- with the actual IDs:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/account/
/statement/ /pdf" - >
- statement.pdf
- Organization
- Get Organization Info
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/organization"
- Treasury
- List Treasury Accounts
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/treasury"
- Get Treasury Account by ID
- Replace
- with the actual treasury ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/treasury/
" - List Treasury Transactions
- Replace
- with the actual treasury ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/treasury/
/transactions" - Users
- List Users
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/users"
- Credit
- List Credit Accounts
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/credit"
- Accounts Receivable
- List Customers
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/accounts-receivable/customers"
- Create Customer
- Write to
- /tmp/mercury_request.json
- :
- {
- "name"
- :
- "Customer Name"
- ,
- "email"
- :
- "customer@example.com"
- }
- Then run:
- /tmp/mercury-curl
- -X
- POST
- "https://api.mercury.com/api/v1/accounts-receivable/customers"
- -d
- @/tmp/mercury_request.json
- List Invoices
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/accounts-receivable/invoices"
- Create Invoice
- Write to
- /tmp/mercury_request.json
- :
- {
- "customerId"
- :
- "customer-id"
- ,
- "lineItems"
- :
- [
- {
- "description"
- :
- "Service"
- ,
- "amount"
- :
- 500.00
- }
- ]
- ,
- "dueDate"
- :
- "2024-12-31"
- }
- Then run:
- /tmp/mercury-curl
- -X
- POST
- "https://api.mercury.com/api/v1/accounts-receivable/invoices"
- -d
- @/tmp/mercury_request.json
- Download Invoice PDF
- Replace
- with the actual invoice ID:
- /tmp/mercury-curl
- "https://api.mercury.com/api/v1/accounts-receivable/invoice/
/pdf" - >
- invoice.pdf
- Guidelines
- Rate Limits
-
- Mercury may enforce rate limits; implement appropriate backoff strategies for high-volume operations
- Idempotency
-
- Use
- idempotencyKey
- for transfer operations to prevent duplicate transactions
- Security
-
- Never expose API tokens in logs or client-side code
- Amounts
-
- All monetary amounts are typically in USD and represented as decimal numbers
- Pagination
- For large result sets, use limit and offset parameters where supported API Reference Documentation: https://docs.mercury.com/reference/getaccount Dashboard: https://dashboard.mercury.com