PFlux DOCS
GitHub Integration enquiries Start integrating
GET STARTED/INTRODUCTION

P2Flux documentation

P2Flux executes blockchain payments that settle straight to your own wallet. This documentation describes what is implemented today — nothing here is a plan.

PRODUCTIONBase Mainnet · live
TEST ENVIRONMENTBase Sepolia
ASSETUSDC
BUYER NEEDS ETHNo — network fee payable in USDC
NON-CUSTODIAL

There is no P2Flux balance and no payout step. A payment moves from the buyer’s wallet to the recipient address, and the P2Flux fee is split out inside the same transaction. Nothing is held between the two.

The model

P2Flux signs the terms of a payment, the buyer’s wallet executes it, and the contract enforces what was signed. P2Flux stores nothing: a payment intent and a subscription capability are HMAC-signed tokens that carry their own contents, and every status answer is read from the chain at request time.

Recurring payments work the same way. The customer signs an EIP-712 authorization once — payer, recipient, token, amount, period, start, end, salt — and the contract enforces exactly those terms, one charge per period. There is no scheduler and no database here: your application owns the subscription lifecycle and calls /v1/charges when a renewal is due.

AI agents can pay too: per request in USDC over x402, straight to your wallet. See AI agent payments.

NO ETH REQUIRED

A buyer holding USDC and no ETH can still pay, start a subscription, and repair or remove an allowance. With gas_payment_mode: 'payment_token' they sign instead of sending: P2Flux submits the transaction and pays the Base network fee in ETH, and the buyer pays that cost in USDC inside the same transaction. USDC is never converted, nothing is fronted on credit, and settlement stays direct — the merchant’s share moves from the buyer’s wallet to theirs in that one transaction. Ask GET /v1/capabilities which networks and operations offer it.

What you own, what we run

P2Flux v1 is a hosted service. You integrate against an API and a checkout that P2Flux operates — there is no P2Flux backend for you to install, and running your own is not part of the product.

That is a smaller surface than it sounds, because the parts that hold value are not ours. The contracts are public and immutable, the wallets belong to you and your customers, and your application keeps every record of who bought what. What we run is the machinery between them.

YOURS, OR PUBLICRUN BY P2FLUX
The contracts — public, immutable, verifiable on chainThe API
The JavaScript and PHP SDKs — public sourceThe hosted checkout (or host it yourself)
This documentation and the protocol it describesThe relayer that submits renewals
Your application and its database — orders, customers, subscriptionsChain access, price feeds and the security infrastructure around them
Your merchant wallet, which receives every paymentOperational monitoring and capacity
The buyer’s wallet, which sends it—
WHAT THAT MEANS FOR RISK

Everything P2Flux runs sits beside the payment rather than inside it. We are never a party to the transfer: if the API were unavailable no payment already authorized could be taken from you, and no outage puts merchant funds anywhere but the merchant’s wallet.

What exists today

This documentation describes the current implementation and nothing else.

CAPABILITYSTATUS
One-time paymentsImplemented
Recurring payments (merchant-triggered)Implemented
Hosted checkoutImplemented
Recovering a payment whose callback was lostImplemented
JavaScript and PHP SDKsImplemented — published as @p2flux/sdk on npm and p2flux/sdk-php on Packagist
API authenticationNot currently available — see Authentication
WebhooksNot currently available
RefundsImplemented — merchant-sent, verified by P2Flux
Base MainnetLive — the production environment, settling real USDC
Base SepoliaOpen — the test environment, same API without real money
Assets other than USDCNot currently available
SCOPE

A capability marked “not currently available” has no implementation in the codebase. It is listed so an integration is not planned around something that does not exist.

WHICH ENVIRONMENT THIS IS

There are two. Production runs on Base Mainnet and is live — api.p2flux.com / pay.p2flux.com, settling real USDC that P2Flux cannot reverse. The test environment runs on Base Sepolia — api-test.p2flux.com / pay-test.p2flux.com, the same API with faucet USDC, for building without real money at stake. Live state is on the status page. Both are hosted by P2Flux; there is nothing of ours to deploy.

Integration flow

A one-time payment, end to end. Every arrow is a real call in the current code.

one-time payment
your server   POST /v1/payments            → intent + pay parameters
your page     open checkout #/pay/<intent>
buyer wallet  signs one transaction         → USDC moves, fee splits
your server   POST /v1/payments/verify     → valid + block number
your system   marks the order paid

The buyer’s transaction pays the recipient and the fee wallet in one call. P2Flux never receives the merchant’s share, so there is no settlement step to wait for and no balance to withdraw.

What P2Flux does not do

  • It does not hold funds, so there is nothing to pay out and nothing to reverse.
  • It does not schedule renewals. Your billing system decides when a period is due and calls /v1/charges.
  • It does not store orders, customers or subscriptions. A payment reference is 32 random bytes generated by P2Flux, never a value you supply.
  • It cannot cancel a subscription on the customer’s behalf. Cancellation is a transaction from the customer’s own wallet; the API returns the calldata for it.
OFFICIAL SDKS

Optional but quicker: p2flux/sdk-php for PHP and @p2flux/sdk for JavaScript and TypeScript. Both are server-side clients with no runtime dependencies, and the SDKs page has the details.

install an SDK
composer require p2flux/sdk-php   # PHP
npm install @p2flux/sdk        # JavaScript / TypeScript
composer require p2flux/laravel   # Laravel

Where to next

QuickstartTake one payment, from request to confirmation.Recurring paymentsAuthorization, renewals, cancellation.API referenceEvery endpoint, field and status code.Networks & assetsChain, token, decimals, contracts.
TERMS

Use of the P2Flux Services is subject to the P2Flux Terms of Service.

Something more than a standard integration?
Marketplace flows, platform billing and custom settlement logic.
Discuss an integration