Skip to main content
Documentationx402 overview
x402 payments

x402 overview

Understand Aly's configured x402 rollout path for selling digital products to agents with a simple HTTP payment challenge.

HTTP-native micro-payments for digital goods when enabled — 402 challenge + EIP-712 transfer authorization.

x402 is HTTP-native micropayments — the server answers a normal GET with 402 Payment Required, the client (agent or wallet) settles on-chain, and the same request replays with a proof header to receive the goods. No redirect, no hosted checkout, no human in the loop.

Aly's x402 surface is designed for digital products under a per-site price ceiling. When it is enabled for a deployment, buyers pay with USDC or another accepted stablecoin and the merchant receives funds at their configured wallet address.

Production status
The live aly.store protocol discovery currently reports x402 as disabled. Treat this section as the current contract shape for the configured rollout path; use UCP or hosted checkout for live production purchases until discovery advertises x402 support.

At a glance

EndpointGET /api/x402/product/{siteSlug}/{productId}?quantity=N&email=X@Y.Z
EligibilityDigital product, USD price, ≤ site limit, file attached.
NetworksDeployment-configured EVM rails; planned defaults are Base, Ethereum, Polygon.
SchemeEVM exact — transferFrom of the stablecoin amount.
Tx settlementAfter response, x402 framework adds PAYMENT-RESPONSE header with tx hash.

Flow at a glance

  1. Client issues GET with no Payment header.
  2. Server checks eligibility, returns 402 with accepts (price, network, payTo) and nonce.
  3. Client constructs an EIP-712 payment authorization, signs it, and replays with Payment + Payment-Signature headers.
  4. Server verifies the payment with the x402 facilitator, runs the handler — which creates the Order in Convex with an idempotency key derived from the payment payload — and returns 200.
  5. Settlement happens after the response. The framework adds a PAYMENT-RESPONSE header carrying the transaction hash.

Smallest possible exchange

bash
# Step 1: see the pricecurl -i "https://aly.store/api/x402/product/acme/prod_pattern?quantity=1&email=buyer@example.com" HTTP/1.1 402 Payment RequiredContent-Type: application/json {  "x402Version": 1,  "accepts": [    { "scheme": "exact", "network": "base", "asset": "USDC",      "maxAmountRequired": "5000000",      "payTo": "0xabc...123",      "resource": "/api/x402/product/acme/prod_pattern",      "description": "Knitting Pattern PDF",      "mimeType": "application/pdf",      "extra": { "nonce": "..." }    }  ],  "error": "X-PAYMENT_required"} # Step 2: pay (client constructs Payment, replays)# Step 3: server returns 200 with the order + download URL
One product, one HTTP call
x402 is per-product. Multi-item carts go through UCP (hosted checkout or signed agent flow). x402 is intentionally narrow: pay-as-you-go for an individual digital good.

Configuration

When x402 is enabled, per-site flags govern product eligibility:

  • site.cryptoPaymentsEnabled — master switch.
  • site.cryptoWalletAddress — the merchant's receiving address (per network).
  • site.cryptoPreferredChain — which chain to list first in accepts.
  • site.cryptoAcceptedTokens — token allowlist; USDC by default.

Next steps

Updated

Was this page helpful?