Sage · Capability

Sage Accounting API — Purchase Invoices

Sage Accounting API — Purchase Invoices. 3 operations. Lead operation: List Purchase Invoices. Self-contained Naftiko capability covering one Sage business surface.

Run with Naftiko SagePurchase Invoices

What You Can Do

GET
Listpurchaseinvoices — List Purchase Invoices
/v1/purchase-invoices
POST
Createpurchaseinvoice — Create Purchase Invoice
/v1/purchase-invoices
GET
Getpurchaseinvoice — Get Purchase Invoice
/v1/purchase-invoices/{key}

MCP Tools

list-purchase-invoices

List Purchase Invoices

read-only idempotent
create-purchase-invoice

Create Purchase Invoice

get-purchase-invoice

Get Purchase Invoice

read-only idempotent

Capability Spec

accounting-purchase-invoices.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sage Accounting API — Purchase Invoices
  description: 'Sage Accounting API — Purchase Invoices. 3 operations. Lead operation: List Purchase Invoices. Self-contained
    Naftiko capability covering one Sage business surface.'
  tags:
  - Sage
  - Purchase Invoices
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SAGE_API_KEY: SAGE_API_KEY
capability:
  consumes:
  - type: http
    namespace: accounting-purchase-invoices
    baseUri: https://api.accounting.sage.com/v3.1
    description: Sage Accounting API — Purchase Invoices business capability. Self-contained, no shared references.
    resources:
    - name: purchase_invoices
      path: /purchase_invoices
      operations:
      - name: listpurchaseinvoices
        method: GET
        description: List Purchase Invoices
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: contact_id
          in: query
          type: string
        - name: status_id
          in: query
          type: string
        - name: page
          in: query
          type: integer
        - name: items_per_page
          in: query
          type: integer
      - name: createpurchaseinvoice
        method: POST
        description: Create Purchase Invoice
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: purchase_invoices-key
      path: /purchase_invoices/{key}
      operations:
      - name: getpurchaseinvoice
        method: GET
        description: Get Purchase Invoice
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: key
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.SAGE_API_KEY}}'
  exposes:
  - type: rest
    namespace: accounting-purchase-invoices-rest
    port: 8080
    description: REST adapter for Sage Accounting API — Purchase Invoices. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/purchase-invoices
      name: purchase-invoices
      description: REST surface for purchase_invoices.
      operations:
      - method: GET
        name: listpurchaseinvoices
        description: List Purchase Invoices
        call: accounting-purchase-invoices.listpurchaseinvoices
        with:
          contact_id: rest.contact_id
          status_id: rest.status_id
          page: rest.page
          items_per_page: rest.items_per_page
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createpurchaseinvoice
        description: Create Purchase Invoice
        call: accounting-purchase-invoices.createpurchaseinvoice
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/purchase-invoices/{key}
      name: purchase-invoices-key
      description: REST surface for purchase_invoices-key.
      operations:
      - method: GET
        name: getpurchaseinvoice
        description: Get Purchase Invoice
        call: accounting-purchase-invoices.getpurchaseinvoice
        with:
          key: rest.key
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: accounting-purchase-invoices-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sage Accounting API — Purchase Invoices. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: list-purchase-invoices
      description: List Purchase Invoices
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: accounting-purchase-invoices.listpurchaseinvoices
      with:
        contact_id: tools.contact_id
        status_id: tools.status_id
        page: tools.page
        items_per_page: tools.items_per_page
      outputParameters:
      - type: object
        mapping: $.
    - name: create-purchase-invoice
      description: Create Purchase Invoice
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: accounting-purchase-invoices.createpurchaseinvoice
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-purchase-invoice
      description: Get Purchase Invoice
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: accounting-purchase-invoices.getpurchaseinvoice
      with:
        key: tools.key
      outputParameters:
      - type: object
        mapping: $.