Treasury

Update a payment

Corrects an already recorded payment or marks it as reconciled with the bank statement.

Tool
filmo_treasury_payments_update
Access: Write

Result

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_treasury_payments_update",
    "arguments": {
      "paymentId": "paym_8f2a1c"
    }
  }
}

generated from the schema

reconciled and notes are accepted and not returned: they are state of the internal accounting process. The date follows the rule of the creation: any time of today, not a later day in the time zone of the account (400 on date). A new amount moves the assignment only when the whole payment was assigned to a single document or order; on any other payment only the unassigned part changes, so the documents keep what they had collected, and an amount below what is already assigned responds 409 conflict without writing. A refunded deposit, and the refund itself, keep their amount and direction: changing either responds 409 conflict and nothing is written. If the documents linked to the payment keep changing while it is saved, it also responds 409 conflict, nothing is written and the call can be retried. Returns the full payment, the same projection as its GET.

Arguments

paymentIdstringRequired

Treasury payment identifier.

Limits: min length 1

directionstring

New direction of the payment.

Available options: in, out

amountstring

New amount as a decimal string, greater than zero. If the whole payment is assigned to a single document or order, the assignment follows the new amount. Otherwise what is assigned stays as it is and only the unassigned part changes; an amount below what is already assigned responds 409 conflict.

Limits: pattern ^\d{1,13}(\.\d{1,2})?$

datestring<date-time>

New 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.

paymentMethodIdstring | null

New payment method; null removes it.

contactIdstring | null

New contact; null unlinks it.

referencestring | null

New external reference; null clears it.

Limits: max length 200

notesstring

New notes. NOT returned.

Limits: max length 2000

reconciledboolean

Marks the payment as reconciled with the bank statement.

idempotencyKeystring

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

ifMatchstring

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
idstring

Payment identifier.

directionstring

in when money comes in (a collection) and out when it goes out (a payment).

amountstring

Payment amount as a decimal string, in the indicated currency.

Limits: pattern ^-?\d+\.\d{2}$

currencystring

Payment currency, as an ISO 4217 code.

datestring<date-time>

Payment date in ISO 8601 UTC.

typestring

normal, or deposit when it is an advance payment.

treasuryAccountIdstring

Treasury account the payment goes through.

contactIdstring | null

Customer or supplier of the payment; null if not declared.

referencestring | null

External reference of the payment; null if it has none.

linkedDocumentsobject[]

Documents the payment is assigned to; empty if it is not linked to any.

Show child attributes
linkedDocuments.typestring

Kind of the linked document.

Available options: invoice, creditNote, supplierInvoice, quote, proforma, salesReceipt, simpleCreditNote, purchaseOrder

linkedDocuments.idstring

Identifier of the linked document.

linkedDocuments.amountstring

Amount of this payment assigned to the document, as a decimal string.

Limits: pattern ^-?\d+\.\d{2}$

createdAtstring<date-time>

Creation date in ISO 8601 UTC.

updatedAtstring<date-time>

Last modification date in ISO 8601 UTC.

An error is a result with isError: true and the problem in content[0].text; there is no structuredContent. See Errors.

The same operation by REST

This tool runs PATCH /api/v1/treasury/payments/{paymentId}.

  • Treasury

    Update a payment

    Corrects an already recorded payment or marks it as reconciled with the bank statement.

  • 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: true and the problem in the first text block. Branch on its code.