Affirm · Capability

Affirm Promos API — Promos

Affirm Promos API — Promos. 1 operations. Lead operation: Affirm Get Promotional Messaging. Self-contained Naftiko capability covering one Affirm business surface.

Run with Naftiko AffirmPromos

What You Can Do

GET
Getpromo — Affirm Get Promotional Messaging
/v1

MCP Tools

affirm-get-promotional-messaging

Affirm Get Promotional Messaging

read-only idempotent

Capability Spec

promos-promos.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Affirm Promos API — Promos
  description: 'Affirm Promos API — Promos. 1 operations. Lead operation: Affirm Get Promotional Messaging. Self-contained
    Naftiko capability covering one Affirm business surface.'
  tags:
  - Affirm
  - Promos
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    AFFIRM_API_KEY: AFFIRM_API_KEY
capability:
  consumes:
  - type: http
    namespace: promos-promos
    baseUri: https://www.affirm.com/api/promos/v2/{public_api_key}
    description: Affirm Promos API — Promos business capability. Self-contained, no shared references.
    resources:
    - name: root
      path: /
      operations:
      - name: getpromo
        method: GET
        description: Affirm Get Promotional Messaging
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: amount
          in: query
          type: integer
          description: Purchase amount in the smallest currency unit (e.g., cents for USD or CAD). The API uses this to calculate
            available financing terms and monthly payment messagi
          required: true
        - name: page_type
          in: query
          type: string
          description: The type of page on which the promotional messaging will be displayed. Controls which financing messaging
            template is returned.
        - name: template_field
          in: query
          type: string
          description: Locale identifier controlling the language and currency of the returned promotional content.
        - name: field
          in: query
          type: string
          description: Specifies which content fields to include in the response. Use "ala" for as-low-as messaging only,
            "modal" for modal content only, or "all" for both.
        - name: use_best_terms
          in: query
          type: boolean
          description: When true, returns the most favorable available financing terms for the given amount rather than the
            default program terms.
        - name: show_cta
          in: query
          type: boolean
          description: When true, includes a call-to-action element in the modal content response.
        - name: items
          in: query
          type: string
          description: Stringified JSON array of item objects to enable item-level financing evaluation. Each item should
            include sku, display_name, qty, and unit_price fields.
  exposes:
  - type: rest
    namespace: promos-promos-rest
    port: 8080
    description: REST adapter for Affirm Promos API — Promos. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1
      name: root
      description: REST surface for root.
      operations:
      - method: GET
        name: getpromo
        description: Affirm Get Promotional Messaging
        call: promos-promos.getpromo
        with:
          amount: rest.amount
          page_type: rest.page_type
          template_field: rest.template_field
          field: rest.field
          use_best_terms: rest.use_best_terms
          show_cta: rest.show_cta
          items: rest.items
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: promos-promos-mcp
    port: 9090
    transport: http
    description: MCP adapter for Affirm Promos API — Promos. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: affirm-get-promotional-messaging
      description: Affirm Get Promotional Messaging
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: promos-promos.getpromo
      with:
        amount: tools.amount
        page_type: tools.page_type
        template_field: tools.template_field
        field: tools.field
        use_best_terms: tools.use_best_terms
        show_cta: tools.show_cta
        items: tools.items
      outputParameters:
      - type: object
        mapping: $.