{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quickbooks/json-schema/quickbooks-creditmemoresponse-schema.json",
  "title": "creditmemoresponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quickbooks-online-accounting-openapi-generated.yml#/components/schemas/creditmemoresponse",
  "type": "object",
  "properties": {
    "TxnDate": {
      "type": "string",
      "format": "date",
      "description": "The date entered by the user when this transaction occurred.\nFor posting transactions, this is the posting date that affects the financial statements. If the date is not supplied, the current date on the server is used.\n\nSort order is ASC by default.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "current server date",
      "x-intuit-filterable": true,
      "x-intuit-sortable": true
    },
    "CurrencyRef": {
      "type": "object",
      "x-intuit-type": "CurrencyRefType",
      "description": "Reference to the currency in which all amounts on the associated transaction are expressed. This must be defined if multicurrency is enabled for the company.\nMulticurrency is enabled for the company if Preferences.MultiCurrencyEnabled is set to true. Read more about multicurrency support here. Required if multicurrency is enabled for the company.",
      "x-intuit-required": "Conditionally required"
    },
    "CustomField": {
      "allOf": [
        {
          "$ref": "#/$defs/customfield"
        }
      ],
      "description": "One of, up to three custom fields for the transaction. Available for custom fields so configured for the company. Check Preferences.SalesFormsPrefs.CustomField and Preferences.VendorAndPurchasesPrefs.POCustomField for custom fields currenly configured. Click here to learn about managing custom fields.",
      "x-intuit-required": "Optional"
    },
    "HomeBalance": {
      "type": "number",
      "description": "Convenience field containing the amount in Balance expressed in terms of the home currency. Calculated by QuickBooks business logic. Value is valid only when CurrencyRef is specified. Applicable if multicurrency is enabled for the company."
    },
    "ClassRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to the Class associated with the transaction. Available if Preferences.AccountingInfoPrefs.ClassTrackingPerLine is set to true. Query the Class name list resource to determine the appropriate Class object for this reference. Use Class.Id and Class.Name from that object for ClassRef.value and ClassRef.name, respectively.",
      "x-intuit-required": "Optional"
    },
    "PrintStatus": {
      "type": "string",
      "description": "Printing status of the credit-memo.\nValid values:\nNotSet,\nNeedToPrint,\nPrintComplete\n.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "<span class=\"literal\">NotSet</span>"
    },
    "SalesTermRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to the sales term associated with the transaction. Query the Term name list resource to determine the appropriate Term object for this reference. Use Term.Id and Term.Name from that object for SalesTermRef.value and SalesTermRef.name, respectively.",
      "x-intuit-required": "Optional",
      "x-intuit-filterable": true
    },
    "GlobalTaxCalculation": {
      "type": "string",
      "description": "Method in which tax is applied. Allowed values are:\nTaxExcluded,\nTaxInclusive, and\nNotApplicable. Not applicable to US companies; required for non-US companies.",
      "x-intuit-required": "Conditionally required",
      "x-intuit-default": "<span class=\"literal\">TaxExcluded</span>"
    },
    "TotalAmt": {
      "type": "number",
      "description": "Indicates the total amount of the transaction. This includes the total of all the charges, allowances, and taxes. Calculated by QuickBooks business logic; any value you supply is over-written by QuickBooks.",
      "x-intuit-required": "Optional"
    },
    "RemainingCredit": {
      "type": "number",
      "description": "Indicates the total credit amount still available to apply towards the payment."
    },
    "ApplyTaxAfterDiscount": {
      "type": "boolean",
      "description": "If false or null, calculate the sales tax first, and then apply the discount. If true, subtract the discount first and then calculate the sales tax. US versions of QuickBooks only.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "<span class=\"literal\">false</span>"
    },
    "DocNumber": {
      "type": "string",
      "description": "Reference number for the transaction. If not explicitly provided at create time, this field is populated based on the setting of Preferences:CustomTxnNumber as follows:\nIf Preferences:CustomTxnNumber is true a custom value can be provided. If no value is supplied, the resulting DocNumber is null.\n\nIf Preferences:CustomTxnNumber is false, resulting DocNumber is system generated by incrementing the last number by 1.\n\nIf Preferences:CustomTxnNumber is false then do not send a value as it can lead to unwanted duplicates. If a DocNumber value is sent for an Update operation, then it just updates that particular invoice and does not alter the internal system DocNumber. \nNote: DocNumber is an optional field for all locales except France. For France locale if Preferences:CustomTxnNumber is enabled it will not be automatically generated and is a required field.",
      "x-intuit-required": "Optional",
      "x-intuit-filterable": true,
      "x-intuit-sortable": true
    },
    "PrivateNote": {
      "type": "string",
      "description": "User entered, organization-private note about the transaction. This note does not appear on the deposit form.",
      "x-intuit-required": "Optional"
    },
    "RecurDataRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "A reference to the Recurring Transaction. It captures what recurring transaction template the CreditMemo was created from."
    },
    "Line": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/line"
      },
      "description": "Individual line items of a transaction. Valid Line types include:SalesItemLine, GroupLine, DescriptionOnlyLine, DiscountLine and SubTotalLine",
      "x-intuit-required": "Required"
    },
    "CustomerMemo": {
      "allOf": [
        {
          "$ref": "#/$defs/memoref"
        }
      ],
      "description": "User-entered message to the customer; this message is visible to end user on their transactions.",
      "x-intuit-required": "Optional"
    },
    "ProjectRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to the Project ID associated with this transaction.",
      "x-intuit-required": "Conditionally required",
      "x-intuit-filterable": true
    },
    "TaxExemptionRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to the TaxExepmtion ID associated with this object. Available for companies that have automated sales tax enabled.\nTaxExemptionRef.Name: The Tax Exemption Id for the customer to which this object is associated. This Id is typically issued by the state.\n\nTaxExemptionRef.value: The system-generated Id of the exemption type.\n\n For internal use only."
    },
    "Balance": {
      "type": "number",
      "description": "The balance reflecting any payments made against the transaction. Initially set to the value of\nTotalAmt. A Balance of 0 indicates the invoice is fully paid. Calculated by QuickBooks business logic; any value you supply is over-written by QuickBooks.",
      "x-intuit-filterable": true,
      "x-intuit-sortable": true
    },
    "CustomerRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to a customer or job. Query the Customer name list resource to determine the appropriate Customer object for this reference. Use Customer.Id and Customer.DisplayName from that object for CustomerRef.value and CustomerRef.name, respectively.",
      "x-intuit-required": "Required",
      "x-intuit-filterable": true
    },
    "TxnTaxDetail": {
      "allOf": [
        {
          "$ref": "#/$defs/txntaxdetail"
        }
      ],
      "description": "This data type provides information for taxes charged on the transaction as a whole. It captures the details sales taxes calculated for the transaction based on the tax codes referenced by the transaction. This can be calculated by QuickBooks business logic or you may supply it when adding a transaction. See Global tax model for more information about this element.\nIf sales tax is disabled (Preferences.TaxPrefs.UsingSalesTax is set to false) then TxnTaxDetail is ignored and not stored.",
      "x-intuit-required": "Optional"
    },
    "SyncToken": {
      "type": "string",
      "description": "Version number of the object. It is used to lock an object for use by one app at a time. As soon as an application modifies an object, its SyncToken is incremented. Attempts to modify an object specifying an older SyncToken fails. Only the latest version of the object is maintained by QuickBooks Online.",
      "x-intuit-required": "Required for update"
    },
    "PaymentMethodRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to a PaymentMethod associated with this transaction. Query the PaymentMethod name list resource to determine the appropriate PaymentMethod object for this reference. Use PaymentMethod.Id and PaymentMethod.Name from that object for PaymentMethodRef.value and PaymentMethodRef.name, respectively.",
      "x-intuit-required": "Optional"
    },
    "ExchangeRate": {
      "type": "number",
      "description": "The number of home currency units it takes to equal one unit of currency specified by CurrencyRef. Applicable if multicurrency is enabled for the company.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "1"
    },
    "ShipAddr": {
      "allOf": [
        {
          "$ref": "#/$defs/physicaladdress"
        }
      ],
      "description": "Identifies the address where the goods must be shipped. If\nShipAddris not specified, and a default\nCustomer:ShippingAddr is specified in QuickBooks for this customer, the default ship-to address will be used by QuickBooks. \nFor international addresses - countries should be passed as 3 ISO alpha-3 characters or the full name of the country. \nIf a physical address is updated from within the transaction object, the QuickBooks Online API flows individual address components differently into the Line elements of the transaction response then when the transaction was first created:Line1 and Line2 elements are populated with the customer name and company name.\nOriginal Line1 through Line 5 contents, City, SubDivisionCode, and PostalCode flow into Line3 through Line5as a free format strings.",
      "x-intuit-required": "Optional"
    },
    "HomeTotalAmt": {
      "type": "number",
      "description": "Total amount of the transaction in the home currency. Includes the total of all the charges, allowances and taxes. Calculated by QuickBooks business logic.\nValue is valid only when CurrencyRef is specified. Applicable if multicurrency is enabled for the company."
    },
    "DepartmentRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "A reference to a Department object specifying the location of the transaction. Available if Preferences.AccountingInfoPrefs.TrackDepartments is set to true.\nQuery the Department name list resource to determine the appropriate department object for this reference. Use Department.Id and Department.Name from that object for DepartmentRef.value and DepartmentRef.name, respectively.",
      "x-intuit-required": "Optional"
    },
    "EmailStatus": {
      "type": "string",
      "description": "Email status of the credit-memo.\nValid values:\nNotSet,\nNeedToSend,\nEmailSent",
      "x-intuit-required": "Optional",
      "x-intuit-default": "<span class=\"literal\">NotSet</span>"
    },
    "BillAddr": {
      "allOf": [
        {
          "$ref": "#/$defs/physicaladdress"
        }
      ],
      "description": "Bill-to address of the credit memo. If\nBillAddris not specified, and a default\nCustomer:BillingAddr is specified in QuickBooks for this customer, the default bill-to address is used by QuickBooks. \nFor international addresses - countries should be passed as 3 ISO alpha-3 characters or the full name of the country. \nIf a physical address is updated from within the transaction object, the QuickBooks Online API flows individual address components differently into the Line elements of the transaction response then when the transaction was first created:Line1 and Line2 elements are populated with the customer name and company name.\nOriginal Line1 through Line 5 contents, City, SubDivisionCode, and PostalCode flow into Line3 through Line5as a free format strings.",
      "x-intuit-required": "Optional"
    },
    "MetaData": {
      "allOf": [
        {
          "$ref": "#/$defs/modificationmetadata"
        }
      ],
      "description": "Descriptive information about the object. The MetaData values are set by Data Services and are read only for all applications.",
      "x-intuit-required": "Optional"
    },
    "BillEmail": {
      "allOf": [
        {
          "$ref": "#/$defs/emailaddress"
        }
      ],
      "description": "Identifies the e-mail address where the credit-memo is sent. If\nEmailStatus=NeedToSend,\nBillEmailis a required input.",
      "x-intuit-required": "Conditionally required"
    },
    "Id": {
      "type": "string",
      "description": "Unique identifier for this object.",
      "x-intuit-required": "Required for update",
      "x-intuit-filterable": true
    }
  },
  "required": [
    "CustomerRef",
    "Line"
  ],
  "$defs": {
    "customfield": {
      "type": "object",
      "title": "customfield",
      "properties": {
        "DefinitionId": {
          "type": "string",
          "description": "Unique identifier of the CustomFieldDefinition that corresponds to this CustomField.",
          "x-intuit-required": "Required"
        },
        "StringValue": {
          "type": "string",
          "description": "The value for the\nStringTypecustom field.",
          "x-intuit-required": "Optional"
        },
        "Type": {
          "type": "string",
          "description": "Data type of custom field. Only one type is currently supported:\nStringType."
        },
        "Name": {
          "type": "string",
          "description": "Name of the custom field.",
          "x-intuit-required": "Optional"
        }
      },
      "required": [
        "DefinitionId"
      ]
    },
    "emailaddress": {
      "type": "object",
      "title": "emailaddress",
      "properties": {
        "Address": {
          "type": "string",
          "description": "An email address. The address format must follow the RFC 822 standard.",
          "x-intuit-required": "Optional"
        }
      }
    },
    "line": {
      "type": "object",
      "title": "line",
      "properties": {
        "Received": {
          "type": "string",
          "description": "Supported for Purchase Order only. The amount/quantity received of the line, which depends on the type of the line. It can represent the received amount or received quantity based on the line type detail. Applies to existing and new entities."
        },
        "LinkedTxn": {
          "type": "array",
          "items": {},
          "description": "Transaction to which the current entity is related. For example, an invoice line may link to a sales order or estimate.",
          "x-intuit-required": "Optional"
        },
        "Description": {
          "type": "string",
          "description": "Free form text description of the line item that appears in the printed record.",
          "x-intuit-required": "Optional"
        },
        "ProjectRef": {
          "allOf": [
            {
              "$ref": "#/$defs/referencetype"
            }
          ],
          "description": "Reference to the Project ID associated with this transaction.",
          "x-intuit-required": "Conditionally required"
        },
        "LineNum": {
          "type": "number",
          "description": "Specifies the position of the line in the collection of transaction lines. Positive integer",
          "x-intuit-required": "Optional"
        },
        "Amount": {
          "type": "number",
          "description": "The amount of the line item.",
          "x-intuit-required": "Required"
        },
        "Id": {
          "type": "string",
          "description": "The Id of the line item. Its use in requests is as folllows:\nIf\nIdis greater than zero and exists for the company, the request is considered an update operation for a line item.\n\nIf no\nIdis provided, the\nIdprovided is less than or equal to zero, or the\nIdprovided is greater than zero and does not exist for the company then the request is considered a create operation for a line item.\n\nAvailable in all objects that use lines and support the update operation.",
          "x-intuit-required": "Required for update"
        }
      },
      "required": [
        "Amount"
      ]
    },
    "memoref": {
      "type": "object",
      "title": "memoref",
      "properties": {
        "value": {
          "type": "string",
          "description": "User-entered message to the customer; this message is visible to the end user on their transactions.",
          "x-intuit-required": "Required"
        }
      },
      "required": [
        "value"
      ]
    },
    "modificationmetadata": {
      "type": "object",
      "title": "modificationmetadata",
      "properties": {
        "CreateTime": {
          "type": "string",
          "format": "date-time",
          "description": "Time the entity was created in the source domain.",
          "x-intuit-filterable": true,
          "x-intuit-sortable": true
        },
        "LastUpdatedTime": {
          "type": "string",
          "format": "date-time",
          "description": "Time the entity was last updated in the source domain.",
          "x-intuit-filterable": true,
          "x-intuit-sortable": true
        }
      }
    },
    "physicaladdress": {
      "type": "object",
      "title": "physicaladdress",
      "properties": {
        "City": {
          "type": "string",
          "description": "City name.",
          "x-intuit-required": "Optional"
        },
        "Country": {
          "type": "string",
          "description": "For international addresses, the request can be an ISO alpha-3 code or the full name of the country. The response for update and read operations returns ISO alpha-3 country codes only.",
          "x-intuit-required": "Optional"
        },
        "Line5": {
          "type": "string",
          "description": "Fifth line of the address.",
          "x-intuit-required": "Optional"
        },
        "Line4": {
          "type": "string",
          "description": "Fourth line of the address.",
          "x-intuit-required": "Optional"
        },
        "Line3": {
          "type": "string",
          "description": "Third line of the address.",
          "x-intuit-required": "Optional"
        },
        "Line2": {
          "type": "string",
          "description": "Second line of the address.",
          "x-intuit-required": "Optional"
        },
        "Line1": {
          "type": "string",
          "description": "First line of the address.",
          "x-intuit-required": "Optional"
        },
        "PostalCode": {
          "type": "string",
          "description": "Postal code. For example, zip code for USA and Canada",
          "x-intuit-required": "Optional"
        },
        "CountrySubDivisionCode": {
          "type": "string",
          "description": "Region within a country. For example, state name for USA, province name for Canada.",
          "x-intuit-required": "Optional"
        },
        "Id": {
          "type": "string",
          "description": "Unique identifier of the QuickBooks object for the address, autoincremented when the address is changed. This is an internal value included for backwards compatibility and can be ignored.",
          "x-intuit-required": "Required for update"
        }
      }
    },
    "referencetype": {
      "type": "object",
      "title": "referencetype",
      "properties": {
        "name": {
          "type": "string",
          "description": "An identifying name for the object being referenced by value and is derived from the field that holds the common name of that object. This varies by context and specific type of object referenced. For example, references to a Customer object use Customer.DisplayName to populate this field. Optionally returned in responses, implementation dependent.",
          "x-intuit-required": "Optional"
        },
        "value": {
          "type": "string",
          "description": "The ID for the referenced object as found in the Id field of the object payload. The context is set by the type of reference and is specific to the QuickBooks company file.",
          "x-intuit-required": "Required"
        }
      },
      "required": [
        "value"
      ]
    },
    "txntaxdetail": {
      "type": "object",
      "title": "txntaxdetail",
      "properties": {
        "TxnTaxCodeRef": {
          "allOf": [
            {
              "$ref": "#/$defs/referencetype"
            }
          ],
          "description": "Reference to the transaction tax code. Query the TaxCode name list resource to determine the appropriate TaxCode object for this reference. Use TaxCode.Id and TaxCode.Name from that object for TaxCodeRef.value and TaxCodeRef.name, respectively. If specified and sales tax is disabled (Preferences.TaxPrefs.UsingSalesTax is set to false), this element is ignored and not returned. For sales transactions, only: if automated sales tax is enabled (Preferences.TaxPrefs.PartnerTaxEnabled is set to true) the supplied transaction tax code is replaced by the automated sales tax engine recommendation.",
          "x-intuit-required": "Optional"
        },
        "TotalTax": {
          "type": "number",
          "description": "Total tax calculated for the transaction, excluding any tax lines manually inserted into the transaction line list.",
          "x-intuit-required": "Optional"
        },
        "TaxLine": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/line"
          },
          "x-intuit-required": "Optional"
        }
      }
    }
  }
}