{
  "slug": "stripe-subscription-pending-updates-accept-metadata-e386b3cc643d",
  "title": "Stripe Subscription pending updates accept metadata",
  "tools": [
    "stripe"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-27T00:00:00.000Z",
  "announced_at": "2026-05-27T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a subscription change should wait for payment, update the Subscription or SubscriptionItem with `payment_behavior=pending_if_incomplete` and `metadata`; Stripe applies the metadata when the pending update resolves, merging keys into subscription metadata.",
    "examples": [
      "curl https://api.stripe.com/v1/subscriptions/<SUBSCRIPTION_ID> -u \"<YOUR_SECRET_KEY>\" -H \"Stripe-Version: 2026-05-27.dahlia\" -d payment_behavior=pending_if_incomplete -d \"metadata[<KEY>]=<VALUE>\"",
      "curl https://api.stripe.com/v1/subscription_items/<SUBSCRIPTION_ITEM_ID> -u \"<YOUR_SECRET_KEY>\" -H \"Stripe-Version: 2026-05-27.dahlia\" -d payment_behavior=pending_if_incomplete -d \"metadata[<KEY>]=<VALUE>\""
    ],
    "gotchas": [
      "payment_behavior: Optional enum; set to `pending_if_incomplete` to create a pending update when payment fails. Only supported pending-update attributes can be passed.",
      "metadata: Optional key-value object; attach keys to the pending update. Applied to subscription metadata when resolved; new and updated keys merge while unrelated keys are preserved.",
      "<SUBSCRIPTION_ID> (required): ID in the Subscription update path.",
      "<SUBSCRIPTION_ITEM_ID> (required): ID in the SubscriptionItem update path.",
      "<YOUR_SECRET_KEY> (required): Stripe secret API key used for request authentication.",
      "Prerequisite: The update endpoint requires an existing subscription; the SubscriptionItem endpoint requires an existing subscription item. API reference setup examples create a payment method, customer, product, price, and subscription (and a subscription item for the item endpoint).",
      "Prerequisite: `pending_if_incomplete` is for updates, and applies only when payment fails; supported attributes and payment methods are limited.",
      "Metadata is applied when the pending update is resolved.",
      "Existing integrations that do not pass `metadata` are unaffected."
    ]
  },
  "why_it_matters": "When implementing a subscription update that should remain pending until payment succeeds, attach metadata to the pending update.",
  "before": "Previously, passing `metadata` with `payment_behavior=pending_if_incomplete` returned an error.",
  "sources": [
    "https://docs.stripe.com/changelog/dahlia/2026-05-27/pending-subscription-update-metadata",
    "https://docs.stripe.com/api/subscriptions/update?api-version=2026-05-27.dahlia",
    "https://docs.stripe.com/api/subscription_items/update?api-version=2026-05-27.dahlia",
    "https://docs.stripe.com/api/subscriptions/object?api-version=2026-05-27.dahlia#subscription_object-pending_update-metadata"
  ],
  "rank": 0.97035,
  "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-d9224f99025b9cca-0:gate",
    "evidence_hash": "16fc5e5c043b7d744b64b7d580c8f820acb6d54f97f2691972d4bbd6a3e2f9ce"
  },
  "review": {
    "draft_hash": "ffba537cec5aeb745b11bcbfb499a2a2bda3d858bcb9955326d26dbd800dc37d",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.62 (>= 0.6 needed)."
  }
}
