Treasury
Record an incoming or outgoing payment
Records a payment in a treasury account.
treasury:writetreasury:write- 120/min
- Server annotation: Destructive
- Requires human confirmation
- Send your own idempotencyKey
Result
generated from the schema
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, 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.
Arguments
in for a collection from a customer, out for a payment to a supplier.
Available options: in, out
Amount as a decimal string, greater than zero.
Limits: pattern ^\d{1,13}(\.\d{1,2})?$
Currency in ISO 4217. Defaults to EUR.
Limits: min length 3, max length 3
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.
Payment method configured in the account.
Limits: min length 1
Treasury account through which the money comes in or goes out.
Limits: min length 1
"deposit" marks a security deposit collected from a customer: it requires direction=in (400 otherwise) and is not deducted from the order total.
Available options: normal, deposit
Customer or supplier of the payment.
Type of the document the payment is linked to. Goes with linkedDocumentId.
Available options: invoice, creditNote, supplierInvoice, quote, proforma, salesReceipt, simpleCreditNote, purchaseOrder
Document the payment is linked to. Goes with linkedDocumentType.
External reference of the payment.
Limits: max length 200
Notes. They are stored in Filmo and NOT returned.
Limits: max length 2000
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.
Limits: min length 1, max length 255
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.
Limits: min length 1
Result
On success the result carries structuredContent with data and meta. These are the attributes of data.
Show the attributes of data
Payment identifier.
in when money comes in (a collection) and out when it goes out (a payment).
Payment amount as a decimal string, in the indicated currency.
Limits: pattern ^-?\d+\.\d{2}$
Payment currency, as an ISO 4217 code.
Payment date in ISO 8601 UTC.
normal, or deposit when it is an advance payment.
Treasury account the payment goes through.
Customer or supplier of the payment; null if not declared.
External reference of the payment; null if it has none.
Documents the payment is assigned to; empty if it is not linked to any.
Show child attributesHide child attributes
Kind of the linked document.
Available options: invoice, creditNote, supplierInvoice, quote, proforma, salesReceipt, simpleCreditNote, purchaseOrder
Identifier of the linked document.
Amount of this payment assigned to the document, as a decimal string.
Limits: pattern ^-?\d+\.\d{2}$
Creation date in ISO 8601 UTC.
Last modification date in ISO 8601 UTC.
An error is a result with isError: true and the problem in content[0].; there is no structuredContent. See Errors.
The same operation by REST
This tool runs POST /api/v1/treasury/payments.
Related pages
Link to this section: Related pagesTreasury
Record an incoming or outgoing payment
Records a payment in a treasury account.
Guides
Safe writes
An assistant that can write can also write the wrong thing. Decide which tools need a person, retry without duplicating, and know what a write sets in motion.
Guides
Errors
A tool error is a result with
isError: trueand the problem in the first text block. Branch on itscode.
Was this page helpful?