# Mercury

> Read Mercury accounts and transactions, manage recipients and cards, send payments for approval, and raise invoices.

App · Accounting & Finance · 59 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/mercury

## Triggers

Start a workflow when something happens in Mercury. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### New Mercury transaction

Runs when a new transaction appears in Mercury. Optionally limit it to a single account.

**Filters**: Narrow which events start a run.

- `account_id`

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `id`: The transaction's ID.
- `accountId`: The Mercury account the transaction belongs to.
- `amount`: Amount in dollars - negative for debits, positive for credits.
- `status`: pending, sent, cancelled, failed, reversed or blocked.
- `kind`: What kind of transaction it is, for example externalTransfer.
- `counterpartyName`: Who the money went to or came from.
- `note`: Internal note, if one is set.
- `externalMemo`: Memo shown to the counterparty.
- `postedAt`: When the transaction posted.
- `createdAt`: When the transaction was created.
- `dashboardLink`: Link to the transaction in Mercury.

## Actions

### Attach file to Mercury transaction

Upload a receipt or supporting document to a transaction. Accepts a file upload or a document produced by an earlier step.

**Inputs**

- Transaction ID (`transaction_id`, text, required): The transaction to attach the file to.
- File (`file`, list, required): The receipt or document to attach.
- File name (`file_name`, text): Name to store the file under.

**Outputs**

- `fileName` (text)
- `id` (text): Attachment ID.
- `url` (text): Signed download URL for the stored file.

**Example output**

```json
{
  "fileName": "aws-september-receipt.pdf",
  "id": "att-3333-4eee-8fff-000000000003",
  "url": "https://mercury.com/attachments/signed-url"
}
```

### Cancel Mercury card

Permanently cancel a card. This cannot be undone - use Freeze Mercury card for a reversible block. Needs a read-and-write API token.

**Inputs**

- Card ID (`card_id`, text, required): The card to cancel permanently.

**Outputs**

- `id` (text)
- `status` (text): Becomes cancelled.

**Example output**

```json
{
  "id": "card-4444-4aaa-9bbb-000000000004",
  "status": "cancelled"
}
```

### Cancel Mercury invoice

Cancel an invoice so it can no longer be paid. This cannot be undone. Needs a read-and-write API token.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice to cancel.

**Outputs**

- `cancelled` (true/false): True when the call succeeded.
- `invoice_id` (text): The affected resource's ID.

**Example output**

```json
{
  "cancelled": true,
  "invoice_id": "inv-1717-4bbb-8ccc-000000000017"
}
```

### Create Mercury category

Create a custom expense category. Needs a read-and-write API token.

**Inputs**

- Name (`name`, text, required): Name of the new category, for example 'Cloud Infrastructure'.
- Offer for card spend (`visible_for_card_spend`, true/false): Offer this category on card transactions. Default is true. Default: `true`.
- Offer for reimbursements (`visible_for_reimbursements`, true/false): Offer this category on reimbursements. Default is true. Default: `true`.
- Offer for other transactions (`visible_for_other`, true/false): Offer this category on all other transactions. Default is true. Default: `true`.

**Outputs**

- `id` (text): Category ID. Use as category_id in Update Mercury transaction.
- `name` (text)

**Example output**

```json
{
  "id": "cat-ffff-4666-8777-00000000000f",
  "name": "Cloud Infrastructure"
}
```

### Create Mercury customer

Add a customer you can then invoice. Needs a read-and-write API token.

**Inputs**

- Name (`name`, text, required): Customer's name as it should appear on invoices.
- Email (`email`, text, required): Where Mercury sends their invoices.
- Address (`address`, object): Billing address, with fields line1, line2, city, region, postalCode and country.

**Outputs**

- `address` (object): Billing address, if set.
- `deletedAt` (text): Set once the customer has been deleted.
- `email` (text)
- `id` (text): Customer ID. Use as customer_id when creating an invoice.
- `name` (text)

**Example output**

```json
{
  "email": "ap@northwind.example",
  "id": "cust-1818-4ccc-8ddd-000000000018",
  "name": "Northwind Design LLC"
}
```

### Create Mercury invoice

Raise an invoice against a customer and have Mercury collect it. Needs a read-and-write API token.

**Inputs**

- Customer (`customer_id`, text, required): Who to invoice. Create one first with Create Mercury customer.
- Deposit into (`destination_account_id`, text, required): Account the payment should land in.
- Line items (`line_items`, list, required): The things being billed. Each item has name, quantity, unitPrice and optionally salesTaxRate.
- Due date (`due_date`, date, required): When payment is due.
- Invoice date (`invoice_date`, date): Date shown on the invoice - often when the work was done rather than today. Default is today.
- Invoice number (`invoice_number`, text): Your own invoice number. Mercury assigns one if omitted.
- Currency code (`currency_code`, text): ISO 4217 currency code, for example USD. Default: `USD`.
- CC emails (`cc_emails`, list): Additional addresses to copy on invoice notifications.
- Payer memo (`payer_memo`, text): Message shown to the payer on the invoice.
- Internal note (`internal_note`, text): Note visible to your team only, not to the payer.
- PO number (`po_number`, text): Purchase order number, if the customer requires one.
- Allow ACH debit (`ach_debit_enabled`, true/false): Let the customer pay by ACH debit. Default is false. Default: `false`.
- Allow card payment (`credit_card_enabled`, true/false): Let the customer pay by credit card. Default is false. Default: `false`.
- Show real account number (`use_real_account_number`, true/false): Show the deposit account's real account number on the invoice. Default is false. Default: `false`.

**Outputs**

- `amount` (number): Line-item total plus taxes, in dollars.
- `currencyCode` (text)
- `customerId` (text)
- `destinationAccountId` (text)
- `dueDate` (text): YYYY-MM-DD.
- `id` (text): Invoice ID.
- `internalNote` (text)
- `invoiceDate` (text): YYYY-MM-DD.
- `invoiceNumber` (text)
- `lineItems` (list)
- `payerMemo` (text)
- `slug` (text): Public slug used to build the pay-page and PDF URLs.
- `status` (text): Unpaid, Paid, Processing or Cancelled.

**Example output**

