AgentPay Labs Payments API

Payment intents and verification

Operations 5

POST /api/v1/payment-intents Create payment intent (agent-facing) #
GET /api/v1/payment-intents/{intentId} Poll intent status #
POST /api/v1/payment-intents/{intentId}/verify Submit on-chain transaction hash #
GET /api/receipt/{intentId} Get settlement receipt #
GET /api/verify/{txHash} Verify by transaction hash #

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/agentpay-so:agentpay-so-payments-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

agentpay-so-payments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AgentPay Payments API
  description: '**AgentPay public API for Bro and train-first agent commerce.**

    This OpenAPI document is limited to the Cloudflare Workers production surface.

    Legacy Node-only routes are intentionally excluded until they are migrated.


    ## Authentication

    All protected endpoints require an API key via:

    - `Authorization: Bearer ` header, or

    - `X-Api-Key: ` header


    ## Protocols Supported

    - **x402** — HTTP 402 paywall standard

    - **ACP** — Agent Communication Protocol

    - **AP2** — Agent Payment Protocol v2

    - **Solana Pay** — Solana USDC native

    - **Stripe** — Fiat card / bank payments


    Get your API key: `POST /api/merchants/register`'
  version: 1.0.0
  contact:
    name: AgentPay Support
    url: https://docs.agentpay.gg
    email: support@agentpay.gg
  license:
    name: BSL-1.1; AGPL-3.0 after 2029-01-01
    url: https://github.com/Rumblingb/Agentpay/blob/main/LICENSE
servers:
- url: https://api.agentpay.so
  description: Production (Cloudflare Workers)
- url: http://localhost:8787
  description: Local Workers dev (wrangler dev)
tags:
- name: Payments
  description: Payment intents and verification
