PaybytokenDocs
Paybytoken Pay · Private beta
Guide · Paybytoken Pay

Fund with ETH

Understand how Paybytoken converts Base ETH into an exact USDC consumer balance credit.

Fund with ETH is a convenience funding path for a Paybytoken Account. The consumer chooses the USDC amount they want to receive, Paybytoken requests an exact-output quote, and their wallet submits Base ETH to the configured swap provider.

The product does not hold an ETH balance. It also does not credit the consumer when the wallet transaction is submitted or when the swap provider reports success. The existing Base USDC deposit watch observes the provider's output transfer, and the canonical deposit projection credits the balance only after the required confirmations.

ConsumerChoose USDC amount
Funding sessionLock deposit watch
QuoteExact output from Base ETH
ChainUSDC reaches deposit address
LedgerConfirm and credit balance
The swap transaction is evidence; the USDC deposit and ledger journal are settlement authority.

Lifecycle

StatusMeaningClient action
requires_actionThe session can issue a short-lived ETH quote.Connect a Base wallet and request a quote.
processingThe wallet transaction hash was attached.Poll the session; do not create another transfer.
succeededThe exact USDC deposit was confirmed and credited.Refresh balances and activity.
expiredNo qualifying output deposit was correlated before the observation window closed.Start a new session; never reuse the old quote.
failedThe session needs a new attempt or support review.Show the failure state and preserve its ID.

Only one active funding session is allowed per consumer. This prevents two identical amounts sent to the same persistent address from becoming ambiguous.

The amount uses the same minimum and maximum configured for the canonical Base USDC deposit watch. There is no second funding-only limit that can drift from the amount the ledger is prepared to accept.

Browser flow

Use @paybytoken/checkout from a Paybytoken-owned, consumer-authenticated experience:

const session = await consumer.funding.create(
  { amount: '25.00' },
  { idempotencyKey: crypto.randomUUID() },
)

if (session.object === 'consumer_funding_setup') {
  // The persistent Base deposit watch is still provisioning.
  return
}

// Resume instead of starting another transfer after a reload.
const active = await consumer.funding.retrieveActive()

const quote = await consumer.funding.createQuote(session, connectedAddress, {
  idempotencyKey: crypto.randomUUID(),
})

// Submit quote.action with the connected wallet, then attach the returned hash.
await consumer.funding.submit(session.id, transactionHash)

The capability in session.funding.context_token is short-lived and sensitive. Do not log it, persist it, send it to a merchant, or use it for a different session.

Recovery and reorganization

The background worker releases an unsubmitted session at its payment deadline. A session with a submitted transaction remains observable through the configured late-payment grace period, so a slowly confirmed swap is not discarded at the UI deadline. If the wallet returned a hash just as the deadline passed, the client can still attach that exact hash during the observation window; a later confirmed USDC transfer can then recover the expired session without crediting by trust.

A chain reorganization reverses the credited deposit and changes the linked funding session to failed with failure_code: chain_reorg. Support can locate the session by ID, consumer account, or transaction hash. An administrator can link an already-credited, identity- and amount-matching deposit when browser interruption prevented automatic correlation. That repair updates attribution only; it never creates a balance or ledger entry.

First release boundary

The live route is canonical Base USDC funded by native Base ETH (chainId=8453). Test mode uses Base Sepolia (chainId=84532) and returns a simulated quote, so it never asks the connected wallet to switch networks or submit calldata. The initial release does not expose arbitrary token swaps, cross-chain bridging, a general exchange interface, or an ETH custody balance.

On this page

API Workbench

Full Explorer

Open in new tab