{
  "slug": "stripe-api-detach-payment-from-invoice-2853a5b232ee",
  "title": "Stripe API detach payment from invoice",
  "tools": [
    "stripe"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-01-28T00:00:00.000Z",
  "announced_at": "2026-01-28T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When changing payment or reconciliation flows, POST to detach a PaymentIntent from its invoice; if this creates an unpaid balance, the invoice reopens as `open` and Stripe generates a default PaymentIntent for the remaining amount. Listen for `invoice_payment.detached` to track detachment.",
    "examples": [
      "curl https://api.stripe.com/v1/invoices/<INVOICE_ID>/detach_payment \\\n  -u \"<YOUR_SECRET_KEY>\" \\\n  -H \"Stripe-Version: 2026-01-28.preview\" \\\n  -d payment_intent=<PAYMENT_INTENT_ID>",
      "Listen for the `invoice_payment.detached` event."
    ],
    "gotchas": [
      "invoice ID (path) (required): Invoice from which to detach the payment.",
      "payment_intent: ID of the PaymentIntent to detach from the invoice.",
      "Stripe-Version (required): Set to `2026-01-28.preview` for the documented API version.",
      "secret key (required): Authenticate the API request.",
      "Prerequisite: Have a Stripe secret key and the invoice and PaymentIntent IDs. The endpoint reference lists customer, invoice, and PaymentIntent creation as prerequisite API objects.",
      "Prerequisite: For REST requests, use API version `2026-01-28.preview`; the changelog says to include it in the `Stripe-Version` request header when not using an SDK."
    ]
  },
  "why_it_matters": "When changing payment and reconciliation flows, detach a PaymentIntent from an invoice so it can be used in another invoice or payment flow.",
  "sources": [
    "https://docs.stripe.com/changelog/clover/2026-01-28/detach-payment-from-invoice",
    "https://docs.stripe.com/api/invoices/detach_payment?api-version=2026-01-28.preview",
    "https://docs.stripe.com/api/events/types?api-version=2026-01-28.preview#event_types-invoice_payment.detached"
  ],
  "rank": 0.9802,
  "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-79e27f3827087152-0:gate",
    "evidence_hash": "a86b293b8e2542c37dde85cce772bae32fe1d8f94248b8b4c4bfe4ff69bcaa90"
  },
  "review": {
    "draft_hash": "1f90aca57b812ac2799608781aba71139ecf59dbc295ad2d885d02f2c8247818",
    "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.98 >= 0.9; 2 needed) and Jev gave 0.62 (>= 0.6 needed)."
  }
}
