AP Credit Memos

Prev Next
Post
/public/v1/accounting/accounts-payable/credit-memos

Creates one or more AP credit memos in bulk. Each credit memo's detail lines are either GL-account-based or item-based, determined by the vendor's entry type. For by-account vendors, every detail line requires glAccountId. For by-item vendors, every detail line requires either glAccountId or vendorItemNumber plus quantity. See the field-level notes on glAccountId, vendorItemNumber, quantity, and eachAmount for the exact requirements in each mode.

Security

The requesting user must have the following permission to create AP credit memos:

  • Accounts Payable → AP Credit Memos → Create AP Credit Memos

Create and approve are separate permissions — this permission does not grant approval rights.

Security
HTTP
Type Bearer
Header parameters
x-r365-context-tenant-id
stringRequired

Identifies the R365 tenant the request applies to. Required on every request.

Body parameters
Expand All
object
creditMemos
Array of object (CreateCreditMemoItem) Required
Min items1
object
creditMemoNumber
string Required

The credit memo number (business identifier).

vendorId
string (uuid) Required

The vendor identifier.

locationId
string (uuid) Required

The header location identifier.

documentDate
string (date) Required

The document date (ISO 8601 calendar date, no time component).

documentAmount
number Required

The document amount.

comment
string | null

Optional header-level comment.

details
Array of object (CreateCreditMemoDetailItem) Required

The list of credit memo detail line items.

Min items1
object
glAccountId
string (uuid) | null

Optional GL account identifier. Required for GL-account rows and for by-account vendors.

locationId
string (uuid) | null

Optional location identifier for this line. Falls back to the header location when omitted.

vendorItemNumber
string | null

Optional vendor item number. Required for item rows on by-item vendors when glAccountId is not provided.

quantity
number | null

Optional quantity. Required for item rows on by-item vendors.

eachAmount
number | null

Optional unit price. Derived from totalAmount / quantity when omitted on item rows.

totalAmount
number Required

The line total amount.

unitOfMeasureId
string (uuid) | null

Optional unit of measure identifier.

comment
string | null

Optional line-level comment.

Responses
207

207 Multi-Status – per-item processing outcomes for the credit memos in the request. Inspect the per-item Status to identify successes and failures.

Expand All
object
results
Array of object (CreditMemoCreateResult)

Per-item processing outcomes, one entry per credit memo in the original request (same order, matched by requestIndex).

object
requestIndex
integer

Zero-based index of this item in creditMemos array of the original request.

creditMemoNumber
string

The credit memo number echoed from the request, so callers can match the result back to the input.

status
string

Processing outcome for this item.

Valid values[ "Succeeded", "Failed" ]
creditMemoId
string (uuid) | null

Identifier of the created credit memo. Populated when status is Succeeded.

errorCode
string | null

Machine-readable error code. Populated when status is Failed (e.g. urn:r365:accounts-payable:credit-memo:create-failed).

errorMessage
string | null

Human-readable error description. Populated when status is Failed.

400

Bad Request — a parameter value is malformed, of the wrong type, or outside its allowed range.

401

Unauthorized — the bearer token is missing, invalid or expired, or is not valid for the specified tenant.

403

Forbidden — the caller lacks the permission required for this operation.

404

Not Found — the requested resource does not exist, or the supplied continuation token is unknown or has expired.

409

Conflict — the request conflicts with the current state of the resource and cannot be applied.

422

Unprocessable Entity — a required parameter is missing, or a supplied parameter value is invalid.

429

Too Many Requests — the caller has exceeded the rate limit; retry after a short delay.

500

Internal Server Error — an unexpected error occurred while processing the request.