Affirm · Capability

Affirm Direct API — Authorization

Affirm Direct API — Authorization. 3 operations. Lead operation: Affirm Upload a File. Self-contained Naftiko capability covering one Affirm business surface.

Run with Naftiko AffirmAuthorization

What You Can Do

POST
Uploadfile — Affirm Upload a File
/v1/files
GET
Downloadfile — Affirm Download a File
/v1/files/{id}
POST
Authorizedirecttransaction — Affirm Authorize a Transaction
/v1/transactions

MCP Tools

affirm-upload-file

Affirm Upload a File

affirm-download-file

Affirm Download a File

read-only idempotent
affirm-authorize-transaction

Affirm Authorize a Transaction

Capability Spec

direct-authorization.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Affirm Direct API — Authorization
  description: 'Affirm Direct API — Authorization. 3 operations. Lead operation: Affirm Upload a File. Self-contained Naftiko
    capability covering one Affirm business surface.'
  tags:
  - Affirm
  - Authorization
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    AFFIRM_API_KEY: AFFIRM_API_KEY
capability:
  consumes:
  - type: http
    namespace: direct-authorization
    baseUri: https://api.affirm.com/api/v1
    description: Affirm Direct API — Authorization business capability. Self-contained, no shared references.
    resources:
    - name: files
      path: /files
      operations:
      - name: uploadfile
        method: POST
        description: Affirm Upload a File
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: files-id
      path: /files/{id}
      operations:
      - name: downloadfile
        method: GET
        description: Affirm Download a File
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: The unique identifier of the file to download.
          required: true
    - name: transactions
      path: /transactions
      operations:
      - name: authorizedirecttransaction
        method: POST
        description: Affirm Authorize a Transaction
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: basic
      username: '{{env.AFFIRM_USER}}'
      password: '{{env.AFFIRM_PASS}}'
  exposes:
  - type: rest
    namespace: direct-authorization-rest
    port: 8080
    description: REST adapter for Affirm Direct API — Authorization. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/files
      name: files
      description: REST surface for files.
      operations:
      - method: POST
        name: uploadfile
        description: Affirm Upload a File
        call: direct-authorization.uploadfile
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/files/{id}
      name: files-id
      description: REST surface for files-id.
      operations:
      - method: GET
        name: downloadfile
        description: Affirm Download a File
        call: direct-authorization.downloadfile
        with:
          id: rest.id
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/transactions
      name: transactions
      description: REST surface for transactions.
      operations:
      - method: POST
        name: authorizedirecttransaction
        description: Affirm Authorize a Transaction
        call: direct-authorization.authorizedirecttransaction
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: direct-authorization-mcp
    port: 9090
    transport: http
    description: MCP adapter for Affirm Direct API — Authorization. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: affirm-upload-file
      description: Affirm Upload a File
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: direct-authorization.uploadfile
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: affirm-download-file
      description: Affirm Download a File
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: direct-authorization.downloadfile
      with:
        id: tools.id
      outputParameters:
      - type: object
        mapping: $.
    - name: affirm-authorize-transaction
      description: Affirm Authorize a Transaction
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: direct-authorization.authorizedirecttransaction
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.