> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Write-off object

A Write-off represents an amount of an invoice that a business has decided to forgive or cancel. Write-offs are used to adjust the outstanding balance of an invoice when the business does not expect to collect the full amount.

### Attributes

<ParamField body="id" type="string" required="true">
  Unique identifier for the write-off.
</ParamField>

<ParamField body="invoice_id" type="string" required="true">
  Unique identifier for the invoice the write-off is applied to.
</ParamField>

<ParamField body="external_id" type="string">
  Unique ID of the write-off in your system for linking and idempotency.
</ParamField>

<ParamField body="amount" type="integer" required="true">
  The amount written off in cents. This amount counts towards the invoice total and decreases the outstanding balance of the invoice. If not specified when creating a write-off, it defaults to the entire outstanding balance of the invoice. The amount must be a positive value and cannot exceed the current outstanding balance of the invoice.
</ParamField>

<ParamField body="memo" type="string">
  User-specified memo indicating the reason for the write-off.
</ParamField>

<ParamField body="destination_ledger_account" type="AccountIdentifier object" required="true">
  Expense or contra-revenue account where write-off amount is recorded. Defaults to the bad debt expense account if not specified when creating a write-off. If the write-off is for a different reason, such as a charitable donation, a different ledger expense account can be specified.
</ParamField>

<ParamField body="write_off_at" type="ISO8601 timestamp" required="true">
  Timestamp when the write-off should be recognized in the general ledger.
  This may be the same time as the invoice was created if it is an intentional charitable contribution or it could be months after the invoice is issued when that invoice is deemed uncollectible.
</ParamField>

<ParamField body="transaction_tags" type="Array of Tags">
  Tags associated with the write-off.

  <Expandable title="Tag properties">
    <ResponseField name="key" required="true" type="string">
      The tag's key
    </ResponseField>

    <ResponseField name="value" required="true" type="string">
      The tag's value
    </ResponseField>

    <ResponseField name="created_at" required="true" type="ISO8601 timestamp">
      When the tag was created
    </ResponseField>

    <ResponseField name="updated_at" required="true" type="ISO8601 timestamp">
      When the tag was last updated
    </ResponseField>

    <ResponseField name="deleted_at" type="ISO8601 timestamp">
      When the tag was deleted
    </ResponseField>
  </Expandable>
</ParamField>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "external_id": "write-off-123",
      "amount": 123,
      "memo": "Customer unable to pay due to bankruptcy",
      "destination_ledger_account": {
        "type": "AccountId",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "write_off_at": "2023-11-07T05:31:56Z",
      "transaction_tags": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "key": "WriteOffReason",
          "value": "Bankruptcy",
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "deleted_at": null
        },
        {
          "id": "4d01d4dd-1e55-5c61-9999-9ee36847163b",
          "key": "Department",
          "value": "Finance",
          "created_at": "2023-11-07T05:31:56Z",
          "updated_at": "2023-11-07T05:31:56Z",
          "deleted_at": null
        }
      ]
    }
  }
  ```
</ResponseExample>
