> ## Documentation Index > Fetch the complete documentation index at: https://instrukcijos.softera.lt/llms.txt > Use this file to discover all available pages before exploring further. # Delete Sales Credit Memo > Deletes a draft sales credit memo together with its lines. Deleting a posted credit memo is subject to the standard Business Central rules for deleting posted documents and normally fails. ## OpenAPI ````json DELETE /softera/softeraEInvoice/v2.0/companies({companyId})/salesCreditMemos({salesCreditMemoId}) { "openapi": "3.1.2", "info": { "title": "Softera.E-Invoice", "version": "14.2", "description": "API specification for Softera.E-Invoice, the Business Central extension that exposes master data and\ndocuments through custom REST APIs (API group `softera/softeraEInvoice`, version `v2.0`).\nFor the standard Business Central APIs see [API v2.0 overview](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/).\n\n## Request structure\n\n`https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api/softera/softeraEInvoice/v2.0/companies({companyId})/{endpoint}`\n\n| Part | Value |\n| --- | --- |\n| `{tenantId}` | Tenant ID |\n| `{environment}` | Name of the environment |\n| `softera/softeraEInvoice` | E-Invoice API group name |\n| `v2.0` | API version |\n| `companies({companyId})` | Id of the company, retrieved from the Companies endpoint |\n| `{endpoint}` | Endpoint name |\n\n| Header | Value |\n| --- | --- |\n| Authorization | `Bearer {token}`. Required. |\n| Content-Type | `application/json` |\n| If-Match | Required for PATCH and DELETE. When the eTag provided does not match the current tag on the record, the record is not updated. Use `*` to skip the check. |\n\nAuthentication uses OAuth 2.0 client credentials with a Microsoft Entra application that is registered in\nBusiness Central (Microsoft Entra Applications) with the required permission sets. See\n[Azure App registration](https://instrukcijos.softera.lt/docs/azure-app-registration).\n\n## Performance recommendations\n\n- Use `$expand` to create a master record together with related data (e.g. a customer with `defaultDimensions`,\n or a sales invoice with its lines) in a single request.\n- Use `$batch` when creating or updating many records at once (e.g. journal lines). Business Central allows up to\n 100 operations per `$batch` request. Each operation is evaluated on its own: a failure in one operation does not\n roll back the others, so check the status of every operation in the batch response.\n- For documents with hundreds of lines, post dimensions in a separate `$batch` request instead of expanding\n both lines and `dimensionSetLines` in one request.\n- See [Operational limits for Business Central online](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/operational-limits-online).\n\n## Enum values\n\nFields based on an AL **Enum** are returned with OData name encoding: spaces and special characters are replaced\nby their `_xHHHH_` code, e.g. `Sales Invoice` is returned as `Sales_x0020_Invoice`, `G/L Account` as\n`G_x002F_L_x0020_Account` and a blank value as `_x0020_`. Fields based on an AL **Option** (e.g. job queue entry\n`status`, VAT posting setup `unrealizedVATType`) are returned as plain text, e.g. `On Hold`.\nThe schemas list the values exactly as they are returned; use the same values in request bodies.\n\n## E-Invoice Setup\n\nThe **E-Invoice Setup** page affects customers, vendors, sales and purchase documents:\n\n- **Check VAT Mismatch in API Request (Sales / Purchase)**: enables the check of the API totals\n (`apiTotalAmountExclVAT`, `apiTotalAmountInclVAT`) against the amounts calculated by Business Central. The check runs twice:\n - when the document is read through the API (the response to a create or update, and GET): the amount\n excluding VAT must match, and a VAT difference is corrected only when **Allow VAT Auto Correction** is\n enabled and the difference does not exceed **Max. VAT Difference Allowed** (General Ledger Setup);\n - when the document is posted: both totals must match the document amounts, otherwise posting fails.\n- **Allow API Documents Edit**: documents created via the API are marked \"Created via API\" and cannot be\n edited by users unless this is enabled.\n- **Check Duplicates by Reg. No.** / **Check Duplicates by Name**: customer and vendor creation is rejected\n when a record with the same registration number or name exists.\n- **Assign Default Template** and the Local / EU / Foreign templates: a customer or vendor template is\n assigned automatically by country.\n\nSee [API Setup](https://instrukcijos.softera.lt/docs/api-setup) and [API Process](https://instrukcijos.softera.lt/docs/api-process).\n\n## Common errors\n\n| Error | Description |\n| --- | --- |\n| Amounts excl. VAT doesn't match. | `apiTotalAmountExclVAT` and the amount calculated by Business Central do not match, usually because unit prices differ between systems. |\n| VAT amount mismatched by %1, which exceeds the maximum allowed. | VAT amounts do not match and the difference exceeds **Max. VAT Difference Allowed** in **General Ledger Setup**, or **Allow VAT Auto Correction** is disabled. |\n| Amount 100 and API Total Amount Excl. VAT (ESF) 99 must match. | Raised when the document is posted: the document amount (or amount including VAT) differs from the API total sent in the request. |\n| Sorry, the current permissions prevented the action. | The permission for the object and action is not assigned to the Microsoft Entra application or the user. |\n| No HTTP resource was found that matches the request URI. | The E-Invoice app is not installed, or the API group in the URL is incorrect. |\n| Invalid body. | The request body contains extra symbols, or a field name is incorrect or does not exist. |\n\nA Postman collection with request examples is available on the\n[API overview](https://instrukcijos.softera.lt/docs/api-overview) page.\n", "license": { "name": "Softera", "url": "https://www.softera.lt/en/license-agreement/" } }, "servers": [ { "url": "https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api", "description": "URL for Business Central cloud", "variables": { "tenantId": { "default": "tenantId", "description": "Business Central tenant Id" }, "environment": { "default": "environment", "description": "Business Central environment name" } } }, { "url": "https://{baseURL}:{port}/{serverInstance}/api", "description": "URL for Business Central On-Prem", "variables": { "baseURL": { "default": "baseURL", "description": "Base URL for Business Central server" }, "port": { "default": "7048", "description": "Port To access Business Central on the server" }, "serverInstance": { "default": "serverInstance", "description": "Server instance name of Business Central" } } } ], "security": [ { "OAuth2": [ "https://api.businesscentral.dynamics.com/.default" ] } ], "tags": [ { "name": "Entities", "description": "Lists of available standard and E-Invoice API entities." }, { "name": "Metadata", "description": "OData metadata of the E-Invoice API." }, { "name": "Companies", "description": "Companies in the Business Central environment. Use the company `id` in all E-Invoice requests." }, { "name": "Customers", "description": "Create and manage customer records. See also [Customers guide](https://instrukcijos.softera.lt/docs/api-customer)." }, { "name": "Vendors", "description": "Create and manage vendor records. See also [Vendors guide](https://instrukcijos.softera.lt/docs/api-vendor)." }, { "name": "Vendor Bank Accounts", "description": "Bank accounts linked to a vendor. See also [Vendor Bank Accounts guide](https://instrukcijos.softera.lt/docs/api-vendorbankaccount)." }, { "name": "Salespeople/Purchasers", "description": "Salespeople and purchasers. See also [Salespeople/Purchasers guide](https://instrukcijos.softera.lt/docs/api-salespersonpurchaser)." }, { "name": "Items", "description": "Item (product) master records. See also [Items guide](https://instrukcijos.softera.lt/docs/api-item)." }, { "name": "Dimensions", "description": "Dimension codes used for analysis (e.g. department, project). See also [Dimensions guide](https://instrukcijos.softera.lt/docs/api-dimension)." }, { "name": "Dimension Values", "description": "Values available for a given dimension. See also [Dimension Values guide](https://instrukcijos.softera.lt/docs/api-dimensionvalue)." }, { "name": "VAT Posting Setups", "description": "VAT posting group combinations used for tax calculation. See also [VAT Posting Setups guide](https://instrukcijos.softera.lt/docs/api-vatpostingsetup)." }, { "name": "Deferral Templates", "description": "Deferral templates used to spread revenue/expense recognition over periods. See also [Deferral Templates guide](https://instrukcijos.softera.lt/docs/api-deferraltemplate)." }, { "name": "Sales Orders", "description": "Create and manage sales orders. See also [Sales Orders guide](https://instrukcijos.softera.lt/docs/api-salesorder)." }, { "name": "Sales Order Lines", "description": "Lines of a sales order. See also [Sales Order Lines guide](https://instrukcijos.softera.lt/docs/api-salesorderline)." }, { "name": "Sales Invoices", "description": "Create and manage sales invoices. See also [Sales Invoices guide](https://instrukcijos.softera.lt/docs/api-salesinvoice)." }, { "name": "Sales Invoice Lines", "description": "Lines of a sales invoice. See also [Sales Invoice Lines guide](https://instrukcijos.softera.lt/docs/api-salesinvoiceline)." }, { "name": "Sales Credit Memos", "description": "Create and manage sales credit memos. See also [Sales Credit Memos guide](https://instrukcijos.softera.lt/docs/api-salescreditmemo)." }, { "name": "Sales Credit Memo Lines", "description": "Lines of a sales credit memo. See also [Sales Credit Memo Lines guide](https://instrukcijos.softera.lt/docs/api-salescreditmemoline)." }, { "name": "Purchase Invoices", "description": "Create and manage purchase invoices. See also [Purchase Invoices guide](https://instrukcijos.softera.lt/docs/api-purchaseinvoice)." }, { "name": "Purchase Invoice Lines", "description": "Lines of a purchase invoice. See also [Purchase Invoice Lines guide](https://instrukcijos.softera.lt/docs/api-purchaseinvoiceline)." }, { "name": "Purchase Credit Memos", "description": "Create and manage purchase credit memos. Available from Business Central 22.2. See also [Purchase Credit Memos guide](https://instrukcijos.softera.lt/docs/api-purchasecreditmemo)." }, { "name": "Purchase Credit Memo Lines", "description": "Lines of a purchase credit memo. Available from Business Central 22.2. See also [Purchase Credit Memo Lines guide](https://instrukcijos.softera.lt/docs/api-purchasecreditmemoline)." }, { "name": "Journals", "description": "General journal batches. See also [Journals guide](https://instrukcijos.softera.lt/docs/journals)." }, { "name": "Journal Lines", "description": "Lines of a general journal. Use `$batch` for bulk import. See also [Journal Lines guide](https://instrukcijos.softera.lt/docs/journallines)." }, { "name": "Fixed Assets", "description": "Fixed asset master records. See also [Fixed Assets guide](https://instrukcijos.softera.lt/docs/api-fixedassets)." }, { "name": "FA Depreciation Books", "description": "Depreciation books of a fixed asset. See also [FA Depreciation Books guide](https://instrukcijos.softera.lt/docs/api-fixedassets)." }, { "name": "Transfer Orders", "description": "Transfer stock between locations. See also [Transfer Orders guide](https://instrukcijos.softera.lt/docs/api-transferorder)." }, { "name": "Transfer Order Lines", "description": "Lines of a transfer order. See also [Transfer Order Lines guide](https://instrukcijos.softera.lt/docs/api-transferorderline)." }, { "name": "Item Tracking Lines", "description": "Serial/lot tracking information for transfer order lines. See also [Item Tracking Lines guide](https://instrukcijos.softera.lt/docs/api-itemtrackingline)." }, { "name": "Customer Ledger Entries", "description": "Posted customer ledger entries. See also [Customer Ledger Entries guide](https://instrukcijos.softera.lt/docs/api-customerledgerentries)." }, { "name": "Applied Customer Entries (deprecated)", "description": "Application records between customer entries. Deprecated, no longer maintained. See also [Applied Customer Entries (deprecated) guide](https://instrukcijos.softera.lt/docs/api-appliedcustomerentries)." }, { "name": "User Setups", "description": "User-specific setup and permissions. See also [User Setups guide](https://instrukcijos.softera.lt/docs/api-usersetup)." }, { "name": "Job Queue Entries", "description": "Scheduled background job entries. See also [Job Queue Entries guide](https://instrukcijos.softera.lt/docs/api-jobqueueentry)." } ], "paths": { "/softera/softeraEInvoice/v2.0/companies({companyId})/salesCreditMemos({salesCreditMemoId})": { "summary": "Sales Credit Memo", "parameters": [ { "$ref": "#/components/parameters/companyId" }, { "$ref": "#/components/parameters/salesCreditMemoId" } ], "delete": { "operationId": "deleteSalesCreditMemo", "tags": [ "Sales Credit Memos" ], "summary": "Delete Sales Credit Memo", "description": "Deletes a draft sales credit memo together with its lines.\nDeleting a posted credit memo is subject to the standard Business Central rules for deleting posted documents and normally fails.\n", "parameters": [ { "$ref": "#/components/parameters/ifMatch" } ], "responses": { "204": { "$ref": "#/components/responses/204" }, "401": { "$ref": "#/components/responses/401" }, "404": { "$ref": "#/components/responses/404" } } } } }, "components": { "parameters": { "companyId": { "name": "companyId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "GUID for targeted Company", "example": "54c4066e-2b2b-4118-ac75-7dfea25be205" }, "salesCreditMemoId": { "name": "salesCreditMemoId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "SystemId (GUID) of the sales credit memo", "example": "1ef44eac-0700-4693-89c3-99e20ca6cb13" }, "ifMatch": { "name": "If-Match", "in": "header", "required": true, "description": "ETag for concurrency (use `*` to force update)", "schema": { "type": "string", "example": "*" } } }, "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/unauthorizedRequest" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/notFoundRequest" } } } } }, "securitySchemes": { "OAuth2": { "type": "oauth2", "flows": { "clientCredentials": { "tokenUrl": "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token", "scopes": { "https://api.businesscentral.dynamics.com/.default": "Grants the permissions assigned to the Microsoft Entra ID application in Business Central" } } } } }, "schemas": { "unauthorizedRequest": { "title": "Unauthorized Request", "type": "object", "properties": { "error": { "type": "object", "properties": { "code": { "type": "string", "default": "Unauthorized" }, "message": { "type": "string", "default": "The credentials provided are incorrect" } } } } }, "notFoundRequest": { "title": "Not Found Request", "type": "object", "properties": { "error": { "type": "object", "properties": { "code": { "type": "string", "example": "BadRequest_ResourceNotFound" }, "message": { "type": "string", "example": "Resource not found for the segment 'dimensionValues'. CorrelationId: fc7b9039-73d9-48d2-a9d3-9a8e0f8b91da." } } } } } } } } ````