Modern Treasury · Capability

Modern Treasury — PaymentOrder

Modern Treasury — PaymentOrder. 6 operations. Lead operation: add payment_order_id to invoice. Self-contained Naftiko capability covering one Modern Treasury business surface.

Run with Naftiko Modern TreasuryPaymentOrder

What You Can Do

PUT
Addpaymentordertoinvoice — add payment_order_id to invoice
/v1/api/invoices/{id}/payment-orders/{payment-order-id}
GET
Listpaymentorders — list payment orders
/v1/api/payment-orders
POST
Createpaymentorder — create payment order
/v1/api/payment-orders
POST
Createasyncpaymentorder — create async payment order
/v1/api/payment-orders/create-async
GET
Getpaymentorder — get payment order
/v1/api/payment-orders/{id}
PATCH
Updatepaymentorder — update payment order
/v1/api/payment-orders/{id}

MCP Tools

add-payment-order-id-invoice

add payment_order_id to invoice

idempotent
list-payment-orders

list payment orders

read-only idempotent
create-payment-order

create payment order

create-async-payment-order

create async payment order

get-payment-order

get payment order

read-only idempotent
update-payment-order

update payment order

idempotent

Capability Spec

modern-treasury-paymentorder.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Modern Treasury — PaymentOrder
  description: 'Modern Treasury — PaymentOrder. 6 operations. Lead operation: add payment_order_id to invoice. Self-contained
    Naftiko capability covering one Modern Treasury business surface.'
  tags:
  - Modern Treasury
  - PaymentOrder
  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-paymentorder
    baseUri: http://localhost:3000
    description: Modern Treasury — PaymentOrder business capability. Self-contained, no shared references.
    resources:
    - name: api-invoices-id-payment_orders-payment_order_id
      path: /api/invoices/{id}/payment_orders/{payment_order_id}
      operations:
      - name: addpaymentordertoinvoice
        method: PUT
        description: add payment_order_id to invoice
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: api-payment_orders
      path: /api/payment_orders
      operations:
      - name: listpaymentorders
        method: GET
        description: list payment orders
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: after_cursor
          in: query
          type: string
        - name: per_page
          in: query
          type: integer
        - name: type
          in: query
          type: string
        - name: priority
          in: query
          type: string
          description: Either `normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer,
            respectively. For check payments, `high` can mean an over
        - name: counterparty_id
          in: query
          type: string
        - name: originating_account_id
          in: query
          type: string
        - name: transaction_id
          in: query
          type: string
          description: The ID of a transaction that the payment order has been reconciled to.
        - name: external_id
          in: query
          type: string
        - name: status
          in: query
          type: string
        - name: direction
          in: query
          type: string
        - name: reference_number
          in: query
          type: string
          description: Query for records with the provided reference number
        - name: effective_date_start
          in: query
          type: string
          description: An inclusive lower bound for searching effective_date
        - name: effective_date_end
          in: query
          type: string
          description: An inclusive upper bound for searching effective_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: process_after_start
          in: query
          type: string
          description: An inclusive lower bound for searching process_after
        - name: process_after_end
          in: query
          type: string
          description: An inclusive upper bound for searching process_after
      - name: createpaymentorder
        method: POST
        description: create payment order
        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-payment_orders-create_async
      path: /api/payment_orders/create_async
      operations:
      - name: createasyncpaymentorder
        method: POST
        description: create async payment order
        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-payment_orders-id
      path: /api/payment_orders/{id}
      operations:
      - name: getpaymentorder
        method: GET
        description: get payment order
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatepaymentorder
        method: PATCH
        description: update payment order
        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-paymentorder-rest
    port: 8080
    description: REST adapter for Modern Treasury — PaymentOrder. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/api/invoices/{id}/payment-orders/{payment-order-id}
      name: api-invoices-id-payment-orders-payment-order-id
      description: REST surface for api-invoices-id-payment_orders-payment_order_id.
      operations:
      - method: PUT
        name: addpaymentordertoinvoice
        description: add payment_order_id to invoice
        call: modern-treasury-paymentorder.addpaymentordertoinvoice
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/payment-orders
      name: api-payment-orders
      description: REST surface for api-payment_orders.
      operations:
      - method: GET
        name: listpaymentorders
        description: list payment orders
        call: modern-treasury-paymentorder.listpaymentorders
        with:
          after_cursor: rest.after_cursor
          per_page: rest.per_page
          type: rest.type
          priority: rest.priority
          counterparty_id: rest.counterparty_id
          originating_account_id: rest.originating_account_id
          transaction_id: rest.transaction_id
          external_id: rest.external_id
          status: rest.status
          direction: rest.direction
          reference_number: rest.reference_number
          effective_date_start: rest.effective_date_start
          effective_date_end: rest.effective_date_end
          created_at_start: rest.created_at_start
          created_at_end: rest.created_at_end
          process_after_start: rest.process_after_start
          process_after_end: rest.process_after_end
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createpaymentorder
        description: create payment order
        call: modern-treasury-paymentorder.createpaymentorder
        with:
          Idempotency-Key: rest.Idempotency-Key
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/payment-orders/create-async
      name: api-payment-orders-create-async
      description: REST surface for api-payment_orders-create_async.
      operations:
      - method: POST
        name: createasyncpaymentorder
        description: create async payment order
        call: modern-treasury-paymentorder.createasyncpaymentorder
        with:
          Idempotency-Key: rest.Idempotency-Key
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/payment-orders/{id}
      name: api-payment-orders-id
      description: REST surface for api-payment_orders-id.
      operations:
      - method: GET
        name: getpaymentorder
        description: get payment order
        call: modern-treasury-paymentorder.getpaymentorder
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updatepaymentorder
        description: update payment order
        call: modern-treasury-paymentorder.updatepaymentorder
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: modern-treasury-paymentorder-mcp
    port: 9090
    transport: http
    description: MCP adapter for Modern Treasury — PaymentOrder. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: add-payment-order-id-invoice
      description: add payment_order_id to invoice
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: modern-treasury-paymentorder.addpaymentordertoinvoice
      outputParameters:
      - type: object
        mapping: $.
    - name: list-payment-orders
      description: list payment orders
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: modern-treasury-paymentorder.listpaymentorders
      with:
        after_cursor: tools.after_cursor
        per_page: tools.per_page
        type: tools.type
        priority: tools.priority
        counterparty_id: tools.counterparty_id
        originating_account_id: tools.originating_account_id
        transaction_id: tools.transaction_id
        external_id: tools.external_id
        status: tools.status
        direction: tools.direction
        reference_number: tools.reference_number
        effective_date_start: tools.effective_date_start
        effective_date_end: tools.effective_date_end
        created_at_start: tools.created_at_start
        created_at_end: tools.created_at_end
        process_after_start: tools.process_after_start
        process_after_end: tools.process_after_end
      outputParameters:
      - type: object
        mapping: $.
    - name: create-payment-order
      description: create payment order
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: modern-treasury-paymentorder.createpaymentorder
      with:
        Idempotency-Key: tools.Idempotency-Key
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: create-async-payment-order
      description: create async payment order
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: modern-treasury-paymentorder.createasyncpaymentorder
      with:
        Idempotency-Key: tools.Idempotency-Key
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-payment-order
      description: get payment order
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: modern-treasury-paymentorder.getpaymentorder
      outputParameters:
      - type: object
        mapping: $.
    - name: update-payment-order
      description: update payment order
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: modern-treasury-paymentorder.updatepaymentorder
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.