You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/x402-commandlayer-receipts.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -297,6 +297,23 @@ A server-side example endpoint is available at `POST /api/examples/x402-paid-act
297
297
298
298
The endpoint returns status `PAID_ACTION_EXECUTED_AND_SIGNED` with a signed CLAS-style receipt.
299
299
300
+
### Verification modes
301
+
302
+
The example supports two server-side payment verification modes:
303
+
304
+
-`demo_accepted_envelope` (default): used when `X402_PROVIDER_VERIFICATION_URL` is not configured. In this mode, the endpoint accepts the declared `payment.protocol = x402` + `payment.status = accepted` envelope and marks the receipt with `payment_verification_mode: "demo_accepted_envelope"`.
305
+
-`provider_verified`: enabled only when `X402_PROVIDER_VERIFICATION_URL` is configured. In this mode, the server posts the payment envelope and request metadata to the provider verification endpoint and executes only when provider verification indicates accepted/settled payment.
306
+
307
+
Optional provider auth:
308
+
309
+
-`X402_PROVIDER_API_KEY`: when set, the server sends `Authorization: Bearer <key>` to the provider verification endpoint.
310
+
- Keys are not returned in API responses or receipt metadata.
311
+
312
+
Failure mapping in provider mode:
313
+
314
+
- Provider payment rejection: `400 payment_invalid` or `402 payment_required`.
You can verify the returned receipt with the existing verify endpoint:
@@ -323,6 +340,6 @@ Example verified result pattern (redacted for safety):
323
340
- signature_valid: `true`
324
341
- key_id: `vC4WbcNoq2znSCiQ`
325
342
326
-
This shows a paid action can emit signed execution proof after an accepted x402 payment envelope is validated.
343
+
This shows a paid action can emit signed execution proof after payment verification succeeds under the active mode.
327
344
328
-
The example validates an accepted x402 payment envelope; it does not claim full production settlement unless wired to a real x402 provider.
345
+
Important: CommandLayer proves execution and receipt integrity; x402 + the configured provider prove payment acceptance/settlement. The default example remains a demo accepted-envelope flow unless `X402_PROVIDER_VERIFICATION_URL` is configured.
0 commit comments