*MCP › Reference › Finance › Treasury*

# Record an incoming or outgoing payment

> Records a payment in a treasury account.

> **Send your own idempotencyKey:** A retry without the same key duplicates the effect. Send your own `idempotencyKey` (a UUID) and resend the same one if you retry.

> **Requires human confirmation:** Put this tool on your client's “ask before running” list. The annotations are hints that the server declares, not guarantees: do not decide the approval from `destructiveHint` alone. The server flags this tool with `_meta["anthropic/requiresUserInteraction"]`, which clients that honor it use to ask a person before every call.

The document it is tied to goes as the PAIR `linkedDocumentType` + `linkedDocumentId`, never as one field per type: sending two identifiers at once would leave it unknown which one it was tied to. `type: "deposit"` marks a security deposit collected from a customer: it requires `direction: in` (400 on `direction` otherwise) and does not deduct from the order total. The date can be any time of today but not a later day, in the time zone of the account (400 on `date`). Send `Idempotency-Key`: a retry without it records the payment twice. Returns the full payment, the same projection as its GET.

TOOL `filmo_treasury_payments_create` · `treasury:write` · 120/min · Server annotation: Destructive · Requires human confirmation · Send your own idempotencyKey

## Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `direction` | string | Yes | in for a collection from a customer, out for a payment to a supplier. `in`, `out` |
| `amount` | string | Yes | Amount as a decimal string, greater than zero. |
| `currency` | string | No | Currency in ISO 4217. Defaults to EUR. |
| `date` | string<date-time> | Yes | Payment date, in ISO 8601 with offset. Any time of today is accepted; a later day, in the time zone of the account, is rejected with 400. |
| `paymentMethodId` | string | Yes | Payment method configured in the account. |
| `treasuryAccountId` | string | Yes | Treasury account through which the money comes in or goes out. |
| `type` | string | No | "deposit" marks a security deposit collected from a customer: it requires direction=in (400 otherwise) and is not deducted from the order total. `normal`, `deposit` |
| `contactId` | string | No | Customer or supplier of the payment. |
| `linkedDocumentType` | string | No | Type of the document the payment is linked to. Goes with `linkedDocumentId`. `invoice`, `creditNote`, `supplierInvoice`, `quote`, `proforma`, `salesReceipt`, `simpleCreditNote`, `purchaseOrder` |
| `linkedDocumentId` | string | No | Document the payment is linked to. Goes with `linkedDocumentType`. |
| `reference` | string | No | External reference of the payment. |
| `notes` | string | No | Notes. They are stored in Filmo and NOT returned. |
| `idempotencyKey` | string | No | Idempotency key chosen by the client (a UUID is recommended). Repeating the same key with the same arguments within 24 h returns the stored response without executing again; with different arguments it responds 422. It is the safe way to retry after a network failure. |
| `ifMatch` | string | No | Optimistic locking: the meta.etag you got from the detail read of this resource (or "*"). If the resource changed since, the call fails with 412 precondition_failed before writing anything; read it again and retry. Omit it to write unconditionally. |

## Result

On success the result carries `structuredContent` with `data` and `meta`. These are the attributes of `data`.

| Name | Type | Description |
| --- | --- | --- |
| `id` | string | Payment identifier. |
| `direction` | string | in when money comes in (a collection) and out when it goes out (a payment). |
| `amount` | string | Payment amount as a decimal string, in the indicated currency. |
| `currency` | string | Payment currency, as an ISO 4217 code. |
| `date` | string<date-time> | Payment date in ISO 8601 UTC. |
| `type` | string | normal, or deposit when it is an advance payment. |
| `treasuryAccountId` | string | Treasury account the payment goes through. |
| `contactId` | string | Customer or supplier of the payment; null if not declared. |
| `reference` | string | External reference of the payment; null if it has none. |
| `linkedDocuments` | object[] | Documents the payment is assigned to; empty if it is not linked to any. |
| `linkedDocuments.type` | string | Kind of the linked document. `invoice`, `creditNote`, `supplierInvoice`, `quote`, `proforma`, `salesReceipt`, `simpleCreditNote`, `purchaseOrder` |
| `linkedDocuments.id` | string | Identifier of the linked document. |
| `linkedDocuments.amount` | string | Amount of this payment assigned to the document, as a decimal string. |
| `createdAt` | string<date-time> | Creation date in ISO 8601 UTC. |
| `updatedAt` | string<date-time> | Last modification date in ISO 8601 UTC. |

*Call · filmo_treasury_payments_create*

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_treasury_payments_create",
    "arguments": {
      "direction": "in",
      "amount": "1234.50",
      "date": "2026-09-01T08:00:00Z",
      "paymentMethodId": "paym_8f2a1c",
      "treasuryAccountId": "trea_8f2a1c",
      "idempotencyKey": "<a UUID you generate>"
    }
  }
}
```

*Result (generated from the schema)*

```json
{
  "structuredContent": {
    "data": {
      "id": "id_8f2a1c",
      "direction": "<direction>",
      "amount": "1234.50",
      "currency": "EUR",
      "date": "2026-09-01T08:00:00Z",
      "type": "<type>",
      "treasuryAccountId": "trea_8f2a1c",
      "contactId": "cont_8f2a1c",
      "reference": "<reference>",
      "linkedDocuments": [
        {
          "type": "invoice",
          "id": "id_8f2a1c",
          "amount": "1234.50"
        }
      ],
      "createdAt": "2026-09-01T08:00:00Z",
      "updatedAt": "2026-09-01T08:00:00Z"
    },
    "meta": {
      "idempotencyKey": "<the key you sent, or the one the server generated>",
      "rateLimit": {
        "limit": 120,
        "remaining": 119,
        "reset": 42
      }
    }
  }
}
```

## The same operation by REST

This tool runs [`POST /api/v1/treasury/payments`](https://docs.filmo.io/rest-api/endpoint-reference/treasury/record-an-incoming-or-outgoing-payment).

---

Canonical URL: https://docs.filmo.io/mcp/tools/treasury/filmo-treasury-payments-create  
Last updated: 2026-10-25