```json
{
  "amount": 4800.0,
  "dueDate": "2026-10-01",
  "id": "inv-1717-4bbb-8ccc-000000000017",
  "invoiceNumber": "2026-0042",
  "slug": "inv-northwind-0042",
  "status": "Unpaid"
}
```

### Create Mercury recipient

Add a payment recipient. Supply at least one set of routing details for the method you intend to pay by, or use Create Mercury recipient invite to have them fill it in. Needs a read-and-write API token.

**Inputs**

- Name (`name`, text, required): Recipient's legal or business name.
- Emails (`emails`, list, required): Email addresses Mercury notifies about payments.
- Contact email (`contact_email`, text): Primary contact email, if different from the above.
- Nickname (`nickname`, text): Short internal label for the recipient.
- ACH details (`electronic_routing_info`, object): Bank details for ACH payments, with fields: accountNumber, routingNumber, electronicAccountType (businessChecking, businessSavings, personalChecking or personalSavings), and the account holder's address: an address object (address1, optional address2, city, region, postalCode, country; for example US). All are required.
- Wire details (`domestic_wire_routing_info`, object): Bank details for domestic wires, with fields: accountNumber, routingNumber, and the account holder's address: an address object (address1, optional address2, city, region, postalCode, country; for example US). All are required.
- Check details (`check_info`, object): Mailing details for paper checks: an address object (address1, optional address2, city, region, postalCode, country; for example US), under the key address.

**Outputs**

- `checkInfo` (object)
- `dateLastPaid` (text)
- `defaultPaymentMethod` (text): ach, check, domesticWire, internationalWire or realTimePayment.
- `domesticWireRoutingInfo` (object)
- `electronicRoutingInfo` (object)
- `emails` (list)
- `id` (text): Recipient ID. Use as recipient_id when sending money.
- `name` (text)
- `nickname` (text)
- `status` (text): active or deleted.

**Example output**

```json
{
  "defaultPaymentMethod": "ach",
  "emails": [
    "ap@northwind.example"
  ],
  "id": "rcpt-bbbb-4222-8333-00000000000b",
  "name": "Northwind Design LLC",
  "status": "active"
}
```

### Create Mercury recipient invite

Invite someone to submit their own payment details, so you never handle their bank information. Pick an existing recipient to have them complete that record, or leave it empty to create a new one. Returns an onboarding link to share if you choose not to email the invite. Needs a read-and-write API token.

**Inputs**

- Email (`email`, text, required): Email address of the person being invited.
- Existing recipient (`recipient_id`, text): Invite an existing recipient to fill in their details. Leave empty to invite someone new.
- Name (`name`, text): Name of the person or business being invited.
- Payment methods (`payment_methods`, list): Ways the invitee may choose to be paid: ach, check, domesticWire, internationalWire or realTimePayment. Default is ach.
- Ask for a tax form (`require_tax_document`, true/false): Ask the invitee to upload a tax form. Default is false. Default: `false`.
- Email the invite (`send_email`, true/false): Have Mercury email the invite. Turn off to share the returned onboarding link yourself. Default is true. Default: `true`.

**Outputs**

- `contactEmail` (text)
- `expiresAt` (text)
- `id` (text): Invite ID.
- `onboardingUrl` (text): Link the invitee opens to enter their details.
- `paymentMethods` (list)
- `recipientId` (text)
- `requireTaxDocument` (true/false)
- `status` (text)

**Example output**

```json
{
  "contactEmail": "ap@northwind.example",
  "expiresAt": "2026-10-30T00:00:00Z",
  "id": "inv-eeee-4555-8666-00000000000e",
  "onboardingUrl": "https://app.mercury.com/invite/inv-eeee",
  "paymentMethods": [
    "ach"
  ],
  "recipientId": null,
  "requireTaxDocument": false,
  "status": "pending"
}
```

### Delete Mercury category

Delete a custom expense category. Needs a read-and-write API token.

**Inputs**

- Category (`category_id`, text, required): The category to delete.

**Outputs**

- `category_id` (text): The affected resource's ID.
- `deleted` (true/false): True when the call succeeded.

**Example output**

```json
{
  "category_id": "cat-ffff-4666-8777-00000000000f",
  "deleted": true
}
```

### Delete Mercury customer

Delete an invoicing customer. This cannot be undone. Needs a read-and-write API token.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer to delete.

**Outputs**

- `customer_id` (text): The affected resource's ID.
- `deleted` (true/false): True when the call succeeded.

**Example output**

```json
{
  "customer_id": "cust-1818-4ccc-8ddd-000000000018",
  "deleted": true
}
```

### Delete Mercury recipient

Delete a recipient. Mercury refuses if scheduled or pending payments still reference them. Needs a read-and-write API token.

**Inputs**

- Recipient (`recipient_id`, text, required): The recipient to delete.

**Outputs**

- `deleted` (true/false): True when the call succeeded.
- `recipient_id` (text): The affected resource's ID.

**Example output**

```json
{
  "deleted": true,
  "recipient_id": "rcpt-aaaa-4111-8222-00000000000a"
}
```

### Delete Mercury recipient invite

Revoke an outstanding recipient invite. Needs a read-and-write API token.

**Inputs**

- Invite ID (`invite_id`, text, required): The invite to revoke.

**Outputs**

- `deleted` (true/false): True when the call succeeded.
- `invite_id` (text): The affected resource's ID.

**Example output**

```json
{
  "deleted": true,
  "invite_id": "inv-eeee-4555-8666-00000000000e"
}
```

### Download Mercury invoice PDF

Fetch an invoice's PDF and report its size.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice whose PDF to download.

**Outputs**

- `content_type` (text): Always application/pdf.
- `invoice_id` (text): The requested resource's ID.
- `size_bytes` (number): Size of the downloaded PDF in bytes.

**Example output**

```json
{
  "content_type": "application/pdf",
  "invoice_id": "inv-1717-4bbb-8ccc-000000000017",
  "size_bytes": 22841
}
```

### Download Mercury SAFE document

Fetch the signed PDF for a SAFE request and report its size.

**Inputs**

- SAFE request (`safe_request_id`, text, required): The SAFE request whose document to download.

**Outputs**

