---
title: Write-Off Invoices
slug: write-off-invoices
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "Enq_hw2bwsaB2D7TdkTiN",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/billing/invoices:write-off",
    "servers": [
      {
        "url": "https://api.nue.io/billing/invoices:write-off",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/billing/invoices:write-off",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Write-Off Invoices",
    "description": "<p>Write-off invoices.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "<p>The write-off invoices request</p>",
          "schema": [
            {
              "name": "writeOffInvoiceIds",
              "kind": "required",
              "type": "array",
              "description": "List of invoice IDs to write off",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Invoice written off successfully",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "paymentApplications",
                "kind": "optional",
                "type": "array",
                "description": "<p>List of payment applications created for the write-off</p>",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "invoiceId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "debitMemoId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "paymentId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "paymentMethod",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "transactionAmount",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "errorCode",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "errorMessage",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "1mEyo6184YstN0YUT_Tox",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/billing/invoices:write-off \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"writeOffInvoiceIds\": []\n     }'"
        },
        {
          "id": "-FM1KRWltq26sQVj_LPDw",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"writeOffInvoiceIds\": []\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/billing/invoices:write-off\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "sQnrn04fxQP8_nt1Q2FS1",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/billing/invoices:write-off\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"writeOffInvoiceIds\": []\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "Xoe5SjKEUPSgStOwYmPry",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/billing/invoices:write-off\"\n\npayload = json.dumps({\n   \"writeOffInvoiceIds\": []\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "1mEyo6184YstN0YUT_Tox"
    },
    "results": {
      "languages": [
        {
          "id": "Jfo6ycDdIFztOJ-xj9Vt_",
          "language": "200",
          "code": "// Invoice written off successfully\n{\n  \"paymentApplications\": [\n    {\n      \"id\": \"\",\n      \"invoiceId\": \"\",\n      \"debitMemoId\": \"\",\n      \"paymentId\": \"\",\n      \"paymentMethod\": \"\",\n      \"transactionAmount\": 0,\n      \"errorCode\": \"\",\n      \"errorMessage\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "TdZtFEsGuI5Udu6-dh_6O",
          "language": "400",
          "code": "// Bad Request\n{\n  \"title\": \"\",\n  \"message\": \"\",\n  \"errorCode\": \"\"\n}"
        },
        {
          "id": "j81q6F1YSdhHH7FRX9yL5",
          "language": "404",
          "code": "// Not Found\n{}"
        }
      ],
      "selectedLanguageId": "Jfo6ycDdIFztOJ-xj9Vt_"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}