Skip to content

Embedded Payment

How Mandates are Embedded

Payment mandates can be embedded in various agent protocols, enabling seamless integration of payments into agent communication.

The Embedding Process

The complete flow is:

  1. Payer requests mandate from Agent Debit Wallet
  2. Wallet signs the payment mandate with cryptographic signature
  3. Mandate is Base64 encoded for transport
  4. Encoded mandate is embedded in protocol payload (HTTP, x402, MCP, A2A, etc.)
  5. Payee receives the request and extracts the mandate
  6. Payee verifies the payment mandate
  7. If verification passes, payee executes the request
  8. Payee enqueues the mandate for settlement
  9. Later, settlement processor receives the mandate and settles

Protocol Integration Examples

In x402 Calls

The mandate is added to HTTP headers:

http
POST /api/service HTTP/1.1
X-Agent-Id: fluxa-test-agent-001
X-Agent-Spend-Mandate: U29ycnksIHRoaXMgaXMgYSByYW5kb20gQmFzZTY0...

{request body}

In MCP/A2A Protocols

The payment mandate is embedded within the protocol's payment field, enabling pay-per-call functionality.

MCP/A2A protocols can embed ASP protocol to achieve pay-per-call payment mode.

With AP2 Integration

ASP payment mandates can leverage the AP2 protocol for user authorization.

ASP's Payment mandate can leverage AP2 protocol, only mandates authorized by users are valid mandates.

Only mandates that receive user authorization through AP2 are considered valid, adding an extra layer of user control and consent.

Design Principles

Embedded payments follow these principles:

  1. Protocol-agnostic: Mandates can be embedded in any protocol
  2. Transport-friendly: Base64 encoding ensures safe transport
  3. Verifiable: Payee can verify before service delivery
  4. Non-blocking: Payment doesn't block service execution
  5. Deferred settlement: Actual fund transfer happens later

Next Steps

Released under the MIT License.