Delete API: Deleting Records Using DELETE

DELETE · Safety Checks

Delete API

Delete records securely. With built-in safety checks to prevent accidental deletion of dependent data.

DELETE /xpanel/xoport/Delete/JSON/{entity}/{id}
Attention—Starting with version 2.70.0, the method is enforced: The endpoints at Delete/JSON/ accept only the HTTP method DELETE. The interface answers any other method with 405 METHOD_NOT_ALLOWED and the header field Allow: DELETE—before anything else happens. Please check your integration: Previously, the method was not checked here; a call using GET deleted as well. If your program uses GET or POST, please switch it to DELETE.

Available Endpoints

EndpointDescriptionScopeSafety Checks
DELETE /Delete/JSON/product/{id}Delete Productproducts:delete-
DELETE /Delete/JSON/categories/{id}Delete Categorycategories:deleteSubcategories, Products
DELETE /Delete/JSON/customer/{id}Delete customercustomers:deleteOrders
DELETE /Delete/JSON/manufacturer/{id}Delete manufacturermanufacturers:deleteProducts
DELETE /Delete/JSON/supplier/{id}Delete suppliersuppliers:deleteProducts
DELETE /Delete/JSON/customer_group/{id}Delete customer groupcustomer_groups:deleteGroup 0 protected (403 PROTECTED_GROUP), assigned customers (409 HAS_CUSTOMERS)
DELETE /Delete/JSON/newsdesk/{id}Delete News Articlenews:delete-
DELETE /Delete/JSON/newsdeskcat/{id}Delete a news categorynewscategories:deleteSubcategories, Articles
DELETE /Delete/JSON/faq/{id}Delete FAQfaq:delete-
DELETE /Delete/JSON/faqcat/{id}Delete FAQ Categoryfaqcategories:deleteSubcategories, FAQ Entries
DELETE /Delete/JSON/cms/{id}Delete CMS Pagecms:deleteSystem pages with IDs 1 through 999 (409 PROTECTED_SYSTEM_PAGE), locked pages (409 CONTENT_LOCKED)
DELETE /Delete/JSON/seohistory/{id}Delete SEO Historyseohistory:deleteBulk Delete, Filter, Expired
DELETE /Delete/JSON/newsletter_subscriber/{id}Delete Newsletter Subscriber newsletter:deleteGDPR Cascade, Provider Sync, Bulk Delete
DELETE /Delete/JSON/newsletter/{id}Delete newsletter campaign newsletters:deleteLocked Check, Sent Check (409)
DELETE /Delete/JSON/contract/{id}Delete Contractcontracts:deleteBatch via JSON body {"data": [{"contracts_id": …}]}; ⚠️ no lock for linked or open invoices (see Safety Checks)
DELETE /Delete/JSON/ticket/{id}Delete Ticket NEWtickets:deleteCascade: History, Admins, Followers, Appointments, Files
DELETE /Delete/JSON/media/{id}Delete Image NEW v2.16.0media:deleteBatch via ?entity_id= (all images of a product) or JSON body {"ids": […]}; if it was the main image, the product’s image field is cleared
DELETE /Delete/JSON/slider/{id}Delete Slider NEW v2.22.0slider:delete-
DELETE /Delete/JSON/project/{id}Delete xoCRM Project NEW v2.35.0projects:deleteCascade: Tasks, Descriptions, Managers, Customers, Categories, Status History; Orders/Tickets are only decoupled
DELETE /Delete/JSON/project_task/{id}Delete Project Task NEW v2.35.0project_tasks:deleteCascade: Descriptions, Assignees, Customers, Categories, Status History (project remains)
DELETE /Delete/JSON/appointment/{id}Delete Appointment (Soft Delete) NEW v2.44.0appointments:deleteSets deleted_at (CalDAV tombstone); descriptions and links are preserved
DELETE /Delete/JSON/order_status_history/{id}Delete an order history entry NEW v2.95.0orders:writeOrder status is updated; oldest entry is protected (409)
DELETE /Delete/JSON/ticket_status_history/{id}Delete a ticket history entry NEW v2.95.0tickets:deleteTicket status is updated
DELETE /Delete/JSON/ticket_attachment/{tshid}?filename=…Remove a ticket attachment NEW v2.97.0tickets:deleteFile only if no other entry refers to it
DELETE /Delete/JSON/ticket_department/{id}Delete ticket department NEW v2.103.0tickets:deleteIn use: 409 – ?reassign_to={id} or ?force=1

The ID goes in the path (/{entity}/{id}). Without it, for example with ?products_id=42, the shop responds with HTTP 400 MISSING_ID and deletes nothing; it silently ignores unknown query parameters in this case. Without an ID in the path, only media, SEO History, newsletter subscribers and contracts are deleted, via filters or a JSON body. Without either, the response is HTTP 400 (NO_TARGETS, MISSING_FILTER, or MISSING_DATA).

Send the ID as an integer without extra characters, decimal places or a sign. The strict validation of the path segment that the export has had since v2.122.12 (see Export API) does not apply to delete.


Safety Checks

Certain resources cannot be deleted if dependent data exists (HTTP 409; nothing is deleted):

Categories

  • HAS_SUBCATEGORIES: Has subcategories
  • HAS_PRODUCTS: Contains products

News Categories

  • HAS_SUBCATEGORIES: Has subcategories
  • HAS_NEWS: Contains news articles

Customers

  • HAS_ORDERS: Has orders
