Modern Treasury · Capability

Modern Treasury — Invoice

Modern Treasury — Invoice. 4 operations. Lead operation: list invoices. Self-contained Naftiko capability covering one Modern Treasury business surface.

Run with Naftiko Modern TreasuryInvoice

What You Can Do

GET
Listinvoices — list invoices
/v1/api/invoices
POST
Createinvoice — create invoice
/v1/api/invoices
GET
Getinvoice — get invoice
/v1/api/invoices/{id}
PATCH
Updateinvoice — update invoice
/v1/api/invoices/{id}

MCP Tools

list-invoices

list invoices

read-only idempotent
create-invoice

create invoice

get-invoice

get invoice

read-only idempotent
update-invoice

update invoice

idempotent

Capability Spec

modern-treasury-invoice.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Modern Treasury — Invoice
  description: 'Modern Treasury — Invoice. 4 operations. Lead operation: list invoices. Self-contained Naftiko capability
    covering one Modern Treasury business surface.'
  tags:
  - Modern Treasury
  - Invoice
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MODERN_TREASURY_API_KEY: MODERN_TREASURY_API_KEY
capability:
  consumes:
  - type: http
    namespace: modern-treasury-invoice
    baseUri: http://localhost:3000
    description: Modern Treasury — Invoice business capability. Self-contained, no shared references.
    resources:
    - name: api-invoices
      path: /api/invoices
      operations:
      - name: listinvoices
        method: GET
        description: list invoices
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: after_cursor
          in: query
          type: string
        - name: per_page
          in: query
          type: integer
        - name: counterparty_id
          in: query
          type: string
        - name: originating_account_id
          in: query
          type: string
        - name: payment_order_id
          in: query
          type: string
        - name: expected_payment_id
          in: query
          type: string
        - name: status
          in: query
          type: string
        - name: number
          in: query
          type: string
          description: A unique record number assigned to each invoice that is issued.
        - name: due_date_start
          in: query
          type: string
          description: An inclusive lower bound for searching due_date
        - name: due_date_end
          in: query
          type: string
          description: An inclusive upper bound for searching due_date
        - name: created_at_start
          in: query
          type: string
          description: An inclusive lower bound for searching created_at
        - name: created_at_end
          in: query
          type: string
          description: An inclusive upper bound for searching created_at
      - name: createinvoice
        method: POST
        description: create invoice
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: Idempotency-Key
          in: header
          type: string
          description: This key should be something unique, preferably something like an UUID.
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-invoices-id
      path: /api/invoices/{id}
      operations:
      - name: getinvoice
        method: GET
        description: get invoice
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updateinvoice
        method: PATCH
        description: update invoice
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: basic
      username: '{{env.MODERN_TREASURY_USER}}'
      password: '{{env.MODERN_TREASURY_PASS}}'
  exposes:
  - type: rest
    namespace: modern-treasury-invoice-rest
    port: 8080
    description: REST adapter for Modern Treasury — Invoice. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/invoices
      name: api-invoices
      description: REST surface for api-invoices.
      operations:
      - method: GET
        name: listinvoices
        description: list invoices
        call: modern-treasury-invoice.listinvoices
        with:
          after_cursor: rest.after_cursor
          per_page: rest.per_page
          counterparty_id: rest.counterparty_id
          originating_account_id: rest.originating_account_id
          payment_order_id: rest.payment_order_id
          expected_payment_id: rest.expected_payment_id
          status: rest.status
          number: rest.number
          due_date_start: rest.due_date_start
          due_date_end: rest.due_date_end
          created_at_start: rest.created_at_start
          created_at_end: rest.created_at_end
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createinvoice
        description: create invoice
        call: modern-treasury-invoice.createinvoice
        with:
          Idempotency-Key: rest.Idempotency-Key
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/invoices/{id}
      name: api-invoices-id
      description: REST surface for api-invoices-id.
      operations:
      - method: GET
        name: getinvoice
        description: get invoice
        call: modern-treasury-invoice.getinvoice
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updateinvoice
        description: update invoice
        call: modern-treasury-invoice.updateinvoice
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: modern-treasury-invoice-mcp
    port: 9090
    transport: http
    description: MCP adapter for Modern Treasury — Invoice. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-invoices
      description: list invoices
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: modern-treasury-invoice.listinvoices
      with:
        after_cursor: tools.after_cursor
        per_page: tools.per_page
        counterparty_id: tools.counterparty_id
        originating_account_id: tools.originating_account_id
        payment_order_id: tools.payment_order_id
        expected_payment_id: tools.expected_payment_id
        status: tools.status
        number: tools.number
        due_date_start: tools.due_date_start
        due_date_end: tools.due_date_end
        created_at_start: tools.created_at_start
        created_at_end: tools.created_at_end
      outputParameters:
      - type: object
        mapping: $.
    - name: create-invoice
      description: create invoice
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: modern-treasury-invoice.createinvoice
      with:
        Idempotency-Key: tools.Idempotency-Key
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-invoice
      description: get invoice
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: modern-treasury-invoice.getinvoice
      outputParameters:
      - type: object
        mapping: $.
    - name: update-invoice
      description: update invoice
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: modern-treasury-invoice.updateinvoice
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.