# PostInvoicesInvoiceVoid

From **Stripe API**.

`POST /v1/invoices/{invoice}/void`

<p>Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to <a href="#delete_invoice">deletion</a>, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.</p>

## Parameters

### `invoice`

- Location: path
- Required: true
- Type: `string`
- maxLength: `5000`

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

Invoices are statements of amounts owed by a customer, and are either
generated one-off, or generated periodically from a subscription.

They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments
that may be caused by subscription upgrades/downgrades (if necessary).

If your invoice is configured to be billed through automatic charges,
Stripe automatically finalizes your invoice and attempts payment. Note
that finalizing the invoice,
[when automatic](https://stripe.com/docs/billing/invoices/workflow/#auto_advance), does
not happen immediately as the invoice is created. Stripe waits
until one hour after the last webhook was successfully sent (or the last
webhook timed out after failing). If you (and the platforms you may have
connected to) have no webhooks configured, Stripe waits one hour after
creation to finalize the invoice.

If your invoice is configured to be billed by sending an email, then based on your
[email settings](https://dashboard.stripe.com/account/billing/automatic),
Stripe will email the invoice to your customer and await payment. These
emails can contain a link to a hosted page to pay the invoice.

Stripe applies any customer credit on the account before determining the
amount due for the invoice (i.e., the amount that will be actually
charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge
per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the
invoice is automatically marked paid, and we add the amount due to the
customer's credit balance which is applied to the next invoice.

More details on the customer's credit balance are
[here](https://stripe.com/docs/billing/customer/balance).

Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending).

```json
{"description":"Invoices are statements of amounts owed by a customer, and are either\ngenerated one-off, or generated periodically from a subscription.\n\nThey contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments\nthat may be caused by subscription upgrades/downgrades (if necessary).\n\nIf your invoice is configured to be billed through automatic charges,\nStripe automatically finalizes your invoice and attempts payment. Note\nthat finalizing the invoice,\n[when automatic](https://stripe.com/docs/billing/invoices/workflow/#auto_advance), does\nnot happen immediately as the invoice is created. Stripe waits\nuntil one hour after the last webhook was successfully sent (or the last\nwebhook timed out after failing). If you (and the platforms you may have\nconnected to) have no webhooks configured, Stripe waits one hour after\ncreation to finalize the invoice.\n\nIf your invoice is configured to be billed by sending an email, then based on your\n[email settings](https://dashboard.stripe.com/account/billing/automatic),\nStripe will email the invoice to your customer and await payment. These\nemails can contain a link to a hosted page to pay the invoice.\n\nStripe applies any customer credit on the account before determining the\namount due for the invoice (i.e., the amount that will be actually\ncharged). If the amount due for the invoice is less than Stripe's [minimum allowed charge\nper currency](/docs/currencies#minimum-and-maximum-charge-amounts), the\ninvoice is automatically marked paid, and we add the amount due to the\ncustomer's credit balance which is applied to the next invoice.\n\nMore details on the customer's credit balance are\n[here](https://stripe.com/docs/billing/customer/balance).\n\nRelated guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending).","properties":{"account_country":{"description":"The country of the business associated with this invoice, most often the business creating the invoice.","maxLength":5000,"nullable":true,"type":"string"},"account_name":{"description":"The public name of the business associated with this invoice, most often the business creating the invoice.","maxLength":5000,"nullable":true,"type":"string"},"account_tax_ids":{"description":"The account tax IDs associated with the invoice. Only editable when the invoice is a draft.","items":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/tax_id"},{"$ref":"#/components/schemas/deleted_tax_id"}],"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/tax_id"},{"$ref":"#/components/schemas/deleted_tax_id"}]}},"nullable":true,"type":"array"},"amount_due":{"description":"Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.","type":"integer"},"amount_paid":{"description":"The amount, in %s, that was paid.","type":"integer"},"amount_remaining":{"description":"The amount remaining, in %s, that is due.","type":"integer"},"application_fee_amount":{"description":"The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.","nullable":true,"type":"integer"},"attempt_count":{"description":"Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.","type":"integer"},"attempted":{"description":"Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.","type":"boolean"},"auto_advance":{"description":"Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action.","type":"boolean"},"automatic_tax":{"$ref":"#/components/schemas/automatic_tax"},"billing_reason":{"description":"Indicates the reason why the invoice was created. `subscription_cycle` indicates an invoice created by a subscription advancing into a new period. `subscription_create` indicates an invoice created due to creating a subscription. `subscription_update` indicates an invoice created due to updating a subscription. `subscription` is set for all old invoices to indicate either a change to a subscription or a period advancement. `manual` is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The `upcoming` value is reserved for simulated invoices per the upcoming invoice endpoint. `subscription_threshold` indicates an invoice created due to a billing threshold being reached.","enum":["automatic_pending_invoice_item_invoice","manual","quote_accept","subscription","subscription_create","subscription_cycle","subscription_threshold","subscription_update","upcoming"],"nullable":true,"type":"string"},"charge":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/charge"}],"description":"ID of the latest charge generated for this invoice, if any.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/charge"}]}},"collection_method":{"description":"Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.","enum":["charge_automatically","send_invoice"],"type":"string"},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"currency":{"description":"Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).","type":"string"},"custom_fields":{"description":"Custom fields displayed on the invoice.","items":{"$ref":"#/components/schemas/invoice_setting_custom_field"},"nullable":true,"type":"array"},"customer":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}],"description":"The ID of the customer who will be billed.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}]}},"customer_address":{"anyOf":[{"$ref":"#/components/schemas/address"}],"description":"The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.","nullable":true},"customer_email":{"description":"The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.","maxLength":5000,"nullable":true,"type":"string"},"customer_name":{"description":"The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.","maxLength":5000,"nullable":true,"type":"string"},"customer_phone":{"description":"The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.","maxLength":5000,"nullable":true,"type":"string"},"customer_shipping":{"anyOf":[{"$ref":"#/components/schemas/shipping"}],"description":"The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated.","nullable":true},"customer_tax_exempt":{"description":"The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.","enum":["exempt","none","reverse"],"nullable":true,"type":"string"},"customer_tax_ids":{"description":"The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.","items":{"$ref":"#/components/schemas/invoices_resource_invoice_tax_id"},"nullable":true,"type":"array"},"default_payment_method":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/payment_method"}],"description":"ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/payment_method"}]}},"default_source":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/alipay_account"},{"$ref":"#/components/schemas/bank_account"},{"$ref":"#/components/schemas/bitcoin_receiver"},{"$ref":"#/components/schemas/card"},{"$ref":"#/components/schemas/source"}],"description":"ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/alipay_account"},{"$ref":"#/components/schemas/bank_account"},{"$ref":"#/components/schemas/bitcoin_receiver"},{"$ref":"#/components/schemas/card"},{"$ref":"#/components/schemas/source"}]}},"default_tax_rates":{"description":"The tax rates applied to this invoice, if any.","items":{"$ref":"#/components/schemas/tax_rate"},"type":"array"},"description":{"description":"An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.","maxLength":5000,"nullable":true,"type":"string"},"discount":{"anyOf":[{"$ref":"#/components/schemas/discount"}],"description":"Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.","nullable":true},"discounts":{"description":"The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.","items":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/discount"},{"$ref":"#/components/schemas/deleted_discount"}],"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/discount"},{"$ref":"#/components/schemas/deleted_discount"}]}},"nullable":true,"type":"array"},"due_date":{"description":"The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.","format":"unix-time","nullable":true,"type":"integer"},"ending_balance":{"description":"Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.","nullable":true,"type":"integer"},"footer":{"description":"Footer displayed on the invoice.","maxLength":5000,"nullable":true,"type":"string"},"hosted_invoice_url":{"description":"The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.","maxLength":5000,"nullable":true,"type":"string"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"invoice_pdf":{"description":"The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.","maxLength":5000,"nullable":true,"type":"string"},"last_finalization_error":{"anyOf":[{"$ref":"#/components/schemas/api_errors"}],"description":"The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.","nullable":true},"lines":{"description":"The individual line items that make up the invoice. `lines` is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any.","properties":{"data":{"description":"Details about each object.","items":{"$ref":"#/components/schemas/line_item"},"type":"array"},"has_more":{"description":"True if this list has another page of items after this one that can be fetched.","type":"boolean"},"object":{"description":"String representing the object's type. Objects of the same type share the same value. Always has the value `list`.","enum":["list"],"type":"string"},"url":{"description":"The URL where this list can be accessed.","maxLength":5000,"type":"string"}},"required":["data","has_more","object","url"],"title":"InvoiceLinesList","type":"object","x-expandableFields":["data"]},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","nullable":true,"type":"object"},"next_payment_attempt":{"description":"The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`.","format":"unix-time","nullable":true,"type":"integer"},"number":{"description":"A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.","maxLength":5000,"nullable":true,"type":"string"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["invoice"],"type":"string"},"on_behalf_of":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/account"}],"description":"The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/account"}]}},"paid":{"description":"Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.","type":"boolean"},"payment_intent":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/payment_intent"}],"description":"The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/payment_intent"}]}},"payment_settings":{"$ref":"#/components/schemas/invoices_payment_settings"},"period_end":{"description":"End of the usage period during which invoice items were added to this invoice.","format":"unix-time","type":"integer"},"period_start":{"description":"Start of the usage period during which invoice items were added to this invoice.","format":"unix-time","type":"integer"},"post_payment_credit_notes_amount":{"description":"Total amount of all post-payment credit notes issued for this invoice.","type":"integer"},"pre_payment_credit_notes_amount":{"description":"Total amount of all pre-payment credit notes issued for this invoice.","type":"integer"},"quote":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/quote"}],"description":"The quote this invoice was generated from.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/quote"}]}},"receipt_number":{"description":"This is the transaction number that appears on email receipts sent for this invoice.","maxLength":5000,"nullable":true,"type":"string"},"starting_balance":{"description":"Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance.","type":"integer"},"statement_descriptor":{"description":"Extra information about an invoice for the customer's credit card statement.","maxLength":5000,"nullable":true,"type":"string"},"status":{"description":"The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)","enum":["deleted","draft","open","paid","uncollectible","void"],"nullable":true,"type":"string"},"status_transitions":{"$ref":"#/components/schemas/invoices_status_transitions"},"subscription":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/subscription"}],"description":"The subscription that this invoice was prepared for, if any.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/subscription"}]}},"subscription_proration_date":{"description":"Only set for upcoming invoices that preview prorations. The time used to calculate prorations.","type":"integer"},"subtotal":{"description":"Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated","type":"integer"},"tax":{"description":"The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.","nullable":true,"type":"integer"},"threshold_reason":{"$ref":"#/components/schemas/invoice_threshold_reason"},"total":{"description":"Total after discounts and taxes.","type":"integer"},"total_discount_amounts":{"description":"The aggregate amounts calculated per discount across all line items.","items":{"$ref":"#/components/schemas/discounts_resource_discount_amount"},"nullable":true,"type":"array"},"total_tax_amounts":{"description":"The aggregate amounts calculated per tax rate for all line items.","items":{"$ref":"#/components/schemas/invoice_tax_amount"},"type":"array"},"transfer_data":{"anyOf":[{"$ref":"#/components/schemas/invoice_transfer_data"}],"description":"The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.","nullable":true},"webhooks_delivered_at":{"description":"Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.","format":"unix-time","nullable":true,"type":"integer"}},"required":["amount_due","amount_paid","amount_remaining","attempt_count","attempted","automatic_tax","collection_method","created","currency","default_tax_rates","lines","livemode","object","paid","payment_settings","period_end","period_start","post_payment_credit_notes_amount","pre_payment_credit_notes_amount","starting_balance","status_transitions","subtotal","total","total_tax_amounts"],"title":"Invoice","type":"object","x-expandableFields":["account_tax_ids","automatic_tax","charge","custom_fields","customer","customer_address","customer_shipping","customer_tax_ids","default_payment_method","default_source","default_tax_rates","discount","discounts","last_finalization_error","lines","on_behalf_of","payment_intent","payment_settings","quote","status_transitions","subscription","threshold_reason","total_discount_amounts","total_tax_amounts","transfer_data"],"x-resourceId":"invoice"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/invoices/{invoice}/void \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "expand": [
    "string"
  ]
}'
```
