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

# x402

> SohoPay pays x402 merchants with a credit-scheme voucher the agent signs, not with a pull from the agent's wallet.

[x402](https://www.x402.org) is the HTTP payment handshake. The merchant's resource server answers an unpaid request with `402 Payment Required` and a payment requirement. The client retries with a payment header. For SohoPay that header is `PAYMENT-SIGNATURE`, and the payload is a Protocol V2 credit voucher.

This page is the shape of that handshake. The agent procedure is [Payment flow](/guides/payment-flow.md). The merchant procedure is [Merchant integration](/guides/merchant-integration.md).

## What is inside the payment

On allow, `prepare_x402_payment` returns `VOUCHER_ISSUED` and an unsigned `AgentPaymentVoucher`. The agent signs it with its Ed25519 workload key. The envelope the merchant receives uses x402 version 2 and `scheme: "credit"`. The payload carries the voucher and that signature.

The voucher is not an on-chain transaction. `SohoSettlementV2` never checks the agent's signature. It checks one [batch attestation](/protocol/settlement-attestation.md) over every entry in `settleBatch`. The facilitator already checked the voucher before capture.

## What the merchant advertises

The 402 requirement names the network and the asset. On staging that is `eip155:84532` and the mock USDC from [Environment setup](/environment-setup.md). `GET /api/v1/facilitator/supported` publishes the same scheme, version, and asset for discovery.

## What is retired

Protocol V1 sent a custodial `PaymentIntent` and settled with `settleWithAttestation` per payment. Staging does not deploy that contract. Capture rejects a V1 intent with `X402_AGENT_VOUCHER_REQUIRED`. Do not build a client that asks SohoPay to sign the payment.

## Next steps

> [card] [Payment flow](/guides/payment-flow.md)
>
> Prepare, sign, and retry.

> [card] [EIP-712](/protocol/eip-712.md)
>
> The borrower signatures around the voucher.
