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

# Payments with MPP and x402

> How InFlow Payments accepts MPP and x402 on HTTP 402, how the InFlow balance works, and how the two protocols compare.

InFlow Payments is the first part of InFlow. It accepts MPP and x402, two HTTP payment protocols that use the status `402 Payment Required`.

## How a payment works

<Steps>
  <Step title="The agent calls the endpoint">
    The request has no payment.
  </Step>

  <Step title="The endpoint returns 402">
    The `402` response contains a challenge. The challenge lists the accepted protocols, prices, and payment options.
  </Step>

  <Step title="The owner approves">
    When approval is necessary, the owner or an existing policy approves the payment.
  </Step>

  <Step title="The agent sends the credential">
    The agent calls the endpoint again with a payment credential.
  </Step>

  <Step title="The seller settles and responds">
    The seller settles the payment through InFlow. Then it returns the resource.
  </Step>
</Steps>

The seller sets the accepted options. The agent pays with one option from the challenge.

## Compare MPP and x402

| | MPP | x402 |
| - | - | - |
| Full name | Machine Payments Protocol | x402 |
| Challenge header | `WWW-Authenticate: Payment` | `PAYMENT-REQUIRED` |
| Credential header | `Authorization: Payment` | `PAYMENT-SIGNATURE` |
| Role of InFlow | Payment service provider. It checks and settles credentials. | Facilitator. It checks and settles payments. |
| Seller package | `@inflowpayai/mpp-seller` | `@inflowpayai/x402-seller` |
| Buyer package | `@inflowpayai/mpp-buyer` | `@inflowpayai/x402-buyer` |
| Money | Stablecoins from an InFlow balance on the `balance` rail. USD from a linked card on the `instrument` rail, and with the `card` and `stripe` methods. | Stablecoins from an InFlow balance with `balance`, or onchain with `exact` or `upto`. USD from a linked card with `instrument`. |
| Subscriptions | Yes, with `inflow.subscription` | Not in the InFlow SDKs or CLI |
| CLI commands | `inflow mpp ...` | `inflow x402 ...` |
| Specification | [mpp.dev](https://mpp.dev) | [x402.org](https://x402.org) |

The package names are for Node.js. For Python, Go, and Rust, see [SDKs](/reference/sdk-packages).

## Use both protocols

Integrate both protocols in the same service, so that agents of either protocol can pay you. Share the pricing and fulfillment logic. Each request goes through one charging path only. You can start with one protocol and add the other later.

| Protocol | What it adds |
| - | - |
| MPP | Fiat currencies such as `USD`, stablecoins, and subscriptions. |
| x402 | The x402 ecosystem, onchain stablecoins, and more than one facilitator. |

Each protocol protects its own endpoints. No InFlow package advertises both protocols in one `402` response. That needs custom work. See [Get started as a seller](/sellers/get-started#step-1-integrate-both-protocols).

## The InFlow balance

The InFlow balance is the stablecoins in the InFlow account of an agent. A balance payment moves value from the buyer to the seller. The InFlow balance is not a third protocol. MPP accepts it as the `balance` rail, and x402 as the `balance` scheme.

## Rails and schemes

A rail (MPP) or a scheme (x402) is the way money moves.

| Protocol | Name | What moves |
| - | - | - |
| MPP | `balance` | Crypto, from the InFlow balance of the buyer. MPP selects it when the charge currency is a stablecoin, such as `USDC`. |
| MPP | `instrument` | Fiat, from a funding instrument of the buyer. |
| x402 | `balance` | An InFlow balance transfer: a ledger transfer between two InFlow accounts, with no onchain transaction and no gas. `inflowAccepts` offers it by default, together with `exact`. |
| x402 | `exact` | An onchain transfer of the exact amount. |
| x402 | `upto` | An onchain transfer of a metered amount, up to a maximum. |
| x402 | `instrument` | Fiat USD, from a linked card of the buyer. |

In MPP, the charge currency in the seller challenge sets the rail. The buyer does not choose it.

## Currencies

The InFlow account of an agent holds USDC, USDT, PYUSD, and cards in one place. The seller sets the currency of each charge.

## Minimum amounts

Stablecoin payments have no minimum amount.

Card payments in USD have a minimum of USD 0.50. The amount must be in whole cents. This rule applies to the MPP `instrument` rail, the MPP `card` and `stripe` methods, and the x402 `instrument` scheme.

## Human approval

When approval is necessary, the payment request goes to the owner. The owner approves in the InFlow dashboard or the InFlow mobile app. An existing policy can approve a payment without the owner.

## Use payments

| You are | Start here |
| - | - |
| An agent | [Pay for a resource](/agents/pay-for-a-resource) |
| A seller | [Protect an endpoint](/sellers/protect-an-endpoint) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.