Detach a payment from an Invoice 

Billing
Invoices
Detach a payment from an Invoice

Detaches a payment from the invoice, removing it from the list of payments

Parameters

  • payment_intentstring

    The ID of the PaymentIntent to detach from the invoice.

Returns

Returns the invoice object that the payment was detached from.

POST /v1/invoices/:id/detach_payment
curl https://api.stripe.com/v1/invoices/in_1Nj68C2eZvKYlo2CGmFJak8q/detach_payment \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-H "Stripe-Version: 2026-01-28.preview" \
-d payment_intent=pi_1GszwY2eZvKYlo2CohCEmT6b
Response
{
"id": "in_1Nj68C2eZvKYlo2CGmFJak8q",
"object": "invoice",
"account_country": "US",
"account_name": "Stripe.com",
"account_tax_ids": null,
"amount_due": 1299,
"amount_paid": 0,
"amount_overpaid": 0,
"amount_remaining": 1299,
"amount_shipping": 0,
"application": null,
"attempt_count": 0,
"attempted": false,
"auto_advance": false,
"automatic_tax": {
"enabled": false,
"liability": null,
"status": null
},
"billing_reason": "manual",
"collection_method": "send_invoice",
"created": 1692993440,
"currency": "usd",
"custom_fields": null,
"customer": "cus_9s6XKzkNRiz8i3",
"customer_address": null,
"customer_email": "test@test.com",
"customer_name": null,
"customer_phone": null,
"customer_shipping": null,
"customer_tax_exempt": "none",
"customer_tax_ids": [],
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discounts": [],
"due_date": null,
"effective_at": null,
"ending_balance": null,
"footer": null,
"from_invoice": null,
"hosted_invoice_url": null,
"invoice_pdf": null,
"issuer": {
"type": "self"
},
"last_finalization_error": null,
"latest_revision": null,
"lines": {
"object": "list",
"data": [
{
"id": "il_1Nj68C2eZvKYlo2C7fRlh2gN",
"object": "line_item",
"amount": 1299,
"currency": "usd",
"description": "My First Invoice Item (created for API docs)",
"discount_amounts": [],
"discountable": true,
"discounts": [],
"livemode": false,
"metadata": {},
"parent": {
"type": "invoice_item_details",
"invoice_item_details": {
"invoice_item": "ii_1Nj68C2eZvKYlo2CTeCUHDgE",
"proration": false,
"proration_details": {
"credited_items": null
},
"subscription": null
}
},
"period": {
"end": 1692993440,
"start": 1692993440
},
"pricing": {
"price_details": {
"price": "price_1Nj5c82eZvKYlo2CfVgOGez4",
"product": "prod_OW7r6RmADUSO13"
},
"type": "price_details",
"unit_amount_decimal": "1299"
},
"quantity": 1,
"taxes": []
}
],
"has_more": false,
"url": "/v1/invoices/in_1Nj68C2eZvKYlo2CGmFJak8q/lines"
},
"livemode": false,
"metadata": {},
"next_payment_attempt": null,
"number": null,
"on_behalf_of": null,
"paid": false,
"paid_out_of_band": false,
"parent": null,
"payment_intent": null,
"payment_settings": {
"default_mandate": null,
"payment_method_options": null,
"payment_method_types": null
},
"period_end": 1688482163,
"period_start": 1688395763,
"post_payment_credit_notes_amount": 0,
"pre_payment_credit_notes_amount": 0,
"receipt_number": null,
"redaction": null,
"shipping_cost": null,
"shipping_details": null,
"starting_balance": 0,
"statement_descriptor": null,
"status": "open",
"status_transitions": {
"finalized_at": null,
"marked_uncollectible_at": null,
"paid_at": null,
"voided_at": null
},
"subtotal": 1299,
"subtotal_excluding_tax": 1299,
"test_clock": null,
"total": 1299,
"total_discount_amounts": [],
"total_excluding_tax": 1299,
"total_taxes": [],
"transfer_data": null,
"webhooks_delivered_at": null
}