- `content_type` (text): Always application/pdf.
- `safe_request_id` (text): The requested resource's ID.
- `size_bytes` (number): Size of the downloaded PDF in bytes.

**Example output**

```json
{
  "content_type": "application/pdf",
  "safe_request_id": "safe-1212-4ccc-8ddd-000000000012",
  "size_bytes": 91204
}
```

### Download Mercury statement PDF

Fetch a statement PDF and report its size. Use the statement's downloadUrl with an HTTP step if you need the file contents themselves.

**Inputs**

- Statement ID (`statement_id`, text, required): The statement to download.

**Outputs**

- `content_type` (text): Always application/pdf.
- `size_bytes` (number): Size of the downloaded PDF in bytes.
- `statement_id` (text): The requested resource's ID.

**Example output**

```json
{
  "content_type": "application/pdf",
  "size_bytes": 48211,
  "statement_id": "stmt-7777-4ddd-8eee-000000000007"
}
```

### Freeze Mercury card

Temporarily freeze an active card so it declines new charges. Reversible with Unfreeze Mercury card. Needs a read-and-write API token.

**Inputs**

- Card ID (`card_id`, text, required): The active card to freeze.

**Outputs**

- `id` (text)
- `status` (text): Becomes frozen.

**Example output**

```json
{
  "id": "card-4444-4aaa-9bbb-000000000004",
  "status": "frozen"
}
```

### Get Mercury account

Get one Mercury account's details and current balances.

**Inputs**

- Account (`account_id`, text, required): Which account to look up.

**Outputs**

- `accountNumber` (text)
- `availableBalance` (number): Spendable balance in dollars.
- `currentBalance` (number): Balance in dollars, including pending activity.
- `dashboardLink` (text)
- `id` (text): Account ID (UUID).
- `kind` (text): checking, savings, …
- `legalBusinessName` (text)
- `name` (text)
- `nickname` (text)
- `routingNumber` (text)
- `status` (text): active, deleted, pending, or archived.
- `type` (text): mercury, external, or recipient.

**Example output**

```json
{
  "availableBalance": 126100.0,
  "currentBalance": 128450.22,
  "id": "8f2c1d4e-1111-4aaa-9bbb-000000000001",
  "kind": "checking",
  "name": "Mercury Checking",
  "nickname": "Operating",
  "status": "active",
  "type": "mercury"
}
```

### Get Mercury card

Get one card's details, spend limits and category locks.

**Inputs**

- Card ID (`card_id`, text, required): The card to fetch. Use the id from List Mercury cards.

**Outputs**

- `accountId` (text)
- `categoryLocks` (list)
- `expiration` (object): {month, year}.
- `id` (text)
- `isAgentCard` (true/false)
- `kind` (text): debit or credit.
- `lastFour` (text)
- `nameOnCard` (text)
- `nickname` (text)
- `spendLimit` (object): {amountCents, interval} - amountCents is cents, not dollars.
- `status` (text): active, frozen, cancelled, inactive, expired or suspended.
- `type` (text): virtual or physical.
- `userId` (text)

**Example output**

```json
{
  "id": "card-4444-4aaa-9bbb-000000000004",
  "kind": "debit",
  "lastFour": "4242",
  "nickname": "AWS vendor card",
  "spendLimit": {
    "amountCents": 500000,
    "interval": "monthly"
  },
  "status": "active",
  "type": "virtual"
}
```

### Get Mercury customer

Get one invoicing customer's details.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer to fetch.

**Outputs**

- `address` (object): Billing address, if set.
- `deletedAt` (text): Set once the customer has been deleted.
- `email` (text)
- `id` (text): Customer ID. Use as customer_id when creating an invoice.
- `name` (text)

**Example output**

```json
{
  "email": "ap@northwind.example",
  "id": "cust-1818-4ccc-8ddd-000000000018",
  "name": "Northwind Design LLC"
}
```

### Get Mercury event

Get one change-log event, including its before and after values.

**Inputs**

- Event ID (`event_id`, text, required): The event to fetch.

**Outputs**

- `changedPaths` (list)
- `id` (text)
- `mergePatch` (object): The fields that changed, with their new values.
- `occurredAt` (text)
- `operationType` (text): create, update or delete.
- `previousValues` (object): The same fields with their prior values.
- `resourceId` (text)
- `resourceType` (text)
- `resourceVersion` (number)

**Example output**

```json
{
  "changedPaths": [
    "transaction.status"
  ],
  "id": "evt-1313-4ddd-8eee-000000000013",
  "mergePatch": {
    "status": "sent"
  },
  "operationType": "update",
  "previousValues": {
    "status": "pending"
  },
  "resourceType": "transaction"
}
```

### Get Mercury invoice

Get one invoice in full, including its line items.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice to fetch.

**Outputs**

- `amount` (number): Line-item total plus taxes, in dollars.
- `currencyCode` (text)
- `customerId` (text)
- `destinationAccountId` (text)
- `dueDate` (text): YYYY-MM-DD.
- `id` (text): Invoice ID.
- `internalNote` (text)
- `invoiceDate` (text): YYYY-MM-DD.
- `invoiceNumber` (text)
- `lineItems` (list)
- `payerMemo` (text)
- `slug` (text): Public slug used to build the pay-page and PDF URLs.
- `status` (text): Unpaid, Paid, Processing or Cancelled.

**Example output**

```json
{
  "amount": 4800.0,
  "dueDate": "2026-10-01",
  "id": "inv-1717-4bbb-8ccc-000000000017",
  "invoiceNumber": "2026-0042",
  "status": "Unpaid"
}
```

### Get Mercury invoice attachment

Get one invoice attachment's details and signed download URL.

**Inputs**

- Attachment ID (`attachment_id`, text, required): The attachment to fetch.

**Outputs**

- `fileName` (text)
- `id` (text)
- `url` (text): Signed URL for downloading the file.

**Example output**

```json
{
  "fileName": "statement-of-work.pdf",
  "id": "iatt-1919-4ddd-8eee-000000000019",
  "url": "https://mercury.com/attachments/signed-url"
}
```

### Get Mercury organization

Get the organization's legal business name, EIN and any DBAs - useful for filling invoices and compliance paperwork.

