Delete Category
curl --request DELETE \
--url https://qwoty.app/api/categories/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://qwoty.app/api/categories/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://qwoty.app/api/categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://qwoty.app/api/categories/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://qwoty.app/api/categories/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://qwoty.app/api/categories/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/categories/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"deleted": true
}
}
Categories
Delete Category
Soft delete a product category
DELETE
/
api
/
categories
/
{id}
Delete Category
curl --request DELETE \
--url https://qwoty.app/api/categories/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://qwoty.app/api/categories/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://qwoty.app/api/categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://qwoty.app/api/categories/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://qwoty.app/api/categories/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://qwoty.app/api/categories/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/categories/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"deleted": true
}
}
Authorization
string
required
Bearer token for authentication. Format:
Bearer qwoty_your_tokenPath Parameters
string
required
Category UUID
Behavior
This endpoint performs a soft delete by setting thedeleted_at timestamp on the category. The category will no longer appear in standard API queries but is not permanently removed from the database.
Deletion is blocked if the category is referenced by active discounts. In
that case, you will receive a
409 Conflict error. You must first remove or
update the discount references before deleting the category.Examples
curl -X DELETE https://qwoty.app/api/categories/550e8400-e29b-41d4-a716-446655440001 \
-H "Authorization: Bearer qwoty_your_token"
const categoryId = '550e8400-e29b-41d4-a716-446655440001'
const response = await fetch(`https://qwoty.app/api/categories/${categoryId}`, {
method: 'DELETE',
headers: {
Authorization: 'Bearer qwoty_your_token',
},
})
const data = await response.json()
import requests
category_id = '550e8400-e29b-41d4-a716-446655440001'
response = requests.delete(
f'https://qwoty.app/api/categories/{category_id}',
headers={
'Authorization': 'Bearer qwoty_your_token'
}
)
data = response.json()
Response
boolean
Indicates whether the request was successful
object
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"deleted": true
}
}
Error Responses
{
"success": false,
"error": "Category not found"
}
{
"success": false,
"error": "CATEGORY_REFERENCED_IN_DISCOUNT"
}
Cascade Effects
When a category is deleted:- Products linked to this category through
category_idsretain the reference (soft delete doesn’t cascade) - Child categories (with
parent_category_idpointing to this category) are not automatically deleted - Price percentage rules scoped to this category remain intact
To permanently remove all traces of a category, you should first: 1. Remove
the category from all products (
category_ids field) 2. Update or delete all
discounts referencing this category 3. Reassign or delete child categories 4.
Then delete the categoryWas this page helpful?

