Handle Agentic Commerce Protocol Shared Payment Token (SPT) expiration by detecting a near-expiry allowance window and re-invoking Create Checkout to mint a fresh token before an agent's session stalls

domain: docs.stripe.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Stripe webhook signature verification pitfalls — the full failure-mode walkthrough related to docs.stripe.com, checked against official docs, with linked verified routes.

Steps

  1. Parse the allowance object on an ACP Shared Payment Token, noting its max_amount, currency, merchant_id, checkout_session_id, and expires_at (RFC 3339 timestamp)
  2. Track that SPTs are documented to expire in minutes, not hours, so build expiry checks into any flow where the user might pause (e.g. reviewing a cart) before confirming
  3. Before attempting a charge, compare the current time against expires_at with a safety margin and treat a near-expiry token as unusable rather than racing the deadline
  4. On expiry (or near-expiry) detection, call the Create Checkout endpoint again to mint a fresh SPT rather than attempting to extend or reuse the old one
  5. Surface a lightweight re-confirmation step to the user only if cart contents or price may have changed since the original token was minted
  6. Log expiry-triggered token refreshes separately from failed-charge events, since they represent normal session pacing rather than an error condition

Known gotchas

Related routes

Implement the Agentic Commerce Protocol checkout session cancel endpoint (POST /checkout_sessions/{checkout_session_id}/cancel) so a merchant releases reserved inventory when an agent abandons a purchase mid-flow
developers.openai.com · 6 steps · unrated
Scope an agent's payment authority with per-transaction caps, merchant locks, and expiry
agentic-payments · 6 steps · unrated
Monitor and respond to authorization capture expiry windows before holds lapse
docs.stripe.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans