> ## Documentation Index > Fetch the complete documentation index at: https://docs.restaurant365.com/llms.txt > Use this file to discover all available pages before exploring further. # AP 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. ## OpenAPI ````json POST /public/v1/accounting/accounts-payable/credit-memos { "openapi": "3.0.1", "info": { "title": "R365 Public API", "contact": { "name": "R365 Services Team", "email": "r365@restaurant365.com" }, "version": "1.0" }, "security": [ { "Bearer": [] } ], "paths": { "/public/v1/accounting/accounts-payable/credit-memos": { "post": { "tags": [ "accounting" ], "summary": "AP Credit Memos", "description": "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.\n\n**Security**\n\nThe requesting user must have the following permission to create AP credit memos:\n\n- Accounts Payable → AP Credit Memos → Create AP Credit Memos\n\nCreate and approve are separate permissions — this permission does not grant approval rights.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCreditMemosRequest" } } } }, "responses": { "207": { "description": "207 Multi-Status – per-item processing outcomes for the credit memos in the request. Inspect the per-item Status to identify successes and failures.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCreditMemosResponse" } } } }, "400": { "description": "Bad Request — a parameter value is malformed, of the wrong type, or outside its allowed range." }, "401": { "description": "Unauthorized — the bearer token is missing, invalid or expired, or is not valid for the specified tenant." }, "403": { "description": "Forbidden — the caller lacks the permission required for this operation." }, "404": { "description": "Not Found — the requested resource does not exist, or the supplied continuation token is unknown or has expired." }, "409": { "description": "Conflict — the request conflicts with the current state of the resource and cannot be applied." }, "422": { "description": "Unprocessable Entity — a required parameter is missing, or a supplied parameter value is invalid." }, "429": { "description": "Too Many Requests — the caller has exceeded the rate limit; retry after a short delay." }, "500": { "description": "Internal Server Error — an unexpected error occurred while processing the request." } }, "parameters": [ { "$ref": "#/components/parameters/TenantId" } ] } } }, "components": { "schemas": { "CreateCreditMemosRequest": { "required": [ "creditMemos" ], "type": "object", "properties": { "creditMemos": { "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/CreateCreditMemoItem" } } }, "additionalProperties": false }, "CreateCreditMemosResponse": { "required": [ "results" ], "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/CreditMemoCreateResult" }, "description": "Per-item processing outcomes, one entry per credit memo in the original request (same order, matched by requestIndex)." } }, "additionalProperties": false }, "CreateCreditMemoItem": { "required": [ "creditMemoNumber", "vendorId", "locationId", "documentDate", "documentAmount", "details" ], "type": "object", "properties": { "creditMemoNumber": { "type": "string", "description": "The credit memo number (business identifier)." }, "vendorId": { "type": "string", "description": "The vendor identifier.", "format": "uuid" }, "locationId": { "type": "string", "description": "The header location identifier.", "format": "uuid" }, "documentDate": { "type": "string", "description": "The document date (ISO 8601 calendar date, no time component).", "format": "date" }, "documentAmount": { "type": "number", "description": "The document amount." }, "comment": { "type": "string", "description": "Optional header-level comment.", "nullable": true }, "details": { "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/CreateCreditMemoDetailItem" }, "description": "The list of credit memo detail line items." } }, "additionalProperties": false }, "CreditMemoCreateResult": { "required": [ "requestIndex", "creditMemoNumber", "status" ], "type": "object", "properties": { "requestIndex": { "type": "integer", "description": "Zero-based index of this item in creditMemos array of the original request." }, "creditMemoNumber": { "type": "string", "description": "The credit memo number echoed from the request, so callers can match the result back to the input." }, "status": { "enum": [ "Succeeded", "Failed" ], "type": "string", "description": "Processing outcome for this item." }, "creditMemoId": { "type": "string", "description": "Identifier of the created credit memo. Populated when status is Succeeded.", "format": "uuid", "nullable": true }, "errorCode": { "type": "string", "description": "Machine-readable error code. Populated when status is Failed (e.g. urn:r365:accounts-payable:credit-memo:create-failed).", "nullable": true }, "errorMessage": { "type": "string", "description": "Human-readable error description. Populated when status is Failed.", "nullable": true } }, "additionalProperties": false }, "CreateCreditMemoDetailItem": { "required": [ "totalAmount" ], "type": "object", "properties": { "glAccountId": { "type": "string", "description": "Optional GL account identifier. Required for GL-account rows and for by-account vendors.", "format": "uuid", "nullable": true }, "locationId": { "type": "string", "description": "Optional location identifier for this line. Falls back to the header location when omitted.", "format": "uuid", "nullable": true }, "vendorItemNumber": { "type": "string", "description": "Optional vendor item number. Required for item rows on by-item vendors when glAccountId is not provided.", "nullable": true }, "quantity": { "type": "number", "description": "Optional quantity. Required for item rows on by-item vendors.", "nullable": true }, "eachAmount": { "type": "number", "description": "Optional unit price. Derived from totalAmount / quantity when omitted on item rows.", "nullable": true }, "totalAmount": { "type": "number", "description": "The line total amount." }, "unitOfMeasureId": { "type": "string", "description": "Optional unit of measure identifier.", "format": "uuid", "nullable": true }, "comment": { "type": "string", "description": "Optional line-level comment.", "nullable": true } }, "additionalProperties": false } }, "parameters": { "TenantId": { "name": "x-r365-context-tenant-id", "in": "header", "required": true, "description": "Identifies the R365 tenant the request applies to. Required on every request.", "schema": { "type": "string" } } }, "securitySchemes": { "Bearer": { "type": "http", "scheme": "Bearer" } } } } ````