← 返回
开发者工具 Key 中文

Mercury Payments

Pay invoices via Mercury Bank API. Use when sending ACH or wire payments through Mercury, creating recipients, querying transactions, or managing payment wor...
通过Mercury Bank API支付发票。适用于通过Mercury发送ACH或电汇付款、创建收款人、查询交易或管理支付流程等场景。
nathan-deepmm
开发者工具 clawhub v1.0.1 2 版本 100000 Key: 需要
★ 0
Stars
📥 1,180
下载
💾 10
安装
2
版本
#latest

概述

Mercury Payments Skill

Overview

Pay invoices via Mercury bank API, notify Zeni (bookkeeper) and the vendor, and always attach the invoice PDF.

Prerequisites

  • Mercury API token (write access): $MERCURY_API_TOKEN or pass show
  • Auth: Authorization: Bearer (Basic auth also works: token: base64)
  • Base URL: https://api.mercury.com/api/v1

Accounts

Discover account IDs dynamically (do not hardcode organization-specific IDs):

curl -s -H "Authorization: Bearer $TOKEN" "https://api.mercury.com/api/v1/accounts"

Default payment account should be confirmed at payment time.

Known Recipients

Keep recipient IDs in your own secure records or resolve by recipient name at runtime.

Payment Flow

1. Get explicit approval

NEVER send money without explicit approval from the authorized operator. Present: amount, recipient, invoice #, account.

2. Download the invoice PDF

Find the invoice email, download the attachment to /tmp/.

3. Check for existing recipient

curl -s -H "Authorization: Bearer $TOKEN" "https://api.mercury.com/api/v1/recipients" | python3 -c "..."

4. Create recipient if needed

curl -s -X POST "https://api.mercury.com/api/v1/recipients" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "...",
    "emails": ["..."],
    "defaultPaymentMethod": "ach",
    "electronicRoutingInfo": {
      "accountNumber": "...",
      "routingNumber": "...",
      "electronicAccountType": "businessChecking",
      "address": { "address1": "...", "city": "...", "region": "...", "postalCode": "...", "country": "US" }
    },
    "defaultAddress": { ... }
  }'

5. Send payment

ACH payment:

curl -s -X POST "https://api.mercury.com/api/v1/account/{accountId}/transactions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "recipientId": "...",
    "amount": 533.13,
    "paymentMethod": "ach",
    "note": "INV123 - Vendor - Period",
    "idempotencyKey": "unique-key-here"
  }'

Domestic wire payment:

curl -s -X POST "https://api.mercury.com/api/v1/account/{accountId}/transactions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "recipientId": "...",
    "amount": 1080.00,
    "paymentMethod": "domesticWire",
    "purpose": {"simple": {"category": "vendor", "additionalInfo": "Invoice TRC37332 TRACE Data"}},
    "note": "INV-001 - Vendor - Jan 2026",
    "idempotencyKey": "unique-key-here"
  }'

Wire purpose is required. Format: {"simple": {"category": "", "additionalInfo": ""}}

Categories: employee, landlord, vendor, contractor, subsidiary, transferToMyExternalAccount, familyMemberOrFriend, forGoodsOrServices, angelInvestment, savingsOrInvestments, expenses, travel, other

6. Email bookkeeper (always)

Send to your bookkeeping inbox (e.g., bookkeeping@example.com) with:

  • Subject: Invoice — Paid
  • Body: amount, method, estimated delivery
  • Attach the invoice PDF

7. Email vendor (always)

Reply in the existing email thread if possible. Include:

  • Confirmation of payment with amount
  • Attach the invoice PDF
  • Estimated delivery date

Internal Transfers (Between Mercury Accounts)

curl -s -X POST "https://api.mercury.com/api/v1/transfer" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceAccountId": "YOUR_SOURCE_ACCOUNT_ID",
    "destinationAccountId": "YOUR_DESTINATION_ACCOUNT_ID",
    "amount": 465.00,
    "idempotencyKey": "unique-key-here"
  }'

Required fields: sourceAccountId, destinationAccountId, amount, idempotencyKey.

Transfers post instantly. Response contains both creditTransaction and debitTransaction.

Querying Transactions

# Recent (default ~30 days)
curl -s -H "Authorization: Bearer $TOKEN" "https://api.mercury.com/api/v1/account/{id}/transactions?limit=500"

# Date range (goes further back)
curl -s -H "Authorization: Bearer $TOKEN" "https://api.mercury.com/api/v1/account/{id}/transactions?start=2025-12-01&end=2026-01-18&limit=500"

Note: Without date params, API only returns ~30 days. Use start/end to go further back.

Idempotency Keys

Use descriptive keys: {vendor}-{invoice}-{period} (e.g., finra-trc37332-nov2025)

Checklist

  • [ ] Explicit approval received from authorized operator
  • [ ] Invoice PDF downloaded
  • [ ] Recipient exists (or created)
  • [ ] Payment sent with correct amount, method, and note
  • [ ] Zeni emailed with invoice attached
  • [ ] Vendor emailed with invoice attached
  • [ ] Payment logged in daily memory file

版本历史

共 2 个版本

  • v1.0.1 当前
    2026-03-29 06:28 安全 安全
  • v1.0.0
    2026-03-07 01:48

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,615
productivity

Church Account

nathan-deepmm
当前输入涉及敏感信息,让我们换个话题,看看有什么新的内容可以讨论。
★ 0 📥 962
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,945