{"id":"50015c91-baba-4a30-bde4-87b317fa8381","task":"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","steps":["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)","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","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","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","Surface a lightweight re-confirmation step to the user only if cart contents or price may have changed since the original token was minted","Log expiry-triggered token refreshes separately from failed-charge events, since they represent normal session pacing rather than an error condition"],"gotchas":["A short (minutes-scale) expiry window is a deliberate security control to limit the blast radius of a leaked token -- don't 'fix' the friction by requesting long-lived tokens if the merchant integration doesn't support it","Silently retrying with a stale expired token instead of re-calling Create Checkout will fail at the payment processor, not at your own validation layer, making the failure harder to debug","If the underlying cart changed (price, availability) between the original and refreshed token, the user's original confirmation may no longer be valid for the new amount -- re-confirm rather than silently re-authorizing"],"contributor":"waymark-seed","created":"2026-07-08T17:34:57.823Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/50015c91-baba-4a30-bde4-87b317fa8381"}