Pular para o conteúdo
Criar conta
ou
Entrar
O logotipo da documentação da Stripe
/
Pergunte à IA
Criar conta
Login
Comece já
Pagamentos
Receita
Plataformas e marketplaces
Gestão de valores
Recursos para desenvolvedores
Visão geral
Billing
Visão geralSobre as APIs do Billing
Assinaturas
Invoicing
    Visão geral
    Como o faturamento funciona
    Início rápido de API
    Integrar com a API
    Faturamento sem código
    Ciclo de vida da fatura
    Visualizar faturas
    Editar faturas
    Programar finalização de fatura
    Transições de status e finalização
    Enviar e-mails aos clientes
    Gerar notas de crédito
    Faturar clientes
    Clientes
    Saldo de crédito do cliente
    IDs fiscais dos clientes
    Pagamentos por fatura
    Página da fatura hospedada
    Criar planos de pagamento de fatura
    Aceitar pagamentos parciais
    Formas de pagamento para faturas
    Cobranças automáticas
    Personalização de faturas
    Personalizar faturas
    Modelos de renderização de fatura
    Agrupar itens de linha de fatura
    Resumir itens de linha
    Faturamento global
    Práticas recomendadas
    Clientes multimoedas
    Outros recursos de faturamento
    Produtos e preços
    Gerenciar itens de linha de faturas em lote
    Impostos
Cobrança por uso
Cotações
Gerenciamento de clientes
Cobrança com outros produtos
Recuperação de receitas
Automações
Teste sua integração
Tributos
Visão geral
Usar Stripe Tax
Gerenciar conformidade
Relatórios
Visão geral
Selecionar um relatório
Configurar relatórios
API de relatórios
Relatórios para várias contas
Reconhecimento de receitas
Dados
Visão geralEsquema
Relatórios personalizados
Data Pipeline
Gerenciamento de dados
Página inicialReceitaInvoicing

Edit invoices

Learn how to edit invoices after finalization.

Subscription invoices

You can’t revise invoices that are attached to subscriptions after finalization. For these types of invoices, the Edit invoice button is disabled.

Stripe lets you revise a finalized invoice in open or uncollectible status. You can’t, however, revise an invoice in void or paid status. You might want to revise an invoice if you need to:

  • Edit the invoice description.
  • Edit the customer to update contact information.
  • Add, remove, or edit a line item.
  • Add a discount or apply taxes.

You can also customize invoices if you need to change their content or branding.

Observação

The invoice compliance process can vary across countries. For example, if you’re based in the European Union, you might want to void an invoice and issue a credit note instead of revising the original invoice. Stripe recommends that you consult with your legal counsel for advice specific to your business.

You can use the API to edit an invoice after finalization.

Revise an invoice

To begin the post-finalization revision process, use the Create endpoint with the from_invoice parameter. This request creates a new draft invoice that’s linked back to the original as a revision. It also duplicates all of the invoice line items associated with the invoice. It doesn’t, however, duplicate any invoice credit notes, which could result in a change to the amount due. Also, this request doesn’t pull in pending invoice items the way invoice creation does.

Observação

You can’t use the Update endpoint to edit most fields on an invoice after it has been finalized, including monetary amounts, discounts, or customer information.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/invoices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "from_invoice[invoice]"={{ORIGINAL_INVOICE_ID}} \ -d "from_invoice[action]"=revision

After you submit a request to create an invoice using the from_invoice parameter, Stripe responds with the following:

{ "id": "{{FIRST_REVISION_INVOICE_ID}}", "status": "draft", "from_invoice": { "invoice": "{{ORIGINAL_INVOICE_ID}}", "action": "revision", }, }

This new draft invoice has mostly identical fields to the original invoice, with a few exceptions:

  • If you updated the invoice’s customer after finalizing the original invoice, the new invoice uses the updated customer information. Note that, if you use automatic tax, this might cause a recalculation of the tax amount.
  • If the original invoice had auto_advance == true, the revision invoice has it set to false.
  • The revision invoice’s starting_balance and amount_due reflects any customer balance applied to the original invoice plus any additional balance that is available on the customer object.

From here, you can make additional changes to the invoice like you would any draft. The following example updates the description of the invoice:

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/invoices/{{FIRST_REVISION_INVOICE_ID}} \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d description="Updated maintenance contract"

