{
  "slug": "stripe-subscription-updates-support-cancel-at-period-end-in-pending-updates-5a83f430205f",
  "title": "Stripe Subscription updates support cancel_at_period_end in pending updates",
  "tools": [
    "stripe"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-30T00:00:00.000Z",
  "announced_at": "2026-09-30T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When an update should cancel a subscription at the current period end after payment succeeds, update it with `payment_behavior=pending_if_incomplete` and `cancel_at_period_end=true`. Stripe stores the setting in `pending_update` if payment fails or requires customer action; a conflicting later cancellation value expires the pending update.",
    "examples": [
      "curl https://api.stripe.com/v1/subscriptions/<subscription_id> \\\n  -u \"<YOUR_SECRET_KEY>:\" \\\n  -d payment_behavior=pending_if_incomplete \\\n  -d proration_behavior=always_invoice \\\n  -d \"items[0][id]=<subscription_item_id>\" \\\n  -d \"items[0][price]=<price_id>\" \\\n  -d cancel_at_period_end=true"
    ],
    "gotchas": [
      "subscription_id (required): Subscription ID in the update URL.",
      "payment_behavior (required): Set to `pending_if_incomplete` to use pending updates.",
      "cancel_at_period_end (required): Set to `true` to cancel at the current period end; supported for pending updates.",
      "proration_behavior: `always_invoice` creates an invoice and attempts payment when the update is made.",
      "items[0][id]: Subscription item ID to update; included in the documented example.",
      "items[0][price]: Price ID to apply to the subscription item; included in the documented example.",
      "Prerequisite: Pending updates require `collection_method=charge_automatically` and a supported payment method.",
      "Prerequisite: The update must generate an invoice to trigger a pending update; `proration_behavior=always_invoice` does so in the documented example.",
      "Prerequisite: Authenticate the API request with a Stripe secret key.",
      "cancel_at_period_end is a nullable boolean property of pending_update on a Subscription.",
      "The cancellation takes effect at the end of the current billing period after the pending update applies.",
      "A conflicting cancel_at_period_end value in a subsequent update expires the existing pending update."
    ]
  },
  "why_it_matters": "When scheduling an incomplete Subscription update that should also cancel at the billing period end, set cancel_at_period_end as part of the pending update.",
  "before": "Before this change, passing `cancel_at_period_end` with `payment_behavior=pending_if_incomplete` returned an error.",
  "sources": [
    "https://docs.stripe.com/changelog/endive/2026-09-30/scheduled-subscription-cancellation",
    "https://docs.stripe.com/billing/subscriptions/pending-updates",
    "https://docs.stripe.com/api/subscriptions/update?api-version=2025-04-30.basil"
  ],
  "rank": 0.9302,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-tools-20261017",
    "verdict_id": "wave1b-tools-20261017:wave1b-tools-20261017-563d8963c8e29729-0:gate",
    "evidence_hash": "289d9ad94cea7849df4cbf2459cf8a33ead573c3ccfbc48bf1c811b5f3545eff"
  },
  "review": {
    "draft_hash": "3574619c48d68956b9435edf8c6c42a9ae07fd1179581e2db3a85883ce536ba6",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.93 >= 0.9; 2 needed) and Jev gave 0.67 (>= 0.6 needed)."
  }
}
