Avalara · Capability

Avalara E-Invoicing REST API — Documents

Avalara E-Invoicing REST API — Documents. 4 operations. Lead operation: Avalara Submit an E-invoice Document. Self-contained Naftiko capability covering one Avalara business surface.

Run with Naftiko AvalaraDocuments

What You Can Do

POST
Submitdocument — Avalara Submit an E-invoice Document
/v1/documents
GET
Listdocuments — Avalara List Submitted Documents
/v1/documents
GET
Getdocument — Avalara Retrieve a Document by ID
/v1/documents/{documentid}
GET
Getdocumentstatus — Avalara Get Document Processing Status
/v1/documents/{documentid}/status

MCP Tools

avalara-submit-e-invoice-document

Avalara Submit an E-invoice Document

avalara-list-submitted-documents

Avalara List Submitted Documents

read-only idempotent
avalara-retrieve-document-id

Avalara Retrieve a Document by ID

read-only idempotent
avalara-get-document-processing-status

Avalara Get Document Processing Status

read-only idempotent

Capability Spec

e-invoicing-documents.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Avalara E-Invoicing REST API — Documents
  description: 'Avalara E-Invoicing REST API — Documents. 4 operations. Lead operation: Avalara Submit an E-invoice Document.
    Self-contained Naftiko capability covering one Avalara business surface.'
  tags:
  - Avalara
  - Documents
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    AVALARA_API_KEY: AVALARA_API_KEY
capability:
  consumes:
  - type: http
    namespace: e-invoicing-documents
    baseUri: https://api.avalara.com/einvoicing/v1
    description: Avalara E-Invoicing REST API — Documents business capability. Self-contained, no shared references.
    resources:
    - name: documents
      path: /documents
      operations:
      - name: submitdocument
        method: POST
        description: Avalara Submit an E-invoice Document
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: avalara-version
          in: header
          type: string
          description: API version header
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: listdocuments
        method: GET
        description: Avalara List Submitted Documents
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: avalara-version
          in: header
          type: string
          required: true
        - name: status
          in: query
          type: string
        - name: startDate
          in: query
          type: string
        - name: endDate
          in: query
          type: string
        - name: flow
          in: query
          type: string
          description: Document flow direction (outbound or inbound)
        - name: count
          in: query
          type: boolean
          description: Include total count in response
        - name: $top
          in: query
          type: integer
        - name: $skip
          in: query
          type: integer
    - name: documents-documentId
      path: /documents/{documentId}
      operations:
      - name: getdocument
        method: GET
        description: Avalara Retrieve a Document by ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: avalara-version
          in: header
          type: string
          required: true
        - name: documentId
          in: path
          type: string
          required: true
    - name: documents-documentId-status
      path: /documents/{documentId}/status
      operations:
      - name: getdocumentstatus
        method: GET
        description: Avalara Get Document Processing Status
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: avalara-version
          in: header
          type: string
          required: true
        - name: documentId
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.AVALARA_API_KEY}}'
  exposes:
  - type: rest
    namespace: e-invoicing-documents-rest
    port: 8080
    description: REST adapter for Avalara E-Invoicing REST API — Documents. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/documents
      name: documents
      description: REST surface for documents.
      operations:
      - method: POST
        name: submitdocument
        description: Avalara Submit an E-invoice Document
        call: e-invoicing-documents.submitdocument
        with:
          avalara-version: rest.avalara-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: listdocuments
        description: Avalara List Submitted Documents
        call: e-invoicing-documents.listdocuments
        with:
          avalara-version: rest.avalara-version
          status: rest.status
          startDate: rest.startDate
          endDate: rest.endDate
          flow: rest.flow
          count: rest.count
          $top: rest.$top
          $skip: rest.$skip
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/documents/{documentid}
      name: documents-documentid
      description: REST surface for documents-documentId.
      operations:
      - method: GET
        name: getdocument
        description: Avalara Retrieve a Document by ID
        call: e-invoicing-documents.getdocument
        with:
          avalara-version: rest.avalara-version
          documentId: rest.documentId
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/documents/{documentid}/status
      name: documents-documentid-status
      description: REST surface for documents-documentId-status.
      operations:
      - method: GET
        name: getdocumentstatus
        description: Avalara Get Document Processing Status
        call: e-invoicing-documents.getdocumentstatus
        with:
          avalara-version: rest.avalara-version
          documentId: rest.documentId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: e-invoicing-documents-mcp
    port: 9090
    transport: http
    description: MCP adapter for Avalara E-Invoicing REST API — Documents. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: avalara-submit-e-invoice-document
      description: Avalara Submit an E-invoice Document
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: e-invoicing-documents.submitdocument
      with:
        avalara-version: tools.avalara-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: avalara-list-submitted-documents
      description: Avalara List Submitted Documents
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: e-invoicing-documents.listdocuments
      with:
        avalara-version: tools.avalara-version
        status: tools.status
        startDate: tools.startDate
        endDate: tools.endDate
        flow: tools.flow
        count: tools.count
        $top: tools.$top
        $skip: tools.$skip
      outputParameters:
      - type: object
        mapping: $.
    - name: avalara-retrieve-document-id
      description: Avalara Retrieve a Document by ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: e-invoicing-documents.getdocument
      with:
        avalara-version: tools.avalara-version
        documentId: tools.documentId
      outputParameters:
      - type: object
        mapping: $.
    - name: avalara-get-document-processing-status
      description: Avalara Get Document Processing Status
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: e-invoicing-documents.getdocumentstatus
      with:
        avalara-version: tools.avalara-version
        documentId: tools.documentId
      outputParameters:
      - type: object
        mapping: $.