To add a new line item to the revised invoice:

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/invoiceitems \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d customer=
{{CUSTOMER_ID}}
\ -d invoice={{FIRST_REVISION_INVOICE_ID}} \ -d "pricing[price]"=
{{PRICE_ID}}
\ -d quantity=100 \ --data-urlencode description="Additional Stripe swag!"

Invoice revisions allow you to update customer information and have it reflected in the PDFs and on the Hosted Invoice Pages of finalized invoices:

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/customers/{{CUSTOMER_ID}} \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d name="John Doe"

After you make all of your desired changes, finalize the revised invoice:

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl -X POST https://api.stripe.com/v1/invoices/{{FIRST_REVISION_INVOICE_ID}}/finalize \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

Finalizing the revised invoice changes its state to open, and sets the finalized_at parameter to the current time stamp (rather than the finalized_at time stamp for the original invoice ). When you finalize an invoice, Stripe does the following:

  • Voids the original invoice.
  • Adds a latest_revision parameter to the original invoice.

Multiple invoice revisions

In some cases, you might need to make several revisions to an invoice. The process here is the same one used for the first revision except that Stripe updates the latest_revision parameter on all previous revisions. We only update the latest_revision parameter on finalization, not when you create the revised invoice.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/invoices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "from_invoice[invoice]"={{FIRST_REVISION_INVOICE_ID}} \ -d "from_invoice[action]"=revision

After you submit a request using the from_invoice parameter, you receive a response similar to the following:

{ "id": "{{LATEST_REVISION_INVOICE_ID}}", "status": "draft", "from_invoice": { "invoice": "{{FIRST_REVISION_INVOICE_ID}}", "action": "revision", }, # ... more fields }

Finalize the new invoice to complete the revision:

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl -X POST https://api.stripe.com/v1/invoices/{{LATEST_REVISION_INVOICE_ID}}/finalize \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

If you attempt to fetch the original invoice, you receive a response indicating that it’s void. Stripe voids the original invoice as soon as the first revision finalizes.

{ "id": "{{ORIGINAL_INVOICE_ID}}", "status": "void", "latest_revision": "{{LATEST_REVISION_INVOICE_ID}}", # This has changed from "{{FIRST_REVISION_INVOICE_ID}". }

Invoice revision constraints

Stripe enforces several constraints on invoice revisions:

  • Invoices can have at most one draft revision—If you POST to the /v1/invoices endpoint when another draft invoice exists with the same from_invoice[invoice] parameter, Stripe responds with a 400 status code.

  • You can only create a revision for invoices with open or uncollectible statuses—If you POST to the /v1/invoices endpoint, and from_invoice[invoice] corresponds to an invoice with any state other than open or uncollectible, we respond with a 400 status code.

  • If an invoice is open or uncollectible but has a payment intent in the processing state, you can’t create or finalize revisions—If a customer is using a payment method where the invoice status doesn’t update to paid when a payment attempt is initiated (like us_bank_account), we respond with a 400 status code.

  • If an open or uncollectible invoice enters a paid or void status or has a processing payment intent while it has a draft revision, you can’t finalize the revision—Stripe enforces this through a 400 status code on any endpoint that could result in invoice finalization, including /v1/invoices/:id/finalize, /v1/invoices/:id/pay, and /v1/invoices/:id/send.

  • You can’t revise invoices that are attached to a subscription—After finalization, you can’t edit invoices that have a subscription ID after finalization. For these types of invoices, Stripe sends an invoice.created webhook 1 hour before finalization for all invoices after the first. Additionally, you can’t edit any standalone invoices with subscription line items. These standalone invoices are usually created by pulling in pending proration line items.

  • You can’t revise invoices that have credit notes—You can’t create a revision for an invoice that has a credit note.

Veja também

  • Use the Dashboard
  • Integrate with the API
  • Hosted Invoice Page
Esta página foi útil?
SimNão
  • Precisa de ajuda? Fale com o suporte.
  • Participe do nosso programa de acesso antecipado.
  • Confira nosso changelog.
  • Dúvidas? Fale com a equipe de vendas.
  • LLM? Read llms.txt.
  • Powered by Markdoc