AiFinPay Admin API

admin-api router — see backend/routes/admin-api.js

Operations 15

GET /admin/api/overview GET /admin/api/overview #
GET /admin/api/merchants GET /admin/api/merchants #
GET /admin/api/merchants/{id} GET /admin/api/merchants/:id #
GET /admin/api/quote-conversion GET /admin/api/quote-conversion #
GET /admin/api/agents GET /admin/api/agents #
GET /admin/api/agents/{addr} GET /admin/api/agents/:addr #
GET /admin/api/transactions GET /admin/api/transactions #
GET /admin/api/marketplace GET /admin/api/marketplace #
POST /admin/api/marketplace/{id}/approve POST /admin/api/marketplace/:id/approve #
POST /admin/api/marketplace/{id}/reject POST /admin/api/marketplace/:id/reject #
GET /admin/api/users GET /admin/api/users #
GET /admin/api/users/{id} GET /admin/api/users/:id #
POST /admin/api/users/{id}/reset-2fa POST /admin/api/users/:id/reset-2fa #
GET /admin/api/audit GET /admin/api/audit #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/aifinpay-io:aifinpay-io-admin-api-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

aifinpay-io-admin-api-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AiFinPay Admin API
  version: 5.3.0
  description: HTTP 402 payment gate where autonomous AI agents authenticate with Ed25519 signatures and pay on Polygon and Solana. This document is generated from backend/routes/*.js — do not hand-edit. Regenerate with `node backend/scripts/build-openapi.mjs`.
servers:
- url: https://api.aifinpay.io
  description: Production (api)
- url: https://bridge.aifinpay.io
  description: Production (bridge)
tags:
- name: admin_api
  description: admin-api router — see backend/routes/admin-api.js
paths:
  /admin/api/overview:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/overview
      operationId: get_admin_api_overview
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/merchants:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/merchants
      operationId: get_admin_api_merchants
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/merchants/{id}:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/merchants/:id
      operationId: get_admin_api_merchants_id
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          description: Server-issued identifier
  /admin/api/quote-conversion:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/quote-conversion
      operationId: get_admin_api_quote-conversion
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                - network_mode
                - days
                - from
                - to
                - limit
                - merchants_with_quotes
                - merchants
                properties:
                  network_mode:
                    type: string
                    const: live
                  days:
                    type: integer
                    enum:
                    - 7
                    - 30
                  from:
                    type: string
                    format: date-time
                  to:
                    type: string
                    format: date-time
                  limit:
                    type: integer
                    minimum: 0
                    description: The most merchants returned.
                  merchants_with_quotes:
                    type: integer
                    minimum: 0
                    description: Merchants with a live quote in the window, before the limit.
                  merchants:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      required:
                      - merchant_id
                      - name
                      - site_url
                      - quotes_issued
                      - quotes_paid
                      - payers_quoted
                      - payers_paid
                      - quotes_without_payer
                      - expired_unpaid
                      - refused_unpaid
                      - last_quote_at
                      - site_verified
                      properties:
                        merchant_id:
                          type: string
                        name:
                          type:
                          - string
                          - 'null'
                        site_url:
                          type:
                          - string
                          - 'null'
                        quotes_issued:
                          type: integer
                          minimum: 0
                          description: Live quotes created in [from, to).
                        quotes_paid:
                          type: integer
                          minimum: 0
                          description: Of those, quotes with a receipt issued by /v1/pay.
                        payers_quoted:
                          type: integer
                          minimum: 0
                          description: Distinct payer addresses the quotes were bound to. Quotes issued without a payer are not in it; see quotes_without_payer.
                        payers_paid:
                          type: integer
                          minimum: 0
                          description: Distinct payers of the paid quotes.
                        quotes_without_payer:
                          type: integer
                          minimum: 0
                        expired_unpaid:
                          type: integer
                          minimum: 0
                          description: Unpaid quotes whose expires_at has passed.
                        refused_unpaid:
                          type: integer
                          minimum: 0
                          description: Unpaid quotes for which /v1/pay was called and refused the payment or failed.
                        last_quote_at:
                          type:
                          - string
                          - 'null'
                          format: date-time
                          description: The site's newest live quote at any time, not only in the window.
                        site_verified:
                          type:
                          - boolean
                          - 'null'
                          description: Same value as GET /v1/merchants/{id}. null when the published record could not be read.
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        '503':
          description: Quote storage unavailable
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      description: Every merchant agents asked for live quotes in the window, with the same counts the owner reads from /api/me/merchants/{id}/quote-conversion. Most unpaid quotes first, at most `limit` merchants.
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          enum:
          - 7
          - 30
          default: 7
  /admin/api/agents:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/agents
      operationId: get_admin_api_agents
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/agents/{addr}:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/agents/:addr
      operationId: get_admin_api_agents_addr
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      parameters:
      - name: addr
        in: path
        required: true
        schema:
          type: string
  /admin/api/transactions:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/transactions
      operationId: get_admin_api_transactions
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/search:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/search
      operationId: get_admin_api_search
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/marketplace:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/marketplace
      operationId: get_admin_api_marketplace
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/marketplace/{id}/approve:
    post:
      tags:
      - admin_api
      summary: POST /admin/api/marketplace/:id/approve
      operationId: post_admin_api_marketplace_id_approve
      responses:
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          description: Server-issued identifier
  /admin/api/marketplace/{id}/reject:
    post:
      tags:
      - admin_api
      summary: POST /admin/api/marketplace/:id/reject
      operationId: post_admin_api_marketplace_id_reject
      responses:
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          description: Server-issued identifier
  /admin/api/users:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/users
      operationId: get_admin_api_users
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
  /admin/api/users/{id}:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/users/:id
      operationId: get_admin_api_users_id
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          description: Server-issued identifier
  /admin/api/users/{id}/reset-2fa:
    post:
      tags:
      - admin_api
      summary: POST /admin/api/users/:id/reset-2fa
      operationId: post_admin_api_users_id_reset-2fa
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          description: Server-issued identifier
  /admin/api/audit:
    get:
      tags:
      - admin_api
      summary: GET /admin/api/audit
      operationId: get_admin_api_audit
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                additionalProperties: true
        '400':
          $ref: '#/components/responses/AifpError'
        '401':
          $ref: '#/components/responses/AifpError'
        '403':
          $ref: '#/components/responses/AifpError'
        '404':
          $ref: '#/components/responses/AifpError'
        '429':
          $ref: '#/components/responses/AifpError'
        5XX:
          $ref: '#/components/responses/AifpError'
      security:
      - adminSession: []
components:
  responses:
    AifpError:
      description: AIFP-* error envelope. See backend/server.js safe error handler.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AifpError'
  schemas:
    AifpError:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: AIFP-{status} code, or domain-specific string (e.g. csrf_origin_denied)
        detail:
          type: string
        request_id:
          type: string
          description: AIFP-Request-Id for log correlation
  securitySchemes:
    reportingCapability:
      type: apiKey
      in: header
      name: AIFP-Reporting-Token
      description: Observation/identity-removal capability only; no spending, access or ownership authority.
    reportingOwnerSession:
      type: apiKey
      in: cookie
      name: __aifinpay_user_session
      description: Existing owner session, current tenant/site and session-epoch validation. Browser writes also require CSRF Origin checks.
    agentEd25519:
      type: apiKey
      in: header
      name: x-agent-pubkey
      description: 'Ed25519-signed native-auth v2 request. Companion headers: x-nonce, x-signature, x-aifinpay-auth-version. The proof binds canonical origin, method, resource, body hash, and expiry. GET /nonce provides migration diagnostics only; start with an unauthenticated request to receive a v2 challenge.'
    x402Payment:
      type: apiKey
      in: header
      name: X-PAYMENT-RESPONSE
      description: x402 payment proof, base64 JSON envelope. Issued by the paying agent's wallet after broadcasting the on-chain tx. See /.well-known/x402.json.
    userSession:
      type: apiKey
      in: cookie
      name: aifinpay_session
      description: Browser session cookie for /api/me/* — sameSite=Lax, CSRF-guarded.
    agentClaim:
      type: apiKey
      in: cookie
      name: __aifinpay_agent_claim
      description: Set by redeeming a one-time claim link (POST /api/me/claim-url). Valid 10 minutes, accepted only by /api/me/agents/challenge and /api/me/agents/claim.
    adminSession:
      type: apiKey
      in: cookie
      name: aifinpay_admin_session
      description: Admin session cookie. ADMIN_ALLOWED_IPS allowlist in effect.
    partnerSession:
      type: apiKey
      in: cookie
      name: aifinpay_partner_session
      description: Partner session cookie for /api/partners/me/*.
    merchantSecret:
      type: apiKey
      in: header
      name: AIFP-Merchant-Secret
      description: Per-merchant API key for /v1/merchants/* writes.
    ingestHmac:
      type: apiKey
      in: header
      name: x-ingest-signature
      description: HMAC signature for /api/internal/* and /api/telemetry.