Treasury

Link a payment to a document

Ties an already recorded payment to the invoice, credit note, quote, proforma or purchase order it settles.

Tool
filmo_treasury_payments_link
Access: Write

Result

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "filmo_treasury_payments_link",
    "arguments": {
      "paymentId": "paym_8f2a1c",
      "linkedDocumentType": "invoice",
      "linkedDocumentId": "https://example.com"
    }
  }
}

generated from the schema

It is a plural sub-resource because a payment can end up tied to several documents. Returns the full payment, with linkedDocuments as they now stand, the same projection as its GET.

Arguments

paymentIdstringRequired

Treasury payment identifier.

Limits: min length 1

linkedDocumentTypestringRequired

Type of the document the payment is linked to.

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

linkedDocumentIdstringRequired

Document the payment is linked to.

Limits: min length 1

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 POST /api/v1/treasury/payments/{paymentId}/links.

  • Treasury

    Link a payment to a document

    Ties an already recorded payment to the invoice, credit note, quote, proforma or purchase order it settles.

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