> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mag3nt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute a universal outbound payment

> Enables any mag3nt card to pay any external x402, MPP, or AP2 endpoint in a single HTTP call. The engine automatically probes the target URL, detects the protocol, and settles on-chain.




## OpenAPI

````yaml /openapi.yaml post /api/pay
openapi: 3.1.0
info:
  title: mag3nt API
  version: '2026-06-04'
  description: >
    Payment infrastructure for AI agents. Issue virtual cards, pay for API
    access via x402/AP2/MPP protocols, and settle in USDC on Base.
  contact:
    name: mag3nt
    url: https://mag3nt.com
  license:
    name: Proprietary
    url: https://github.com/mag3nt-com/mag3nt-node/blob/main/LICENSE
servers:
  - url: https://mag3nt.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Universal outbound protocol payments
  - name: Cards
    description: Virtual payment card lifecycle
  - name: Keys
    description: Developer API key management
  - name: Funding
    description: Treasury deposits and balances
  - name: x402
    description: HTTP 402 payment protocol
  - name: AP2
    description: Agent-to-Agent Payment Protocol
  - name: MPP
    description: Micropayment Protocol with streaming
  - name: Pay Links
    description: Shareable payment URLs
  - name: Withdrawals
    description: Withdraw unspent funds back to wallet
  - name: Settlement
    description: On-chain settlement status
  - name: Webhooks
    description: Signed payment.settled notifications for sellers
  - name: Status
    description: System health and configuration
externalDocs:
  description: mag3nt documentation
  url: https://docs.mag3nt.com
paths:
  /api/pay:
    post:
      tags:
        - Payments
      summary: Execute a universal outbound payment
      description: >
        Enables any mag3nt card to pay any external x402, MPP, or AP2 endpoint
        in a single HTTP call. The engine automatically probes the target URL,
        detects the protocol, and settles on-chain.
      operationId: paymentsExecute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - card_id
                - card_token
                - url
              properties:
                card_id:
                  type: string
                  description: Card identifier (sx_...)
                card_token:
                  type: string
                  description: Card secret token (tok_...)
                url:
                  type: string
                  description: The external payment-protected URL to pay
                method:
                  type: string
                  default: POST
                  description: HTTP method to use when probing the URL
                body:
                  type: object
                  description: JSON request body to trigger a priced challenge
                headers:
                  type: object
                  description: Optional headers for the probe request
            example:
              card_id: sx_a66a6666-...
              card_token: tok_3b9fe670-...
              url: https://api.weather.com/forecast
      responses:
        '200':
          description: Payment successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  transaction_id:
                    type: string
                  amount_debited:
                    type: number
                  merchant_amount:
                    type: number
                  platform_fee:
                    type: number
                  token:
                    type: string
                  network:
                    type: string
                  protocol:
                    type: string
                  settlement:
                    type: object
                    properties:
                      status:
                        type: string
                      tx_hash:
                        type: string
        '400':
          description: Invalid request
        '403':
          description: Insufficient balance or card inactive
        '410':
          description: Endpoint removed or resource gone
        '422':
          description: No payable option offered by merchant
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key prefixed with 'Bearer sx_live_...'

````