Skip to content

fix: keep live x402 inspect demo on 402 path#3

Closed
TateLyman wants to merge 1 commit into
Cryptorefills:masterfrom
TateLyman:codex/fix-x402-live-inspect-demo
Closed

fix: keep live x402 inspect demo on 402 path#3
TateLyman wants to merge 1 commit into
Cryptorefills:masterfrom
TateLyman:codex/fix-x402-live-inspect-demo

Conversation

@TateLyman
Copy link
Copy Markdown

@TateLyman TateLyman commented May 16, 2026

Summary

  • select the first fixed-denomination product from the live catalog before running MODE=inspect-402
  • include the required beneficiary_account field in the no-payment order body
  • update the README table so the inspect mode describes the live catalog-backed request

Why

pnpm inspect currently stops at a 400 validation error because the sample order omits beneficiary_account. Using a real fixed-denomination catalog item lets the demo reach the intended no-payment 402 challenge without sending PAYMENT-SIGNATURE or moving funds.

Validation

  • pnpm inspect reached HTTP 402 and decoded the PAYMENT-REQUIRED header
  • pnpm exec tsc --noEmit
  • git diff --check

simonlucalandi pushed a commit that referenced this pull request May 18, 2026
…account for inspect mode

The inspect-402 demo was stopping at HTTP 400 because the placeholder order
body used a zero-UUID product_id and omitted item.beneficiary_account, which
the live x402 server requires. Select the first fixed-denomination product
(is_range=false, product_value_required=false) from the catalog response and
include a demo beneficiary_account so the request reaches the intended 402
PAYMENT-REQUIRED challenge without ever sending PAYMENT-SIGNATURE.

Verified against https://x402.cryptorefills.com:
  HTTP 402, PAYMENT-REQUIRED decoded for "Amazon.com Gift Card 5 USD"
  ($5.12999700 USDC on base eip155:8453, payTo=0x110c…6a66).

Credit: original patch contributed by @TateLyman in #3.
@simonlucalandi
Copy link
Copy Markdown

Thanks @TateLyman — your diagnosis is correct: the live x402 server returns 400 item.beneficiary_account is required when the placeholder order body is posted, and selecting a real fixed-denomination product from /v1/catalog is the right fix.

We verified your patch end-to-end against https://x402.cryptorefills.com and it reaches the intended HTTP 402 with a fully decoded PAYMENT-REQUIRED envelope (e.g. "Amazon.com Gift Card 5 USD" — $5.12999700 USDC on base eip155:8453).

We've re-authored the diff and landed it on master in cb18329 with credit to you in the commit message. Closing this PR as superseded.

Appreciate the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants