Create Debit Memo

POST /accounting/debit-memos

Group: Accounting › Debit Memos · Operation ID: createDebitMemo

Creates a debit memo to settle a source credit memo. The customer, legal entity and currency come from that credit memo, not the request.

customerId, entityId and currency are not accepted as input. They come from the source credit memo, so a debit memo can never disagree with the credit it settles. debitMemoType, billToAddressId and soldToAddressId fall back to the credit memo's own values, and when neither the request nor the credit memo supplies one the call fails with MISSING_REQUIRED_FIELD. The debit memo is approved on create and its journal entry posts as part of the call, so approval is not a per-request choice. A standalone debit memo, one with no source credit memo, is not supported.

Open in the interactive reference

Parameters

Name In Type Required Description
Api-Version header "v1" yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.

Request body

Required, application/json: createDebitMemoInput.

Field Type Required Description
creditMemoId string yes The source credit memo this debit memo settles. Required: a standalone debit memo cannot be created over this API. The customer, legal entity and currency come from this credit memo, not the request. See id on GET accounting/credit-memos/:id.
debitMemoDate string (date) yes The date the debit memo is issued. Use format YYYY-MM-DD. Must fall in an open accounting period unless isMigrated is true.
paymentTerm string yes The payment-term key to apply. When dueDate is omitted, it is computed from debitMemoDate plus this term's days. See code on GET accounting/payment-terms.
debitMemoType string no The reason key for the charge, for example 'orderEntryError'. Omit to inherit the source credit memo's reason key. When neither supplies one the call fails with MISSING_REQUIRED_FIELD. The accepted keys are configured per tenant.
dueDate string (date) no The date the debit memo falls due. Use format YYYY-MM-DD. Omit to compute it from debitMemoDate plus the payment term's days.
taxDate string (date) no The date to determine tax on. Use format YYYY-MM-DD. Omit to use debitMemoDate.
billToAddressId string no The bill-to address for the document. Omit to inherit the source credit memo's. When neither supplies one the call fails with MISSING_REQUIRED_FIELD. There is no endpoint for it.
soldToAddressId string no The sold-to address for the document. Omit to inherit the source credit memo's. When neither supplies one the call fails with MISSING_REQUIRED_FIELD. There is no endpoint for it.
purchaseOrder string no The customer's own purchase-order reference to record on the document.
customerMessage string no A free-text message to show the customer on the document.
debitGlAccountId string no The header debit GL account the journal entry posts to, an Asset-type account. Omit to use the entity's AR offset. See id on GET accounting/accounts/:id.
isMigrated boolean no Whether the debit memo was loaded from a previous system. When true, it is excluded from dunning, its journal entries are auto-reversed, and the open-accounting-period check on debitMemoDate is skipped. Defaults to false.
lines array of object yes The lines of the debit memo. At least one is required, or the call fails with NO_LINES. Every amount is in the source credit memo's currency.
lines[].creditMemoLineId string yes The source credit memo line this line debits. Must be a line of the credit memo named by creditMemoId, or the call fails with CREDIT_MEMO_LINE_NOT_FOUND. The debit memo line inherits its tax-exclusion state from that source line. See lines[].id on GET accounting/credit-memos/:id.
lines[].totalPrice string (decimal) yes The line total excluding tax, in the source credit memo's currency. Must be greater than 0.
lines[].description string no A free-text line description, shown to the customer.
lines[].productId string no The product the line refers to. Omit on a free-text line. See id on GET accounting/products/:id.
lines[].quantity string (decimal) no The quantity debited. A count, not an amount, so it has no currency.
lines[].unitOfMeasure string no The unit-of-measure key, for example 'each'. An unrecognized value fails with INVALID_ENUM_VALUE.
lines[].unitPrice string (decimal) no The price per unit, in the source credit memo's currency.
lines[].adjustedUnitPrice string (decimal) no The price per unit after adjustment, in the source credit memo's currency.
lines[].taxAmount string (decimal) no The tax on the line, in the source credit memo's currency. Omit to have the tax engine determine it.
lines[].taxCode string no The tax code to apply to the line.
lines[].taxDate string (date) no The date to determine the line's tax on. Use format YYYY-MM-DD.
lines[].taxMode string, one of "taxInclusive", "taxExclusive" no How the line's prices are quoted for tax.
lines[].taxExemptCode string no The customer-level tax-exempt code to apply to the line.
lines[].creditGlAccountId string no The line's credit GL account, the credit side of the journal entry. See id on GET accounting/accounts/:id.
lines[].serviceStartDate string (date) no The first day of the service period the line covers. Use format YYYY-MM-DD.
lines[].serviceEndDate string (date) no The last day of the service period the line covers, inclusive. Use format YYYY-MM-DD.

Example:

{
  "creditMemoId": "5a0f3e6d-81b7-4c8e-9b21-9c2a6a107d34",
  "debitMemoDate": "2026-08-01",
  "paymentTerm": "net30",
  "debitMemoType": "orderEntryError",
  "dueDate": "2026-01-15",
  "taxDate": "2026-01-15",
  "billToAddressId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "soldToAddressId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "purchaseOrder": "PO-88213",
  "customerMessage": "<customerMessage>",
  "debitGlAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "isMigrated": true,
  "lines": [
    {
      "creditMemoLineId": "7d34c8e9-b21f-4a5c-9f3e-6d81b7d0aec3",
      "description": "Re-debit of over-credited licence fee",
      "quantity": "2",
      "unitOfMeasure": "license",
      "unitPrice": "250.00",
      "totalPrice": "500.00"
    }
  ]
}

Response

200 Success

Under data (createDebitMemoOutput):

Field Type Required Description
id string yes The unique identifier for the created debit memo.
debitMemoNumber string no The debit memo number, for example 'DM-1'. Absent while none has been assigned.
creditMemoId string no The source credit memo this debit memo settles. See id on GET accounting/credit-memos/:id.
creditMemoNumber string no The number of the source credit memo. Present whenever creditMemoId is.
debitMemoDate string (date) yes The date the debit memo was issued. Format YYYY-MM-DD.
dueDate string (date) no The date the debit memo falls due. Format YYYY-MM-DD. As supplied, or computed from debitMemoDate plus the payment term's days.
taxDate string (date) no The date the debit memo's tax was determined on. Format YYYY-MM-DD. Defaults to debitMemoDate.
approvalStatus string no The approval status of the new debit memo. Always 'approved'.
debitMemoStatus string no The payment and credit coverage status. Possible values: 'unpaid', 'isOverdue', 'partiallyPaid', 'paidInFull', 'creditedInFull', 'disputed'. Absent before approval.
debitMemoType string yes The reason key for the charge, as supplied or inherited from the source credit memo, for example 'orderEntryError'.
currency string yes The currency of the debit memo, taken from the source credit memo. Format ISO 4217, for example 'USD'. It governs every amount on the record.
customerId string yes The customer the debit memo is issued to, taken from the source credit memo. See id on GET accounting/customers/:id.
customerName string no The display name of the customer.
customerNumber string no The customer number.
entityId string yes The legal entity that issued the debit memo, taken from the source credit memo. See id on GET base/entities.
entityName string no The name of the issuing legal entity.
paymentTerm string yes The payment-term key applied to the debit memo. See code on GET accounting/payment-terms.
purchaseOrder string no The customer's own purchase-order reference.
customerMessage string no A free-text message shown to the customer on the document.
externalDebitMemoId string no The identifier of this debit memo in an external source system.
isMigrated boolean no Whether the debit memo was loaded from a previous system. When true, it is excluded from dunning and its journal entries are auto-reversed.
debitGlAccountId string no The header debit GL account the journal entry posts to, as supplied or defaulted to the entity's AR offset. See id on GET accounting/accounts/:id.
billToAddressId string yes The bill-to address on the document. There is no endpoint for it.
soldToAddressId string yes The sold-to address on the document. There is no endpoint for it.
subtotal string (decimal) no The sum of the lines' pre-discount totals, in the debit memo currency.
totalAmount string (decimal) no The total including tax, in the debit memo currency.
totalTax string (decimal) no The total tax across all lines, in the debit memo currency.
totalAmountDebited string (decimal) no The gross amount debited, in the debit memo currency.
lineDiscounts string (decimal) no The sum of the prorated discount amounts across all lines, in the debit memo currency.
unappliedCreditAmount string (decimal) no The credit still unapplied on the source credit memo, in the debit memo currency. Absent on a standalone debit memo.
lastModifiedDate string (date-time) yes The date and time the debit memo record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ.
lines array of object no The lines of the created debit memo, each with its assigned id and line number.
lines[].id string yes The unique identifier for the debit memo line.
lines[].lineNumber string no The sequential line number within the debit memo.
lines[].description string no A free-text line description, shown to the customer.
lines[].productId string no The debited product. Absent on a free-text line. See id on GET accounting/products/:id.
lines[].creditMemoLineId string no The source credit memo line this line debits. See lines[].id on GET accounting/credit-memos/:id.
lines[].quantity string (decimal) no The quantity debited. A count, not an amount, so it has no currency.
lines[].unitOfMeasure string no The unit-of-measure key, for example 'each'.
lines[].unitPrice string (decimal) no The price per unit, in the debit memo currency.
lines[].adjustedUnitPrice string (decimal) no The price per unit after adjustment, in the debit memo currency.
lines[].listPrice string (decimal) no The list price per unit as it stood on the source credit memo line, in the debit memo currency.
lines[].listPriceTotal string (decimal) no The pre-discount line total, in the debit memo currency.
lines[].discountAmount string (decimal) no The discount from the source credit memo line, in the debit memo currency.
lines[].discountPercentage string (decimal) no The discount as a percentage of the list price. A percentage, not an amount, so it has no currency.
lines[].totalPrice string (decimal) no The line total excluding tax, in the debit memo currency.
lines[].amountDebited string (decimal) no The amount debited for the line, in the debit memo currency.
lines[].totalAmountDue string (decimal) no The amount of the source credit memo line still available to debit, in the debit memo currency.
lines[].taxAmount string (decimal) no The tax on the line, in the debit memo currency.
lines[].taxCode string no The tax code applied to the line.
lines[].taxDate string (date) no The date the line's tax was determined on. Format YYYY-MM-DD.
lines[].taxMode string no How the line's prices are quoted for tax. Possible values: 'TaxInclusive', 'TaxExclusive'.
lines[].taxExemptCode string no The customer-level tax-exempt code applied to the line.
lines[].creditGlAccountId string no The line's credit GL account, the credit side of the journal entry. See id on GET accounting/accounts/:id.
lines[].serviceStartDate string (date) no The first day of the service period the line covers. Format YYYY-MM-DD.
lines[].serviceEndDate string (date) no The last day of the service period the line covers, inclusive. Format YYYY-MM-DD.

Response headers

Errors

Code Status
CREDIT_MEMO_NOT_FOUND 400
CREDIT_MEMO_LINE_NOT_FOUND 400
PRODUCT_NOT_FOUND 400
ACCOUNT_NOT_FOUND 400
ADDRESS_NOT_FOUND 400
INVALID_AMOUNT 400
INVALID_ENUM_VALUE 400
NO_LINES 400
MISSING_REQUIRED_FIELD 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses