{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/divvy/json-schema/divvy-update-credit-memo-request-dto-schema.json",
  "title": "UpdateCreditMemoRequestDto",
  "description": "Update a credit memo",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/divvy-credit-memos-api-openapi.yml#/components/schemas/UpdateCreditMemoRequestDto",
  "type": "object",
  "properties": {
    "customerId": {
      "type": "string",
      "description": "BILL-generated ID of the customer. The value begins with `0cu`."
    },
    "referenceNumber": {
      "maxLength": 100,
      "type": "string",
      "description": "User-generated credit memo number. This value can be in your chosen number scheme."
    },
    "creditDate": {
      "type": "string",
      "description": "Credit memo issued date. This value is in the `yyyy-MM-dd` format.",
      "format": "date"
    },
    "description": {
      "type": "string",
      "description": "Credit memo description"
    },
    "salesTaxItemId": {
      "type": "string",
      "description": "BILL-generated ID of the `SALES_TAX` item. The value begins with `0ii`. The tax rate is applied to all the credit memo line items set as taxable.\n\nYou can set up a `SALES_TAX` percentage item with `POST /v3/classifications/items`."
    },
    "payToChartOfAccountId": {
      "type": "string",
      "description": "BILL-generated ID of the chart of accounts used when the credit memo is applied to an invoice payment. The value begins with `0ca`."
    },
    "payToBankAccountId": {
      "type": "string",
      "description": "BILL-generated ID of the bank account used when the credit memo is applied to an invoice payment. The value begins with `bac`.\n\n**Note**: You can set only one of `payToChartOfAccountId` or `payToBankAccountId`."
    },
    "classifications": {
      "allOf": [
        {
          "$ref": "#/$defs/InvoiceClassificationsDto"
        },
        {
          "description": "General ledger classifications information for the credit memo"
        }
      ]
    },
    "creditMemoLineItems": {
      "type": "array",
      "description": "Credit memo line item information",
      "items": {
        "$ref": "#/$defs/UpdateCreditMemoLineItemDto"
      }
    }
  },
  "$defs": {
    "InvoiceClassificationsDto": {
      "type": "object",
      "properties": {
        "accountingClassId": {
          "type": "string",
          "description": "BILL-generated ID of the accounting class. The value begins with `cls`."
        },
        "departmentId": {
          "type": "string",
          "description": "BILL-generated ID of the department. The value begins with `0de`."
        },
        "jobId": {
          "type": "string",
          "description": "BILL-generated ID of the job. The value begins with `job`."
        },
        "locationId": {
          "type": "string",
          "description": "BILL-generated ID of the location. The value begins with `loc`."
        }
      },
      "description": "DTO for Invoice classifications."
    },
    "InvoiceLineItemClassificationsDto": {
      "type": "object",
      "properties": {
        "chartOfAccountId": {
          "type": "string",
          "description": "BILL-generated ID of the chart of accounts. The value begins with `0ca`."
        },
        "accountingClassId": {
          "type": "string",
          "description": "BILL-generated ID of the accounting class. The value begins with `cls`."
        },
        "departmentId": {
          "type": "string",
          "description": "BILL-generated ID of the department. The value begins with `0de`."
        },
        "jobId": {
          "type": "string",
          "description": "BILL-generated ID of the job. The value begins with `job`."
        },
        "locationId": {
          "type": "string",
          "description": "BILL-generated ID of the location. The value begins with `loc`."
        },
        "itemId": {
          "type": "string",
          "description": "BILL-generated ID of the item. The value begins with `0ii`."
        }
      },
      "description": "DTO for Bill Line Item classifications."
    },
    "UpdateCreditMemoLineItemDto": {
      "required": [
        "id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "minLength": 1,
          "type": "string",
          "description": "BILL-generated ID of the credit memo line item. The value begins with `cci`."
        },
        "description": {
          "type": "string",
          "description": "Credit memo line item description"
        },
        "price": {
          "type": "number",
          "description": "Credit Memo line item unit price. For a Credit memo in an international currency (not USD), this value is in the local currency."
        },
        "quantity": {
          "type": "number",
          "description": "Credit memo line item unit quantity"
        },
        "ratePercent": {
          "minimum": -100,
          "type": "number",
          "description": "Credit memo line item rate percent. Use `ratePercent` to apply a discount or markup in your credit memo.\n\nBILL applies the discount to the sum of the `amount` values of all the line items above the `ratePercent` line item.\n\n**Note**: Use a separate line item to set a `ratePercent` for the credit memo. Set the `ratePercent` line item as the final line item. Do not set `price` and `quantity` in the line item when you set `ratePercent`.\n\nFor example, let's say you have two line items in a credit memo with an `amount` sum of `$150`. If you create a third line item with `ratePercent` set as `-10`, a 10% discount (`$15`) is applied to the `amount` sum of `$150`."
        },
        "taxable": {
          "type": "boolean",
          "description": "Set as `true` if the credit memo line item is taxable"
        },
        "classifications": {
          "allOf": [
            {
              "$ref": "#/$defs/InvoiceLineItemClassificationsDto"
            },
            {
              "description": "General ledger classifications information for the credit memo line item"
            }
          ]
        }
      },
      "description": "Credit Memo Create Request Line Item."
    }
  }
}