REST API

Complete REST API reference for MPPFi - the first neobank infrastructure for AI agents built on Solana blockchain with Machine Payments Protocol integration.

Base URL

https://api.mppfi.xyz/v1

Authentication

All API requests require authentication using API keys. Include your API key in the Authorization header:

Authorization: Bearer mppfi_live_abc123...

API Key Types

  • Secret keys (mppfi_live_...): Use for server-side applications only

  • Publishable keys (mppfi_pub_...): Safe for client-side use (limited permissions)

  • Test keys (mppfi_test_...): For sandbox environment testing

Security Best Practices

  • Never expose secret keys in client-side code or public repositories

  • Rotate keys regularly using the dashboard

  • Use environment variables to store keys

  • Implement key rotation without downtime using multiple active keys

Rate Limits

Tier
Rate Limit
Burst Limit

Free

100 req/min

120 req/min

Starter

500 req/min

600 req/min

Growth

2,000 req/min

2,500 req/min

Enterprise

Custom

Custom

Rate limit headers are included in every response:

Pagination

List endpoints support cursor-based pagination:

Parameters:

  • limit (optional): Number of items to return (1-100, default: 20)

  • cursor (optional): Pagination cursor from previous response

Response:

Idempotency

POST requests support idempotency keys to prevent duplicate operations:

If a request with the same idempotency key is repeated within 24 hours, the API returns the original response without executing the operation again.


Agent Accounts

Create Agent Account

Creates a new AI agent account with on-chain Solana address and USDC balance.

Request Body:

Response (201 Created):

Retrieve Agent Account

Response (200 OK):

List Agent Accounts

Query Parameters:

  • limit (optional): Number of results (1-100, default: 20)

  • cursor (optional): Pagination cursor

  • status (optional): Filter by status (active, suspended, closed)

  • created_after (optional): ISO 8601 timestamp

  • created_before (optional): ISO 8601 timestamp

Response (200 OK):

Update Agent Account

Request Body:

Response (200 OK):

Suspend Agent Account

Suspends agent account, preventing all transactions while maintaining on-chain state.

Response (200 OK):

Reactivate Agent Account

Response (200 OK):

Close Agent Account

Permanently closes agent account and withdraws remaining balance to specified address.

Request Body:

Response (200 OK):


Payments

Create Payment (MPP)

Creates a payment using Machine Payments Protocol, with on-chain settlement via Solana.

Request Body:

Response (201 Created):

Create Direct Transfer

Creates a direct USDC transfer between Solana addresses.

Request Body:

Response (201 Created):

Retrieve Payment

Response (200 OK):

List Payments

Query Parameters:

  • agent_id (optional): Filter by agent

  • merchant_id (optional): Filter by merchant

  • status (optional): Filter by status (pending, completed, failed)

  • amount_min (optional): Minimum amount filter

  • amount_max (optional): Maximum amount filter

  • created_after (optional): ISO 8601 timestamp

  • created_before (optional): ISO 8601 timestamp

  • limit (optional): Number of results (1-100, default: 20)

  • cursor (optional): Pagination cursor

Response (200 OK):

Cancel Payment

Cancels a pending payment (only possible before blockchain confirmation).

Response (200 OK):


Policies

Create Policy

Creates an on-chain policy enforced by Solana smart contracts.

Request Body:

Response (201 Created):

Retrieve Policy

Response (200 OK):

List Policies

Query Parameters:

  • agent_id (optional): Filter by agent

  • status (optional): Filter by status (active, disabled)

  • limit (optional): Number of results

  • cursor (optional): Pagination cursor

Response (200 OK):

Update Policy

Updates policy and deploys changes to Solana smart contract.

Request Body:

Response (200 OK):

Disable Policy

Response (200 OK):

Enable Policy

Response (200 OK):


Balances

Get Agent Balance

Response (200 OK):

Get Balance History

Query Parameters:

  • start_date (required): ISO 8601 timestamp

  • end_date (required): ISO 8601 timestamp

  • interval (optional): hour, day, week, month (default: day)

Response (200 OK):

Fund Agent Account

Deposits USDC to agent's Solana address.

Request Body:

Response (201 Created):


Merchants

List Merchants

Lists MPP-compatible merchants accepting agent payments.

Query Parameters:

  • category (optional): Filter by category

  • mpp_version (optional): Filter by MPP protocol version

  • limit (optional): Number of results

  • cursor (optional): Pagination cursor

Response (200 OK):

Retrieve Merchant

Response (200 OK):


Webhooks

Create Webhook Endpoint

Request Body:

Response (201 Created):

List Webhooks

Response (200 OK):

Update Webhook

Request Body:

Response (200 OK):

Delete Webhook

Response (204 No Content)

Retrieve Webhook Event

Response (200 OK):


Analytics

Get Agent Analytics

Query Parameters:

  • start_date (required): ISO 8601 timestamp

  • end_date (required): ISO 8601 timestamp

  • metrics (optional): Comma-separated metrics

Response (200 OK):

Get Payment Analytics

Query Parameters:

  • start_date (required): ISO 8601 timestamp

  • end_date (required): ISO 8601 timestamp

  • group_by (optional): day, week, month

Response (200 OK):


API Keys

Create API Key

Request Body:

Response (201 Created):

List API Keys

Response (200 OK):

Revoke API Key

Response (204 No Content)


Errors

All errors follow this format:

See Error Reference for complete error codes.


Versioning

The API uses versioning through the URL path (/v1/). Breaking changes will result in a new version (/v2/).

Current Version: v1 (Stable)

Version History

  • v1 (2025-12-01): Initial stable release

    • Agent account management

    • Machine Payments Protocol integration

    • Solana blockchain settlement

    • On-chain policy enforcement


SDKs

Official SDKs are available for:

  • TypeScript/Node.js: npm install @mppfi/node

  • Python: pip install mppfi

  • Rust: cargo add mppfi

  • Go: go get github.com/mppfi/mppfi-go

See SDK Documentation for language-specific guides.


Support

  • Documentation: https://docs.mppfi.xyz

  • API Status: https://status.mppfi.xyz

  • Support Email: [email protected]

  • Discord Community: https://discord.gg/mppfi

Last updated

Was this helpful?