SAFE QUICKSTART
Start unpaid. Nothing here signs or pays automatically.
A schema-valid POST without commercial headers can return a stateless HTTP 402 challenge with no request digest. To prepare a durable attempt, generate and retain one UUIDv4 idempotency key and one private recovery key before the request and set them as local environment variables. A paid retry requires both valid keys. This example contains synthetic document content and no payment signature.
Complete synthetic request
curl --request POST \
'https://friction-product-commerce-production.id4-score.workers.dev/v1/x402/document-classify-rename-plan' \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--header "Receipt-Recovery-Key: $RECOVERY_KEY" \
--data '{
"originalFilename": "sample-invoice.pdf",
"extension": "pdf",
"size": 48217,
"textExcerpt": "Invoice INV-1007. Invoice date 2026-09-01. Total due $125.00.",
"metadata": {
"sourceType": "email-attachment",
"title": "Sample invoice"
},
"createdAt": "2026-09-01T12:00:00.000Z",
"folderContext": {
"knownDocuments": []
}
}'
Expected result: HTTP 402 with PAYMENT-REQUIRED and Request-Digest response headers. A malformed key is HTTP 400 rather than a payment challenge.
Paid retry — client-controlled
After your x402-capable client verifies the actual challenge and you explicitly approve one payment, retry the same POST endpoint with the exact same body, Idempotency-Key, and Receipt-Recovery-Key. Include the returned Request-Digest and add PAYMENT-SIGNATURE. Do not generate a new body or new keys for that retry.
This page does not provide a payment script, connect a wallet, submit the request, sign, or authorize a purchase.