Contracts without a lock: DELETE /Delete/JSON/contract/{id} and the batch via JSON body delete a contract even if invoices are linked to it or still open, just like deleting in the backend. The orders themselves remain; only the link to the contract is removed. A direct debit via SEPA mandate then no longer reaches these invoices. Check the invoices before deleting: the linked ones are in orders[] of GET /Export/JSON/contract/{id}, each with its order status orders_status. Whether a status counts as paid is shown by is_paid in GET /Export/JSON/order_statuses (Orders, section “Order Status Master Data”); the order itself is returned by GET /Export/JSON/order/{orders_id}.

Query Parameters v2.122.10

Every query parameter of a Delete endpoint has a rule. It is checked before the shop deletes anything: an unusable value or a list value (?param[]=…) results in HTTP 400 INVALID_FILTER_VALUE, details[] names param and message for each error, and nothing is deleted.

EndpointParameter and rule
Every Delete endpointlanguage a single value (list rule only; no Delete endpoint reads the language)
DELETE /media(s)entity_id integer
DELETE /seohistory(s)type c, s, m, p, n or o · base_id integer · expired switch 0/1 · seo_string Since v2.122.11 not applied: HTTP 400, nothing deleted
DELETE /ticket_attachment/{id}filename file name without path; if it is missing, HTTP 400 MISSING_FILENAME, with a path HTTP 400 INVALID_FILENAME
DELETE /ticket_department/{id}reassign_to integer from 0 (the department the tickets move to) · force 1/true/yes or 0/false/no, case-insensitive
  • An empty value or whitespace only means “not set”. Leading or trailing whitespace has not counted since v2.122.12: deletion uses the validated value. In shops before 4.9.173, send values without leading or trailing whitespace and omit empty parameters. Valid values without leading or trailing whitespace work as before.
  • The Delete endpoint silently ignores unknown parameter names, unlike the export.
  • Since v2.122.11 The address filter seo_string only takes effect on GET. You find the entries for an old address with GET /Export/JSON/seohistorys?seo_string=… and delete them via their sh_id: DELETE /Delete/JSON/seohistory/{sh_id} or with the body {"type": "seohistory", "data": [{"sh_id": …}]}. Up to v2.122.10, the name was ignored and deletion was based on type and base_id alone, so ?type=p deleted every product entry.
DELETE /Delete/JSON/seohistorys?type=p&base_id=abc

HTTP 400
{
  "success": false,
  "api_version": "2.122.12",
  "error": {
    "code": "INVALID_FILTER_VALUE",
    "message": "One or more query parameter values could not be used. Nothing was deleted — see \"details\"."
  },
  "details": [
    { "param": "base_id", "message": "Value \"abc\" is not an integer." }
  ]
}
Changed in v2.122.10: Up to v2.122.9, each Delete endpoint read its parameters itself, and an unusable value silently affected what was deleted: DELETE /seohistorys?type=p&base_id[]=42 (as well as base_id=abc) deleted all entries of type p, ?type=p&expired=yes deleted all of them instead of the expired ones; DELETE /ticket_department/{id}?reassign_to[]=5 moved the tickets to department 1, ?reassign_to=5abc to department 5. Now HTTP 400, and nothing is deleted.
Changed in v2.122.12: Up to v2.122.11, the shop validated the values without leading or trailing whitespace, but the delete endpoint then read the untrimmed value. Now it deletes based on the validated value. ⚠️ It never deletes more than the validated values say, but it does delete more than before: requests that were rejected up to v2.122.11 for lack of an effective condition now delete (rows with ⚠️).
Requestup to v2.122.11from v2.122.12
DELETE /seohistorys?type=p&base_id=42%00deleted every entry of type ponly the entries of product 42
DELETE /seohistorys?type=%20p&base_id=42deleted the entries of every type for ID 42only those of type p for ID 42
DELETE /seohistorys?type=p&expired=1%00the condition was dropped: deleted every entry of type ponly the expired ones of type p
⚠️ DELETE /seohistorys?type=%20p without a further filterHTTP 400 MISSING_FILTER, nothing deleteddeletes all entries of type p
⚠️ DELETE /seohistorys?base_id=42%00 or ?expired=1%00 aloneHTTP 400 MISSING_FILTER, nothing deleteddeletes all entries of ID 42 or all expired ones
⚠️ DELETE /medias?entity_id=7%00HTTP 400 NO_TARGETS or only the IDs from the bodyadditionally all images of product 7: entity_id selects targets, it does not restrict
⚠️ DELETE /ticket_department/{id}?reassign_to=%005HTTP 409 DEPARTMENT_IN_USE, no reassignmenttickets moved to department 5, department deleted
DELETE /ticket_department/{id}?force=%20trueas without forceforce applies

Before the update, check whether your integration sends values with leading or trailing spaces, line breaks, or %00, e.g. from an imported file: such values now count as they read without these characters.

Response Formats

Deletion Successful

{
  "success": true,
  "api_version": "2.122.12",
  "type": "newsdesk",
  "deleted_id": 23,
  "details": {
    "newsdesk_id": 23,
    "newsdesk_article_name": "Gelöschter Artikel"
  },
  "timestamp": "2026-10-18 14:00:00"
}

Deletion blocked

{
  "success": false,
  "api_version": "2.122.12",
  "error": {
    "code": "HAS_SUBCATEGORIES",
    "message": "Cannot delete newsdesk category \"Shopnews\" (ID: 1): Has 3 sub-categories. Delete them first."
  }
}

Be careful when deleting!

Delete operations are irreversible. First, create an export as a backup.

Create an export

Data Import Using the xoPort API

The import endpoints enable efficient data import from external systems. Thanks to intelligent upsert logic, you don’t have to worry about distinguishing between new and existing records.

Best Practices

  • Use batch imports (max. 50 records) for better performance
  • Check the ` errors` array in the response for failed records
  • Implement retry logic for transient errors
  • Validate data on the client side before importing