Skip to main content
curl -X POST "https://api.chargefy.io/v1/invoices/inv_123/void" \
  -H "Authorization: Bearer {{API_KEY}}"
{
  "id": "inv_123",
  "object": "invoice",
  "allow_late_payment": true,
  "amount_credit_balance_applied": 0,
  "amount_discount": 0,
  "amount_due": 12990,
  "amount_due_now": 12990,
  "amount_paid": 0,
  "amount_remaining": 12990,
  "amount_subtotal": 12990,
  "amount_tax": 0,
  "amount_total": 12990,
  "billing_reason": "manual",
  "collection_method": "charge_automatically",
  "created_at": "2026-05-19T18:00:00Z",
  "currency": "brl",
  "customer": "cus_123",
  "customer_billing_address": {},
  "customer_billing_name": "Ada Lovelace",
  "customer_document": "12345678901",
  "customer_document_type": "cpf",
  "customer_email": "ada@example.com",
  "customer_name": "Ada Lovelace",
  "default_payment_method": "pm_123",
  "description": "Ajuste mensal",
  "due_date": "2026-05-19T18:00:00Z",
  "ending_balance": 0,
  "hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
  "interest": null,
  "interest_amount": null,
  "invoice_pdf_url": null,
  "late_fee": null,
  "late_fee_amount": null,
  "latest_charge": null,
  "line_items": [
    {
      "id": "ili_123",
      "object": "invoice_line_item",
      "amount_discount": 0,
      "amount_subtotal": 12990,
      "amount_tax": 0,
      "amount_total": 12990,
      "currency": "brl",
      "description": "Ajuste mensal",
      "discountable": true,
      "metadata": {},
      "period_end": null,
      "period_start": null,
      "position": 0,
      "price": null,
      "price_data": {
        "currency": "brl",
        "unit_amount": 12990
      },
      "product": null,
      "proration": false,
      "proration_details": {},
      "quantity": 1,
      "recurring_interval": null,
      "recurring_interval_count": null,
      "subscription_item": null,
      "unit_amount": 12990
    }
  ],
  "livemode": true,
  "marked_uncollectible_at": null,
  "metadata": {},
  "number": "K7M2-0001",
  "paid_at": null,
  "payment_intent": null,
  "payment_method_types": [
    "credit_card"
  ],
  "payments": {
    "object": "list",
    "data": [],
    "has_more": false,
    "url": "/v1/invoices/inv_123/payments"
  },
  "starting_balance": 0,
  "statement_descriptor": null,
  "status": "void",
  "subscription": "sub_123",
  "updated_at": "2026-05-19T18:05:00Z",
  "voided_at": "2026-05-19T18:05:00Z"
}
Marca uma invoice open como void. Invoices pagas não podem ser canceladas por este endpoint; use o fluxo apropriado da cobrança quando precisar devolver um pagamento já capturado. Quando uma invoice é cancelada, uma URL ativa em hosted_invoice_url continua apontando para a página da invoice, mas ela fica apenas para visualização e não aceita pagamento.
id
string
required
ID da invoice (inv_*).
curl -X POST "https://api.chargefy.io/v1/invoices/inv_123/void" \
  -H "Authorization: Bearer {{API_KEY}}"
{
  "id": "inv_123",
  "object": "invoice",
  "allow_late_payment": true,
  "amount_credit_balance_applied": 0,
  "amount_discount": 0,
  "amount_due": 12990,
  "amount_due_now": 12990,
  "amount_paid": 0,
  "amount_remaining": 12990,
  "amount_subtotal": 12990,
  "amount_tax": 0,
  "amount_total": 12990,
  "billing_reason": "manual",
  "collection_method": "charge_automatically",
  "created_at": "2026-05-19T18:00:00Z",
  "currency": "brl",
  "customer": "cus_123",
  "customer_billing_address": {},
  "customer_billing_name": "Ada Lovelace",
  "customer_document": "12345678901",
  "customer_document_type": "cpf",
  "customer_email": "ada@example.com",
  "customer_name": "Ada Lovelace",
  "default_payment_method": "pm_123",
  "description": "Ajuste mensal",
  "due_date": "2026-05-19T18:00:00Z",
  "ending_balance": 0,
  "hosted_invoice_url": "https://billing.chargefy.io/invoice/ilink_8Pz6wKf3tVn2Qa9LmXr4Bc7D",
  "interest": null,
  "interest_amount": null,
  "invoice_pdf_url": null,
  "late_fee": null,
  "late_fee_amount": null,
  "latest_charge": null,
  "line_items": [
    {
      "id": "ili_123",
      "object": "invoice_line_item",
      "amount_discount": 0,
      "amount_subtotal": 12990,
      "amount_tax": 0,
      "amount_total": 12990,
      "currency": "brl",
      "description": "Ajuste mensal",
      "discountable": true,
      "metadata": {},
      "period_end": null,
      "period_start": null,
      "position": 0,
      "price": null,
      "price_data": {
        "currency": "brl",
        "unit_amount": 12990
      },
      "product": null,
      "proration": false,
      "proration_details": {},
      "quantity": 1,
      "recurring_interval": null,
      "recurring_interval_count": null,
      "subscription_item": null,
      "unit_amount": 12990
    }
  ],
  "livemode": true,
  "marked_uncollectible_at": null,
  "metadata": {},
  "number": "K7M2-0001",
  "paid_at": null,
  "payment_intent": null,
  "payment_method_types": [
    "credit_card"
  ],
  "payments": {
    "object": "list",
    "data": [],
    "has_more": false,
    "url": "/v1/invoices/inv_123/payments"
  },
  "starting_balance": 0,
  "statement_descriptor": null,
  "status": "void",
  "subscription": "sub_123",
  "updated_at": "2026-05-19T18:05:00Z",
  "voided_at": "2026-05-19T18:05:00Z"
}