**Inputs**: None.

**Outputs**

- `organization` (object): Organization details including legalBusinessName, ein and dbas.

**Example output**

```json
{
  "organization": {
    "dbas": [
      "Lodol"
    ],
    "ein": "88-1234567",
    "legalBusinessName": "Lodol Technologies Inc."
  }
}
```

### Get Mercury payment approval request

Check whether one payment approval request has been approved yet.

**Inputs**

- Request ID (`request_id`, text, required): The approval request to check. Use the id returned by Request Mercury payment approval.

**Outputs**

- `amount` (number): Amount in dollars.
- `recipientId` (text)
- `requestId` (text)
- `status` (text): Where the request sits in the approval flow.

**Example output**

```json
{
  "amount": 2500.0,
  "requestId": "req-1414-4eee-8fff-000000000014",
  "status": "pending"
}
```

### Get Mercury recipient

Get one recipient's details, routing info and tax-form attachments.

**Inputs**

- Recipient (`recipient_id`, text, required): The recipient to fetch.

**Outputs**

- `checkInfo` (object)
- `dateLastPaid` (text)
- `defaultPaymentMethod` (text): ach, check, domesticWire, internationalWire or realTimePayment.
- `domesticWireRoutingInfo` (object)
- `electronicRoutingInfo` (object)
- `emails` (list)
- `id` (text): Recipient ID. Use as recipient_id when sending money.
- `name` (text)
- `nickname` (text)
- `status` (text): active or deleted.

**Example output**

```json
{
  "defaultPaymentMethod": "ach",
  "emails": [
    "ap@northwind.example"
  ],
  "id": "rcpt-aaaa-4111-8222-00000000000a",
  "name": "Northwind Design LLC",
  "status": "active"
}
```

### Get Mercury SAFE request

Get one SAFE request's full details.

**Inputs**

- SAFE request (`safe_request_id`, text, required): The SAFE request to fetch.

**Outputs**

- `amount` (number): Investment in dollars.
- `id` (text)
- `status` (text)
- `valuationType` (text): PreMoney, PostMoney or NoValuation.

**Example output**

```json
{
  "amount": 250000.0,
  "id": "safe-1212-4ccc-8ddd-000000000012",
  "status": "pending",
  "valuationType": "PostMoney"
}
```

### Get Mercury transaction

Get one transaction in full, including attachments, merchant details and any accounting-software GL allocations.

**Inputs**

- Transaction ID (`transaction_id`, text, required): The transaction to fetch. Use the id from List Mercury transactions.

**Outputs**

- `accountId` (text)
- `amount` (number): Dollars; negative for debits.
- `attachments` (list)
- `bankDescription` (text)
- `cardId` (text): Set on card payments and refunds only.
- `counterpartyName` (text)
- `counterpartyNickname` (text)
- `createdAt` (text)
- `dashboardLink` (text)
- `estimatedDeliveryDate` (text)
- `externalMemo` (text)
- `glAllocations` (list)
- `id` (text)
- `kind` (text)
- `merchant` (object): Card transactions only. amount here is the merchant currency's smallest unit (divide by 100 for most currencies, 1 for JPY, 1000 for BHD/KWD/OMR).
- `note` (text)
- `postedAt` (text)
- `status` (text)

**Example output**

```json
{
  "amount": -89.99,
  "attachments": [],
  "counterpartyName": "Amazon Web Services",
  "id": "1a2b3c4d-2222-4ccc-8ddd-000000000002",
  "kind": "debitCardTransaction",
  "status": "sent"
}
```

### Get Mercury user

Get one Mercury user's name, email and role.

**Inputs**

- User (`user_id`, text, required): The user to look up.

**Outputs**

- `email` (text)
- `firstName` (text)
- `lastName` (text)
- `organizationRole` (text): administrator, bookkeeper, customUser, cardOnlyUser or employee.
- `userId` (text)

**Example output**

```json
{
  "email": "alex@example.com",
  "firstName": "Alex",
  "lastName": "Rivera",
  "organizationRole": "administrator",
  "userId": "user-5555-4bbb-8ccc-000000000005"
}
```

### Issue Mercury virtual card

Issue a new virtual card to a user, optionally with a spend limit. Mercury only issues virtual cards through the API - order physical cards from the dashboard. Needs a read-and-write API token.

**Inputs**

- Cardholder (`user_id`, text, required): The Mercury user who will hold the card.
- Card type (`card_kind`, text, required): Whether to issue a debit or credit card. One of: `debit` (Debit (draws on an account)), `credit` (Credit (draws on your credit line)).
- Account (`account_id`, text): Account the card draws on. Required for debit cards.
- Nickname (`nickname`, text): Label for the card, for example 'AWS vendor card'.
- Spend limit (`spend_limit_amount`, number): Maximum spend per interval, in dollars. Leave empty for no card-level limit. At least 0.01.
- Limit resets (`spend_limit_interval`, text): How often the spend limit resets. One of: `daily` (Per day), `weekly` (Per week), `monthly` (Per month), `yearly` (Per year).

**Outputs**

- `id` (text): New card ID.
- `kind` (text)
- `lastFour` (text)
- `nickname` (text)
- `spendLimit` (object)
- `status` (text): Usually active.
- `type` (text): Always virtual.

**Example output**

```json
{
  "id": "card-6666-4ccc-8ddd-000000000006",
  "kind": "debit",
  "lastFour": "1881",
  "nickname": "AWS vendor card",
  "status": "active",
  "type": "virtual"
}
```

### List Mercury accounts

