{
  "id": "ku_9434f5308b8e2776a747bbf717ca8928",
  "version": 1,
  "domains": [
    "stripe",
    "agentic-commerce",
    "checkout",
    "webhooks"
  ],
  "insight": {
    "summary": "The agent sent a token, the buyer took a while, and when you charged it the token no longer worked.",
    "detail": "An SPT is deactivated when it is consumed, resolved, past usage_limits.expires_at, or revoked by the agent, and you cannot create a payment with a revoked SPT. Stripe sends shared_payment.granted_token.deactivated to you and to the agent. Retrieving the token shows deactivated_at, deactivated_reason and the usage limits.",
    "action": "Listen for shared_payment.granted_token.deactivated, check expires_at and max_amount before you charge, and ask the agent for a new token rather than retrying."
  },
  "context": {
    "languages": [
      "typescript"
    ],
    "pattern": "token-lifecycle"
  },
  "evidence": {
    "confidence": 0.85,
    "confirmations": 1,
    "first_observed": "2026-12-02T00:00:00Z",
    "last_confirmed": "2026-12-02T00:00:00Z"
  },
  "tier": "public",
  "created_by": "neomorphic:house",
  "flags": [],
  "extensions": {
    "neomorphic:title": "Stripe payment with a shared payment token fails: the token was used, expired or revoked by the agent",
    "neomorphic:signature": {
      "surface": "payments-platform",
      "provider": "stripe",
      "code": "spt-deactivated",
      "versions": "Stripe-Version 2026-09-30.preview",
      "environment": "agentic commerce, seller side",
      "key": "payments-platform/stripe/spt-deactivated"
    },
    "neomorphic:status": "fixed",
    "neomorphic:fix": {
      "summary": "Listen for shared_payment.granted_token.deactivated, check expires_at and max_amount before you charge, and ask the agent for a new token rather than retrying.",
      "snippet": {
        "lang": "ts",
        "text": "if (event.type === 'shared_payment.granted_token.deactivated') {\n  const spt = event.data.object;\n  await orders.markTokenDead(spt.id, spt.deactivated_reason);   // ask the agent for a new SPT\n}"
      }
    },
    "neomorphic:sources": [
      {
        "kind": "doc",
        "url": "https://docs.stripe.com/agentic-commerce/concepts/shared-payment-tokens",
        "observed_at": "2026-12-02",
        "note": "Shared payment tokens, Listen for webhook events: deactivated when consumed, resolved, expired or revoked; no payment with a revoked SPT; retrieve shows deactivated_at and usage_limits."
      }
    ],
    "neomorphic:author": {
      "kind": "house",
      "name": "Neomorphic"
    },
    "neomorphic:escalation": "seller",
    "neomorphic:observed_at": "2026-12-02",
    "neomorphic:updated_at": "2026-12-02",
    "neomorphic:stale_after": "2027-06-01"
  }
}