paths:
  /api/v1/payment-intents:
    post:
      tags:
      - Payments
      summary: Create payment intent (agent-facing)
      description: 'Agent-initiated payment intent. No API key required — agents call this directly.


        The policy engine (AgentPassport) evaluates the request against the merchant''s

        spending policy before confirming. Returns `403` if rejected, `202` if approval required.


        **Platform fee**: 0.5% (50 bps) of gross amount, recorded in `fee_ledger_entries`.'
      operationId: createAgentPaymentIntent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentPaymentIntentRequest'
      responses:
        '201':
          description: Payment intent created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentResponse'
        '202':
          description: Policy requires manual approval before payment can proceed
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: approval_required
                  reason:
                    type: string
                  intentId:
                    type: string
                    format: uuid
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          description: Payment rejected by spending policy
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  status:
                    type: string
                    example: rejected
                  reason:
                    type: string
  /api/v1/payment-intents/{intentId}:
    get:
      tags:
      - Payments
      summary: Poll intent status
      description: Public status check. Agents poll this after submitting a tx hash.
      operationId: getPaymentIntentStatus
      parameters:
      - name: intentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Intent status
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  intentId:
                    type: string
                    format: uuid
                  merchantId:
                    type: string
                    format: uuid
                  amount:
                    type: number
                  currency:
                    type: string
                  status:
                    type: string
                    enum:
                    - pending
                    - confirmed
                    - expired
                    - rejected
                    - requires_approval
                  expiresAt:
                    type: string
                    format: date-time
        '404':
          $ref: '#/components/responses/NotFoundError'
  /api/v1/payment-intents/{intentId}/verify:
    post:
      tags:
      - Payments
      summary: Submit on-chain transaction hash
      description: 'Agents submit the Solana transaction signature after paying on-chain.

        The hash is stored and the Solana listener confirms it within ~30 seconds.

        Returns immediately with `queued: true` — poll the intent status to confirm.'
      operationId: submitTxHash
      parameters:
      - name: intentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - txHash
              properties:
                txHash:
                  type: string
                  description: Base58-encoded Solana transaction signature (88 chars)
                  example: 5LpZLGzVXc...
      responses:
        '200':
          description: Transaction hash queued for verification
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  queued:
                    type: boolean
                  intentId:
                    type: string
                  txHash:
                    type: string
                  message:
                    type: string
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          description: Intent is not in pending state
        '410':
          description: Intent has expired
  /api/receipt/{intentId}:
    get:
      tags:
      - Payments
      summary: Get settlement receipt
      description: 'Returns the full receipt for a payment intent including the intent details,

        resolution status (once the settlement engine has run), and settlement identity.

        Use this as your founder-proof artifact.'
      operationId: getReceipt
      parameters:
      - name: intentId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Payment receipt
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  intent:
                    type: object
                    description: Sanitized intent (no verificationToken)
                  resolution:
                    type: object
                    nullable: true
                    description: Resolution engine output — null until confirmed
                    properties:
                      status:
                        type: string
                      decisionCode:
                        type: string
                        nullable: true
                      reasonCode:
                        type: string
                        nullable: true
                      confidenceScore:
                        type: number
                        nullable: true
                      resolvedAt:
                        type: string
                        format: date-time
                      protocol:
                        type: string
                      externalRef:
                        type: string
                        nullable: true
                  settlement:
                    type: object
                    nullable: true
                    description: Settlement identity — null until proof submitted
                    properties:
                      status:
                        type: string
                      protocol:
                        type: string
                      externalRef:
                        type: string
                        nullable: true
                      settledAt:
                        type: string
                        format: date-time
                        nullable: true
                  escrow:
                    type: object
                    nullable: true
        '404':
          $ref: '#/components/responses/NotFoundError'
  /api/verify/{txHash}:
    get:
      tags:
      - Payments
      summary: Verify by transaction hash
      description: 'Settlement-aware lookup by Solana transaction signature or external ref.

        Response is HMAC-SHA256 signed via the `signature` field — use this to

        verify authenticity of receipts in your integration.


        Lookup chain: settlement_events → intent_resolutions → payment_intents → transactions (legacy)'
      operationId: verifyByTxHash
      parameters:
      - name: txHash
        in: path
        required: true
        schema:
          type: string
          description: Base58-encoded Solana tx signature or external reference
      responses:
        '200':
          description: Verification result (always 200 — check `verified` field)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentVerifyResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    PaymentVerifyResponse:
      type: object
      properties:
        verified:
          type: boolean
        status:
          type: string
          enum:
          - unseen
          - observed
          - matched
          - confirmed
          - unmatched
          description: '- unseen: tx hash not found anywhere

            - observed: settlement event found, not yet confirmed

            - matched: on-chain confirmed, resolution engine pending

            - confirmed: fully resolved and verified

            - unmatched: resolution engine rejected or policy mismatch

            '
        intentId:
          type: string
          nullable: true
        agentId:
          type: string
          nullable: true
        merchantId:
          type: string
          nullable: true
        settlementTimestamp:
          type: string
          format: date-time
          nullable: true
        reasonCode:
          type: string
          nullable: true
        signature:
          type: string
          description: HMAC-SHA256 of the payload — verify using your WEBHOOK_SECRET
        verifiedAt:
          type: string
          format: date-time
    AgentPaymentIntentRequest:
      type: object
      required:
      - merchantId
      - agentId
      - amount
      properties:
        merchantId:
          type: string
          format: uuid
          description: UUID of the merchant to pay
        agentId:
          type: string
          minLength: 1
          maxLength: 255
          description: Identifier for the paying agent (any string; UUID if registered)
          example: my-agent-01
        amount:
          type: number
          description: Amount in USDC (e.g. 0.10 = $0.10)
          example: 0.1
        currency:
          type: string
          enum:
          - USDC
          default: USDC
        metadata:
          type: object
          description: Optional key-value metadata attached to the intent
    PaymentIntentResponse:
      type: object
      properties:
        success:
          type: boolean
        intentId:
          type: string
          format: uuid
        verificationToken:
          type: string
          description: Must be set as the Solana Pay memo field
        expiresAt:
          type: string
          format: date-time
        instructions:
          type: object
          properties:
            crypto:
              type: object
              properties:
                network:
                  type: string
                  example: solana
                token:
                  type: string
                  example: USDC
                recipientAddress:
                  type: string
                amount:
                  type: number
                memo:
                  type: string
                solanaPayUri:
                  type: string
        settlement:
          type: object
          description: Settlement identity and matching policy (present if DB tables exist)
          nullable: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        details:
          type: array
          items:
            type: string
  responses:
    ValidationError:
      description: Request validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: ''Bearer <api_key>'' or just ''<api_key>'''