List every Mercury account - checking, savings and treasury - with current and available balances.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Mercury accounts. Each has id, name, nickname, accountNumber, routingNumber, currentBalance, availableBalance (all amounts in dollars), kind, type and status.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "accountNumber": "202212783812",
      "availableBalance": 126100.0,
      "currentBalance": 128450.22,
      "id": "8f2c1d4e-1111-4aaa-9bbb-000000000001",
      "kind": "checking",
      "name": "Mercury Checking",
      "nickname": "Operating",
      "routingNumber": "084106768",
      "status": "active",
      "type": "mercury"
    }
  ],
  "next_cursor": "8f2c1d4e-1111-4aaa-9bbb-000000000001"
}
```

### List Mercury cards

List corporate cards with their status, cardholder, last four digits and current spend limits.

**Inputs**

- Account (`account_id`, text): Only include cards on these accounts.
- Cardholder (`user_id`, text): Only include cards belonging to this user.
- Status (`status`, list): Only include cards in these states. One or more of: `active`, `frozen`, `cancelled`, `inactive`, `expired`, `suspended`.
- Agent cards only (`is_agent_card`, true/false): Limit to cards managed by Mercury's agentic spend agent.
- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Mercury cards. Each has id, accountId, userId, nameOnCard, nickname, lastFour, kind (debit/credit), type (virtual/physical), status, expiration, isAgentCard and spendLimit. spendLimit.amountCents is in cents, not dollars.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "accountId": "8f2c1d4e-1111-4aaa-9bbb-000000000001",
      "id": "card-4444-4aaa-9bbb-000000000004",
      "isAgentCard": false,
      "kind": "debit",
      "lastFour": "4242",
      "nameOnCard": "Alex Rivera",
      "nickname": "AWS vendor card",
      "spendLimit": {
        "amountCents": 500000,
        "interval": "monthly"
      },
      "status": "active",
      "type": "virtual",
      "userId": "user-5555-4bbb-8ccc-000000000005"
    }
  ],
  "next_cursor": "card-4444-4aaa-9bbb-000000000004"
}
```

### List Mercury categories

List the organization's custom expense categories, for tagging transactions.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Custom expense categories. Each has id and name.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "id": "cat-ffff-4666-8777-00000000000f",
      "name": "Cloud Infrastructure"
    }
  ],
  "next_cursor": "cat-ffff-4666-8777-00000000000f"
}
```

### List Mercury credit accounts

List the organization's Mercury credit accounts and their limits.

**Inputs**: None.

**Outputs**

- `items` (list): Credit accounts, each with id, balances and credit limit.

**Example output**

```json
{
  "items": [
    {
      "creditLimit": 100000.0,
      "currentBalance": 14200.0,
      "id": "cred-1111-4bbb-8ccc-000000000011",
      "status": "active"
    }
  ]
}
```

### List Mercury customers

List the customers you can invoice.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Invoicing customers. Each has id, name, email and an optional address.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "email": "ap@northwind.example",
      "id": "cust-1818-4ccc-8ddd-000000000018",
      "name": "Northwind Design LLC"
    }
  ],
  "next_cursor": "cust-1818-4ccc-8ddd-000000000018"
}
```

### List Mercury events

Read Mercury's change log for transactions and account balances. Each event records what changed, with before and after values - useful for reconciliation, backfills and audit trails.

**Inputs**

- Resource type (`resource_type`, text): Only include events about this kind of resource. One of: `transaction`, `checkingAccount` (Checking account), `savingsAccount` (Savings account), `treasuryAccount` (Treasury account), `investmentAccount` (Investment account), `creditAccount` (Credit account).
- Resource ID (`resource_id`, text): Only include events about one specific resource ID.
- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Events, oldest first by default. Each has id, resourceType, resourceId, operationType (create/update/delete), occurredAt, resourceVersion, changedPaths, mergePatch (new values) and previousValues.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "changedPaths": [],
      "id": "evt-1313-4ddd-8eee-000000000013",
      "occurredAt": "2026-09-10T14:01:58Z",
      "operationType": "create",
      "resourceId": "1a2b3c4d-2222-4ccc-8ddd-000000000002",
      "resourceType": "transaction",
      "resourceVersion": 1
    }
  ],
  "next_cursor": "evt-1313-4ddd-8eee-000000000013"
}
```

### List Mercury invoice attachments

List the files attached to an invoice.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice whose attachments to list.

**Outputs**

- `items` (list): Invoice attachments, each with id, fileName and a signed url.

**Example output**

```json
{
  "items": [
    {
      "fileName": "statement-of-work.pdf",
      "id": "iatt-1919-4ddd-8eee-000000000019",
      "url": "https://mercury.com/attachments/signed-url"
    }
  ]
}
```

### List Mercury invoices

List accounts-receivable invoices with their status, amount and customer.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Invoices. Each has id, invoiceNumber, amount (dollars), status, customerId, dueDate, lineItems and slug.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "amount": 4800.0,
      "customerId": "cust-1818-4ccc-8ddd-000000000018",
      "dueDate": "2026-10-01",
      "id": "inv-1717-4bbb-8ccc-000000000017",
      "invoiceNumber": "2026-0042",
      "status": "Unpaid"
    }
  ],
  "next_cursor": "inv-1717-4bbb-8ccc-000000000017"
}
```

### List Mercury payment approval requests

List payment requests awaiting approval, with their current status. Pair this with Request Mercury payment approval to track what is still pending.

**Inputs**

- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Send-money approval requests. Each has requestId, status, amount (dollars), recipientId and the requesting account.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "amount": 2500.0,
      "recipientId": "rcpt-aaaa-4111-8222-00000000000a",
      "requestId": "req-1414-4eee-8fff-000000000014",
      "status": "pending"
    }
  ],
  "next_cursor": "req-1414-4eee-8fff-000000000014"
}
```

### List Mercury recipient attachments

List recipient tax-form attachments (W-9, W-8BEN and similar) across the organization, or for one recipient.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Recipient attachments. Each has id, recipientId, fileName, formType, uploadedAt and a signed url.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "fileName": "northwind-w9.pdf",
      "formType": "W9",
      "id": "ratt-cccc-4333-8444-00000000000c",
      "recipientId": "rcpt-aaaa-4111-8222-00000000000a",
      "uploadedAt": "2026-02-14T09:30:00Z"
    }
  ],
  "next_cursor": "ratt-cccc-4333-8444-00000000000c"
}
```

### List Mercury recipient invites

List outstanding invites asking recipients for their payment details.

**Inputs**

- Status (`status`, text): Only include invites with this status.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Recipient invites. Each has id, recipientId, contactEmail, onboardingUrl and status.

**Example output**

```json
{
  "items": [
    {
      "contactEmail": "ap@northwind.example",
      "id": "inv-eeee-4555-8666-00000000000e",
      "onboardingUrl": "https://app.mercury.com/invite/inv-eeee",
      "status": "pending"
    }
  ]
}
```

