---
title: "Write off an unpaid invoice as bad debt"
description: "Via an adjustment credit note."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/invoices/write-off-an-unpaid-invoice-as-bad-debt"
---
# Write off an unpaid invoice as bad debt

> Via an adjustment credit note.

<api-operation method="POST" path="/v1/businesses/{biz}/invoices/{inv}/write_off">
<template v-slot:docs="">

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        inv
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The invoice's id (inv_…).
    </td>
  </tr>
</tbody>
</table>

## Headers

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is optional.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        comment
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Operator note, kept as a comment on the invoice.
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The invoice's id (inv_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The invoice's status. One of <code>
        pending
      </code>
      
      , <code>
        posted
      </code>
      
      , <code>
        payment_due
      </code>
      
      , <code>
        not_paid
      </code>
      
      , <code>
        paid
      </code>
      
      , <code>
        voided
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dunning_status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Null when the invoice was never dunned. <code>
        succeeded
      </code>
      
       = the chase ended with the money in (renamed from <code>
        success
      </code>
      
      ; the old spelling is never returned). One of <code>
        in_progress
      </code>
      
      , <code>
        parked
      </code>
      
      , <code>
        succeeded
      </code>
      
      , <code>
        exhausted
      </code>
      
      , <code>
        stopped
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        purpose
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What an engine-made invoice is for: <code>
        usage_interim
      </code>
      
       = usage billed during the period when it reached the usage invoice threshold; <code>
        credit_purchase
      </code>
      
       = an automatic credit top-up. Null on every other invoice. One of <code>
        usage_interim
      </code>
      
      , <code>
        credit_purchase
      </code>
      
      , <code>
        null
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        payment_in_flight
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      A debit has been accepted by the gateway and has not settled. <strong>
        RETRIEVE only
      </strong>
      
       — the list route does not compute it, so treat an absent key as unknown rather than as false. Collection is refused while one is live, so a UI must not offer "collect" against it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        awaiting_authentication
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The in-flight debit is paused for the payer's own bank approval rather than for a settlement network — it is waiting on the CUSTOMER and expires unapproved. True when the gateway said so for this debit, or when the RBI/NPCI rule predicts it (INR over ₹15,000 on the card and UPI rails) for a rail that states nothing. NOT amount-gated: an issuer may demand additional-factor authentication at any figure. RETRIEVE only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The invoice's currency (ISO-4217 code).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subtotal_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Line amounts LESS item-level discounts, before document-level discounts and tax. Reproduce it as Σ lines<span>
        
      </span>
      
      .amount_minor − item_level_discount_minor.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        total_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      subtotal_minor − document_level_discount_minor + tax (± rounding). The promotional-credit slice is a PRE-TAX discount and is already netted out of this, so it never appears in <code>
        credits_applied_minor
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        promotional_discount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The promotional-credit slice, applied BEFORE tax (it shrinks the taxable base) and reported as a discount with <code>
        entity_type = "promotional_credits"
      </code>
      
      . Included in <code>
        document_level_discount_minor
      </code>
      
      ; already subtracted from <code>
        total_minor
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        item_level_discount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Discount already INSIDE subtotal_minor (coupons scoped to specific item prices). Present on the single-invoice read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        document_level_discount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Discount applied TO subtotal_minor (invoice-amount coupons, plus <code>
        promotional_discount_minor
      </code>
      
      ). Coupons also carry a discount line item; the promotional slice does not, because it has no coupon behind it. Present on the single-invoice read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discounts
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Per-coupon discount breakdown, one entry per (coupon, stage). Present on the single-invoice read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        credits_applied_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      POST-tax customer-balance credit consumed at generation: the refundable + excess buckets. The promotional bucket is applied pre-tax and is reported as <code>
        promotional_discount_minor
      </code>
      
      , already inside <code>
        total_minor
      </code>
      
       — counting it here too would subtract it twice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        grant_credits_pre_tax_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Credit grants applied before tax (promotional, and paid credit taxed at purchase). Already off <code>
        total_minor
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        grant_credits_post_tax_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Money credit grants taxed at use, applied after tax. Included in <code>
        credits_applied_minor
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount_paid_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Cash collected (succeeded payments)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount_due_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Remaining collectible: total − withholding − credits − payments (0 when paid/written-off/voided)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        withholding_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      TDS withheld by the payer (reduces the collectible amount)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        seller_state_code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      SNAPSHOT of the seller's state at issue — what decided CGST+SGST vs IGST. Null on invoices raised before place-of-supply tax.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        place_of_supply_code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      SNAPSHOT of the customer's place of supply used for this invoice
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_treatment
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      SNAPSHOT of the treatment applied One of <code>
        default
      </code>
      
      , <code>
        sez_igst
      </code>
      
      , <code>
        sez_zero_rated
      </code>
      
      , <code>
        export_igst
      </code>
      
      , <code>
        export_zero_rated
      </code>
      
      , <code>
        reverse_charge
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_note
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Reverse-charge / SEZ / export note to print. Null = nothing to print.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        exchange_rate
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The rate that applied when this invoice was FINALIZED: units of the invoice's own <code>
        currency
      </code>
      
       per 1 unit of <code>
        exchange_rate_base
      </code>
      
       — the dialog convention (a <code>
        1 USD = 94.953741 INR
      </code>
      
       rate on an INR invoice with a USD base). A <strong>
        string
      </strong>
      
      , because the stored value is exact <code>
        numeric(20,10)
      </code>
      
       and a JSON number would round it to <code>
        94.95374099999999
      </code>
      
      ; parse it with a decimal library, not <code>
        parseFloat
      </code>
      
      , if you are going to multiply money by it. It is reported at the column's full scale, so that rate reads back as <code>
        "94.9537410000"
      </code>
      
       — trailing zeros are formatting, not precision. Compare rates numerically (or normalise) rather than by string equality. Null = no rate was recorded — the invoice predates the field, or the business had no rate configured for this currency. <strong>
        Null does not mean 1
      </strong>
      
      : 1 would assert parity with the base currency. An invoice raised IN the base currency does report <code>
        1
      </code>
      
      , where that parity is a fact. Frozen at finalize, so a <code>
        pending
      </code>
      
       draft carries null until it closes — a long-lived draft is stamped with its close-time rate, not its draft-time one. Reporting and audit only: nothing in the billing path reads it, and no rate here ever decided what the customer was charged.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        exchange_rate_base
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The currency <code>
        exchange_rate
      </code>
      
       is measured against (the business's default currency at issue). Stored per invoice so that changing the business default later cannot silently re-base history. Always present when <code>
        exchange_rate
      </code>
      
       is, and absent when it is not.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Human-readable sequential number; null while the invoice is still <code>
        pending
      </code>
      
       (numbers are assigned at posting) and on rows predating the column.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        period_start
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      Service period start. Null on a one-off invoice with no period.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        period_end
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      Service period end, INCLUSIVE — the business's anchor convention is applied before it is reported (<code>
        inclusivePeriodEnd
      </code>
      
      ), so it is one unit BEFORE the stored exclusive boundary on a day-anchored business. The <code>
        invoice.generated
      </code>
      
       webhook carries the same value, so the two can be reconciled.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sub_period
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      A monthly usage invoice inside the billing period: the sub-period it opens (start, exclusive end). Null on every other invoice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        due_date
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      Net-D payment due date. Null when payable on receipt.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        attempt_count
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Collection attempts made so far.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        next_attempt_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When dunning will retry. Null when no retry is scheduled.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        paid_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the invoice was paid (ISO-8601 UTC), or null.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        voided_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the invoice was voided (ISO-8601 UTC), or null.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        void_reason_code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Why it was voided, as passed to the void route.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        written_off
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Written off as uncollectable; <code>
        amount_due_minor
      </code>
      
       is reported as 0.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        po_number
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The purchase order number printed on the invoice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expected_payment_date
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      Collections FORECAST, not a payment term — nothing in the engine reads it, so it can never move a dunning date. Do not present it as a due date.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channel
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Provenance at creation; null on rows predating the column. One of <code>
        api
      </code>
      
      , <code>
        dashboard
      </code>
      
      , <code>
        system
      </code>
      
      , <code>
        import
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_address
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The address SNAPSHOT taken on this invoice if there is one, else the customer's CURRENT address — resolved here so every consumer (API, dashboard, PDF, portal) prints the same address for the same invoice. Null when neither exists. Unlike <code>
        customer.billing_address
      </code>
      
      , the contact name falls back to the account holder.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        billing_address_is_snapshot
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True = the address is frozen on this invoice; false = it is the customer's live address and will follow future edits.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer_tax_id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The buyer's tax registration (GSTIN, else VAT id) as it stood when the invoice was issued. Null when none was on file then, or for invoices issued before it was recorded.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_origin
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The seller registration printed on the invoice, frozen at issue. Null for invoices issued before it was recorded.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        price_type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Whether line prices included tax, at issue. Null when no tax region applied. One of <code>
        tax_exclusive
      </code>
      
      , <code>
        tax_inclusive
      </code>
      
      , <code>
        null
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        notes
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The notes printed on the invoice, frozen at issue.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        net_term_days
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The payment terms that set <code>
        due_date
      </code>
      
      . Null when the date was set directly.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        finalized_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the invoice stopped being a draft. A pending draft's <code>
        created_at
      </code>
      
       is its draft date.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updated_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      Last change to this invoice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        resource_version
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Increases on every change to this invoice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        recurring
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True when the invoice belongs to a subscription.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Total tax. Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        taxes
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Tax per component and rate (e.g. CGST 9%, SGST 9%, IGST 18%). Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        first_invoice
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The first non-voided invoice of its subscription (or of its customer, when not recurring). Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount_adjusted_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Total of non-voided adjustment credit notes. Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        write_off_amount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The part of <code>
        amount_adjusted_minor
      </code>
      
       written off. Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        adjustment_credit_notes
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        issued_credit_notes
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Refundable credit notes raised against this invoice. Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        applied_credits
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Refundable credit from other notes applied to this invoice. Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        linked_payments
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      Every payment attempt, refund and reversal on this invoice, oldest first. Detail read only.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        shipping_address
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The shipping address printed on the invoice, or null.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        shipping_address_is_snapshot
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True if the shipping address is a copy taken when the invoice was created.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        imported
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Archival row imported from an external system (no ledger postings).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        metadata
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      Key-value pairs you attach to the invoice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the invoice was created (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The payer (<code>
        cus_…
      </code>
      
      ). Present on the LIST and the single-invoice read. The write and action receipts (create, collect, void, write-off, dunning, apply-credit) serialise the invoice alone and OMIT the key — an absent <code>
        customer
      </code>
      
       means unknown-in-this-response, NOT a customerless invoice. Never key a map on it unchecked: that is how a reader files every invoice under <code>
        ""
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer_name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's RESOLVED display name — <code>
        first_name last_name
      </code>
      
      , else <code>
        company
      </code>
      
      , else the legacy <code>
        name
      </code>
      
       column. Present on the list and the single-invoice read (same rule as <code>
        customer
      </code>
      
      ). Null = the customer has no name of any kind; show <code>
        customer_email
      </code>
      
       instead. This is the ACCOUNT HOLDER, which is not necessarily the contact printed in <code>
        billing_address
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer_email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's email at the time of the invoice.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subscription
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The subscription this invoice bills (<code>
        sub_…
      </code>
      
      ). Absent on a one-off invoice, and absent on the action receipts for the same reason as <code>
        customer
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        lines
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      The invoice's line items, in issue order. Present on the SINGLE-INVOICE READ only — the list omits them rather than paying the per-row query.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Success
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Invoice not open / nothing due
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such invoice
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/invoices/inv_XXXXXXXXXXXX01/write_off" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "comment": "Requested by the customer."
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "invoice",
  "id": "inv_XXXXXXXXXXXX01",
  "status": "pending",
  "dunning_status": "in_progress",
  "purpose": "usage_interim",
  "payment_in_flight": false,
  "awaiting_authentication": false,
  "currency": "USD",
  "subtotal_minor": 2900,
  "total_minor": 2900,
  "promotional_discount_minor": 0,
  "item_level_discount_minor": 0,
  "document_level_discount_minor": 0,
  "discounts": [
    {
      "label": "Welcome 10% off",
      "scope": "item_level",
      "entity_type": "item_level_discount",
      "source": "coupon",
      "coupon_code": "welcome-10",
      "line_item_ids": [
        "si_XXXXXXXXXXXX01"
      ]
    }
  ],
  "credits_applied_minor": 0,
  "grant_credits_pre_tax_minor": 0,
  "grant_credits_post_tax_minor": 0,
  "amount_paid_minor": 2900,
  "amount_due_minor": 0,
  "withholding_minor": 0,
  "seller_state_code": "welcome-10",
  "place_of_supply_code": "welcome-10",
  "tax_treatment": "default",
  "tax_note": null,
  "exchange_rate": "0.920000",
  "exchange_rate_base": "USD",
  "number": "INV-1001",
  "period_start": "2026-03-14T09:30:00Z",
  "period_end": "2026-04-14T09:30:00Z",
  "sub_period": {
    "start": "2026-03-14T09:30:00Z",
    "end": "2026-04-14T09:30:00Z"
  },
  "due_date": "2026-04-14T09:30:00Z",
  "attempt_count": 0,
  "next_attempt_at": "2026-04-14T09:30:00Z",
  "paid_at": "2026-03-14T09:30:00Z",
  "voided_at": null,
  "void_reason_code": null,
  "written_off": false,
  "po_number": "PO-1001",
  "expected_payment_date": "2026-03-14T09:30:00Z",
  "channel": "api",
  "billing_address": {
    "first_name": "Maya",
    "last_name": "Castillo",
    "company": "Brightwater Analytics",
    "email": "maya@example.com",
    "phone": "+1 415 555 0100",
    "line1": "500 Market Street",
    "line2": "Suite 400",
    "line3": "Floor 4",
    "city": "San Francisco",
    "state": "CA",
    "state_code": "CA",
    "postal_code": "94105",
    "country": "US"
  },
  "billing_address_is_snapshot": false,
  "customer_tax_id": "EU123456789",
  "tax_origin": {
    "country": "US",
    "registration_number": "EU123456789"
  },
  "price_type": "tax_exclusive",
  "notes": "Thank you for your business.",
  "net_term_days": 14,
  "finalized_at": "2026-03-14T09:30:00Z",
  "updated_at": "2026-03-14T09:30:00Z",
  "resource_version": 1,
  "recurring": false,
  "tax_minor": 0,
  "taxes": [
    {
      "name": "CGST",
      "rate_bps": 1000,
      "amount_minor": 2900
    }
  ],
  "first_invoice": false,
  "amount_adjusted_minor": 2900,
  "write_off_amount_minor": 2900,
  "adjustment_credit_notes": [
    {
      "id": "cn_XXXXXXXXXXXX01",
      "number": "INV-1001",
      "kind": "adjustment",
      "reason_code": null,
      "status": "active",
      "total_minor": 2900
    }
  ],
  "issued_credit_notes": [
    {
      "id": "cn_XXXXXXXXXXXX01",
      "number": "INV-1001",
      "kind": "adjustment",
      "reason_code": null,
      "status": "active",
      "total_minor": 2900
    }
  ],
  "applied_credits": [],
  "linked_payments": [
    {
      "id": "txn_XXXXXXXXXXXX01",
      "type": "payment",
      "status": "active",
      "amount_minor": 2900,
      "currency": "USD",
      "gateway": "stripe"
    }
  ],
  "shipping_address": {
    "first_name": "Maya",
    "last_name": "Castillo",
    "company": "Brightwater Analytics",
    "email": "maya@example.com",
    "phone": "+1 415 555 0100",
    "line1": "500 Market Street",
    "line2": "Suite 400",
    "line3": "Floor 4",
    "city": "San Francisco",
    "state": "CA",
    "state_code": "CA",
    "postal_code": "94105",
    "country": "US"
  },
  "shipping_address_is_snapshot": false,
  "imported": false,
  "metadata": {
    "crm_id": "acct-1001"
  },
  "created_at": "2026-03-14T09:30:00Z",
  "customer": "cus_XXXXXXXXXXXX01",
  "customer_name": "Maya Castillo",
  "customer_email": "maya@example.com",
  "subscription": "sub_XXXXXXXXXXXX01",
  "lines": [
    {
      "id": "ili_XXXXXXXXXXXX01",
      "description": "Everything a growing team needs.",
      "kind": "charge",
      "quantity": 1,
      "unit_amount_minor": 2900,
      "quantity_decimal": "1234567"
    }
  ]
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Invoice not open / nothing due"
  }
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such invoice"
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