### List Mercury recipients

List saved payment recipients with their default payment method and routing details.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Recipients. Each has id, name, nickname, emails, status, defaultPaymentMethod and whichever routing-info objects are configured.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "defaultPaymentMethod": "ach",
      "emails": [
        "ap@northwind.example"
      ],
      "id": "rcpt-aaaa-4111-8222-00000000000a",
      "name": "Northwind Design LLC",
      "nickname": "Northwind",
      "status": "active"
    }
  ],
  "next_cursor": "rcpt-aaaa-4111-8222-00000000000a"
}
```

### List Mercury SAFE requests

List SAFE (Simple Agreement for Future Equity) requests raised through Mercury, with investor and valuation details.

**Inputs**: None.

**Outputs**

- `items` (list): SAFE requests, each with id, investor details, amount, valuation type and status.

**Example output**

```json
{
  "items": [
    {
      "amount": 250000.0,
      "id": "safe-1212-4ccc-8ddd-000000000012",
      "status": "pending",
      "valuationType": "PostMoney"
    }
  ]
}
```

### List Mercury statements

List an account's monthly statements, each with a download URL and opening/closing balances.

**Inputs**

- Account (`account_id`, text, required): Which account's statements to list.
- From (`start`, date): Only include statements ending on or after this date.
- To (`end`, date): Only include statements ending on or before this date.
- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Monthly statements. Each has id, accountNumber, startDate, endDate, startingBalance, endingBalance and downloadUrl.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "accountNumber": "202212783812",
      "downloadUrl": "https://mercury.com/statements/signed-url",
      "endDate": "2026-08-31",
      "endingBalance": 128450.22,
      "id": "stmt-7777-4ddd-8eee-000000000007",
      "startDate": "2026-08-01",
      "startingBalance": 98220.14
    }
  ],
  "next_cursor": "stmt-7777-4ddd-8eee-000000000007"
}
```

### List Mercury transactions

List transactions across every account, with filters for account, card, status, category, free-text search and date range. This is the main way to pull Mercury activity into a workflow.

**Inputs**

- Account (`account_id`, text): Only include transactions on these accounts. Leave empty for all.
- Status (`status`, list): Only include transactions with these statuses. One or more of: `pending`, `sent`, `cancelled`, `failed`, `reversed`, `blocked`.
- Category (`category_id`, text): Only include transactions in this custom category.
- Search (`search`, text): Free-text search over counterparty name and description.
- Created from (`start`, date): Only include transactions created on or after this date.
- Created to (`end`, date): Only include transactions created on or before this date.
- Posted from (`posted_start`, date): Only include transactions that posted on or after this date.
- Posted to (`posted_end`, date): Only include transactions that posted on or before this date.
- Card ID (`card_id`, list): Only include transactions made on these card IDs.
- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Mercury transactions. Each has id, accountId, amount (dollars; negative for debits), status, kind, counterpartyName, note, externalMemo, postedAt, createdAt, categoryData, and merchant for card transactions. Note merchant.amount is in the merchant currency's smallest unit, unlike the top-level amount.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "accountId": "8f2c1d4e-1111-4aaa-9bbb-000000000001",
      "amount": -89.99,
      "counterpartyName": "Amazon Web Services",
      "createdAt": "2026-09-10T14:01:58Z",
      "id": "1a2b3c4d-2222-4ccc-8ddd-000000000002",
      "kind": "debitCardTransaction",
      "note": null,
      "postedAt": "2026-09-10T14:02:11Z",
      "status": "sent"
    }
  ],
  "next_cursor": "1a2b3c4d-2222-4ccc-8ddd-000000000002"
}
```

### List Mercury treasury accounts

List treasury accounts with balances and net returns, for tracking yield on idle cash.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Treasury accounts. Each has id, currentBalance, availableBalance, netReturns, status and createdAt. Amounts are in dollars.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "availableBalance": 750000.0,
      "currentBalance": 750000.0,
      "id": "treas-9999-4fff-8aaa-000000000009",
      "netReturns": 9842.17,
      "status": "active"
    }
  ],
  "next_cursor": "treas-9999-4fff-8aaa-000000000009"
}
```

### List Mercury treasury statements

List statements for a treasury account.

**Inputs**

- Treasury account (`treasury_id`, text, required): The treasury account. Use the id from List Mercury treasury accounts.
- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Treasury statements. Each has id, accountId, description, creationDate and a download URL.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "accountId": "treas-9999-4fff-8aaa-000000000009",
      "creationDate": "2026-09-01",
      "description": "August 2026 treasury statement",
      "id": "tstmt-8888-4eee-8fff-000000000008"
    }
  ],
  "next_cursor": "tstmt-8888-4eee-8fff-000000000008"
}
```

### List Mercury treasury transactions

List the activity on a treasury account.

**Inputs**

- Treasury account (`treasury_id`, text, required): Which treasury account's transactions to list. Use the id from List Mercury treasury accounts.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Treasury transactions. Each has id, amount (dollars), description and settlement dates. next_cursor here is Mercury's own cursor token rather than a row id.
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "amount": 1204.55,
      "description": "Treasury yield - August",
      "id": "ttxn-1010-4aaa-8bbb-000000000010"
    }
  ],
  "next_cursor": ""
}
```

### List Mercury users

List the people on the Mercury account with their roles. Use this to find a userId before issuing a card.

**Inputs**

- Order (`order`, text): Sort direction for the results. One of: `desc` (Newest first), `asc` (Oldest first).
- Continue after (`start_after`, text): To get the next page, enter the next_cursor value from the previous run.
- Limit (`limit`, number): How many results to return, up to 500. Default is 50. From 1 to 500. Default: `50`.

**Outputs**

- `items` (list): Mercury users. Each has userId, firstName, lastName, email and organizationRole (administrator, bookkeeper, customUser, cardOnlyUser or employee).
- `next_cursor` (text): Pass as start_after on the next run to continue after this page. Empty when there are no more results.

**Example output**

```json
{
  "items": [
    {
      "email": "alex@example.com",
      "firstName": "Alex",
      "lastName": "Rivera",
      "organizationRole": "administrator",
      "userId": "user-5555-4bbb-8ccc-000000000005"
    }
  ],
  "next_cursor": "user-5555-4bbb-8ccc-000000000005"
}
```

### Request Mercury payment approval

Create a payment request that follows your organization's own Mercury approval rules instead of sending money immediately. Prefer this over Send Mercury money in automated workflows: a person still approves the payment in Mercury before any funds move. Needs a read-and-write API token from an allowlisted IP.

**Inputs**

- Account (`account_id`, text, required): Account the payment would come from.
- Recipient (`recipient_id`, text, required): Who to pay. Recipients are managed in Mercury or with Create Mercury recipient.
- Amount (`amount`, number, required): Amount in dollars, for example 250.75. At least 0.01.
- Payment method (`payment_method`, text, required): How to send the money. One of: `ach` (ACH (free, 1-3 business days)), `domesticWire` (Domestic wire (same day, fee applies)), `check` (Paper check (mailed)).
- Note (`note`, text): Internal note, visible only to your team in Mercury.
- External memo (`external_memo`, text): Memo the recipient sees on their statement.
- Payment purpose (`purpose_category`, text): What the payment is for. Mercury uses this for reporting. One of: `vendor`, `contractor`, `employee`, `landlord`, `subsidiary`.
- Purpose details (`purpose_additional_info`, text): Extra context for the payment purpose.

**Outputs**

- `accountId` (text)
- `amount` (number): Amount in dollars.
- `numberOfApproversRequired` (number)
- `paymentMethod` (text)
- `recipientId` (text)
- `requestId` (text): Approval request ID. Use as request_id.
- `requesterMayApprove` (true/false)
- `status` (text): pendingApproval until reviewed.

**Example output**

```json
{
  "amount": 2500.0,
  "counterpartyName": "Northwind Design LLC",
  "requestId": "req-1414-4eee-8fff-000000000014",
  "status": "pending"
}
```

### Send Mercury money

Send an ACH, domestic wire or paper check to a saved recipient. This moves money immediately, subject to Mercury's own approval settings - use Request Mercury payment approval if you want a person in the loop. Needs a read-and-write API token from an allowlisted IP.

**Inputs**

- Account (`account_id`, text, required): Account the money comes from.
- Recipient (`recipient_id`, text, required): Who to pay. Recipients are managed in Mercury or with Create Mercury recipient.
- Amount (`amount`, number, required): Amount in dollars, for example 250.75. At least 0.01.
- Payment method (`payment_method`, text, required): How to send the money. One of: `ach` (ACH (free, 1-3 business days)), `domesticWire` (Domestic wire (same day, fee applies)), `check` (Paper check (mailed)).
- Note (`note`, text): Internal note, visible only to your team in Mercury.
- External memo (`external_memo`, text): Memo the recipient sees on their statement.
- Payment purpose (`purpose_category`, text): What the payment is for. Mercury uses this for reporting. One of: `vendor`, `contractor`, `employee`, `landlord`, `subsidiary`.
- Purpose details (`purpose_additional_info`, text): Extra context for the payment purpose.

**Outputs**

- `amount` (number): Amount in dollars (decimal, not cents).
- `counterpartyName` (text): Who was paid.
- `dashboardLink` (text): Link to this payment in the Mercury dashboard.
- `estimatedDeliveryDate` (text): RFC 3339 timestamp of expected settlement.
- `id` (text): Transaction or request ID.
- `status` (text): pending, sent, cancelled, failed, reversed, or blocked.

**Example output**

```json
{
  "amount": 2500.0,
  "counterpartyName": "Northwind Design LLC",
  "estimatedDeliveryDate": "2026-09-16T00:00:00Z",
  "id": "txn-1515-4fff-8aaa-000000000015",
  "status": "pending"
}
```

### Transfer between Mercury accounts

Move money between two accounts in the same Mercury organization, for example sweeping checking into savings. Needs a read-and-write API token from an allowlisted IP.

**Inputs**

- From account (`source_account_id`, text, required): Account to move money out of.
- To account (`destination_account_id`, text, required): Account to move money into.
- Amount (`amount`, number, required): Amount in dollars, for example 10000.00. At least 0.01.
- Note (`note`, text): Internal note describing the transfer.

**Outputs**

- `creditTransaction` (object): The transaction putting the money into the destination account (positive amount, in dollars).
- `debitTransaction` (object): The transaction taking the money out of the source account (negative amount, in dollars).

**Example output**

```json
{
  "creditTransaction": {
    "accountId": "acct-2222-4aaa-8bbb-000000000002",
    "amount": 10000.0,
    "id": "xfer-1717-4aaa-8bbb-000000000017",
    "status": "sent"
  },
  "debitTransaction": {
    "accountId": "acct-1111-4aaa-8bbb-000000000001",
    "amount": -10000.0,
    "id": "xfer-1616-4aaa-8bbb-000000000016",
    "status": "sent"
  }
}
```

### Unfreeze Mercury card

Return a frozen card to active so it accepts charges again. Needs a read-and-write API token.

**Inputs**

- Card ID (`card_id`, text, required): The frozen card to reactivate.

**Outputs**

- `id` (text)
- `status` (text): Becomes active.

**Example output**

```json
{
  "id": "card-4444-4aaa-9bbb-000000000004",
  "status": "active"
}
```

### Update Mercury card

Rename a card or change its spend limit. Leave the nickname empty to keep the current one. Needs a read-and-write API token.

**Inputs**

- Card ID (`card_id`, text, required): The card to update.
- Nickname (`nickname`, text): New label for the card.
- Spend limit (`spend_limit_amount`, number): New maximum spend per interval, in dollars. At least 0.01.
- Limit resets (`spend_limit_interval`, text): How often the spend limit resets. Required when setting a limit. One of: `daily` (Per day), `weekly` (Per week), `monthly` (Per month), `yearly` (Per year).

**Outputs**

- `id` (text)
- `lastFour` (text)
- `nickname` (text)
- `spendLimit` (object)
- `status` (text)

**Example output**

```json
{
  "id": "card-4444-4aaa-9bbb-000000000004",
  "lastFour": "4242",
  "nickname": "AWS production card",
  "status": "active"
}
```

### Update Mercury category

Rename a custom expense category. Needs a read-and-write API token.

**Inputs**

- Category (`category_id`, text, required): The category to rename.
- Name (`name`, text, required): New name for the category.

**Outputs**

- `id` (text)
- `name` (text)

**Example output**

```json
{
  "id": "cat-ffff-4666-8777-00000000000f",
  "name": "Cloud & Hosting"
}
```

### Update Mercury customer

Change a customer's name, email or billing address. Fields you leave empty keep their current values. Needs a read-and-write API token.

**Inputs**

- Customer ID (`customer_id`, text, required): The customer to update.
- Name (`name`, text): New name.
- Email (`email`, text): New email address.
- Address (`address`, object): New billing address object.
- Re-send open invoices (`resend_open_invoices`, true/false): Email the customer's unpaid invoices again with the new details. Default is false. Default: `false`.

**Outputs**

- `address` (object): Billing address, if set.
- `deletedAt` (text): Set once the customer has been deleted.
- `email` (text)
- `id` (text): Customer ID. Use as customer_id when creating an invoice.
- `name` (text)

**Example output**

```json
{
  "email": "ap@northwind.example",
  "id": "cust-1818-4ccc-8ddd-000000000018",
  "name": "Northwind Design Ltd"
}
```

### Update Mercury invoice

Change an invoice's line items, dates or memos before it is paid. Needs a read-and-write API token.

**Inputs**

- Invoice ID (`invoice_id`, text, required): The invoice to update.
- Line items (`line_items`, list): Replacement line items. Each has name, quantity, unitPrice and optionally salesTaxRate.
- Due date (`due_date`, date): New due date.
- Invoice date (`invoice_date`, date): New invoice date.
- CC emails (`cc_emails`, list): Replacement list of addresses to copy.
- Payer memo (`payer_memo`, text): New message for the payer.
- Internal note (`internal_note`, text): New internal note.
- PO number (`po_number`, text): New purchase order number.
- Allow ACH debit (`ach_debit_enabled`, true/false): Let the customer pay by ACH debit. Leave empty to keep the current setting.
- Allow card payment (`credit_card_enabled`, true/false): Let the customer pay by credit card. Leave empty to keep the current setting.
- Show real account number (`use_real_account_number`, true/false): Show the deposit account's real account number on the invoice. Leave empty to keep the current setting.

**Outputs**

- `amount` (number): Line-item total plus taxes, in dollars.
- `currencyCode` (text)
- `customerId` (text)
- `destinationAccountId` (text)
- `dueDate` (text): YYYY-MM-DD.
- `id` (text): Invoice ID.
- `internalNote` (text)
- `invoiceDate` (text): YYYY-MM-DD.
- `invoiceNumber` (text)
- `lineItems` (list)
- `payerMemo` (text)
- `slug` (text): Public slug used to build the pay-page and PDF URLs.
- `status` (text): Unpaid, Paid, Processing or Cancelled.

**Example output**

```json
{
  "amount": 5200.0,
  "id": "inv-1717-4bbb-8ccc-000000000017",
  "invoiceNumber": "2026-0042",
  "status": "Unpaid"
}
```

### Update Mercury recipient

Change a recipient's name, emails or routing details. Needs a read-and-write API token.

**Inputs**

- Recipient (`recipient_id`, text, required): The recipient to update.
- Name (`name`, text): New legal or business name.
- Emails (`emails`, list): Replacement list of notification emails.
- Contact email (`contact_email`, text): New primary contact email.
- Nickname (`nickname`, text): New internal label.
- ACH details (`electronic_routing_info`, object): Bank details for ACH payments, with fields: accountNumber, routingNumber, electronicAccountType (businessChecking, businessSavings, personalChecking or personalSavings), and the account holder's address: an address object (address1, optional address2, city, region, postalCode, country; for example US). All are required.
- Wire details (`domestic_wire_routing_info`, object): Bank details for domestic wires, with fields: accountNumber, routingNumber, and the account holder's address: an address object (address1, optional address2, city, region, postalCode, country; for example US). All are required.
- Check details (`check_info`, object): Mailing details for paper checks: an address object (address1, optional address2, city, region, postalCode, country; for example US), under the key address.

**Outputs**

- `checkInfo` (object)
- `dateLastPaid` (text)
- `defaultPaymentMethod` (text): ach, check, domesticWire, internationalWire or realTimePayment.
- `domesticWireRoutingInfo` (object)
- `electronicRoutingInfo` (object)
- `emails` (list)
- `id` (text): Recipient ID. Use as recipient_id when sending money.
- `name` (text)
- `nickname` (text)
- `status` (text): active or deleted.

**Example output**

```json
{
  "id": "rcpt-aaaa-4111-8222-00000000000a",
  "name": "Northwind Design LLC",
  "status": "active"
}
```

### Update Mercury transaction

Set or clear a transaction's internal note and custom category. Leave a field empty to clear it.

**Inputs**

- Transaction ID (`transaction_id`, text, required): The transaction to update.
- Note (`note`, text): Internal note, visible to your team in Mercury. Leave empty to clear the existing note.
- Category (`category_id`, text): Custom expense category to assign. Leave empty to clear it.

**Outputs**

- `categoryData` (object): The category now assigned, if any.
- `id` (text)
- `note` (text): The note now stored.

**Example output**

```json
{
  "id": "1a2b3c4d-2222-4ccc-8ddd-000000000002",
  "note": "Reconciled against September AWS invoice"
}
```

### Upload Mercury recipient tax form

Upload a tax form for a recipient. Needs a read-and-write API token.

**Inputs**

- Recipient (`recipient_id`, text, required): The recipient the form belongs to.
- File (`file`, list, required): The tax form to upload.
- File name (`file_name`, text): Name to store the form under.

**Outputs**

- `fileName` (text)
- `formType` (text)
- `id` (text)
- `recipientId` (text)
- `url` (text)

**Example output**

```json
{
  "fileName": "northwind-w9.pdf",
  "formType": "W9",
  "id": "ratt-dddd-4444-8555-00000000000d",
  "recipientId": "rcpt-aaaa-4111-8222-00000000000a"
}
```
