curl --request DELETE \
--url https://api.fabric.inc/v3/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fabric.inc/v3/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fabric.inc/v3/products', 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://api.fabric.inc/v3/products",
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: Bearer <token>"
],
]);
$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://api.fabric.inc/v3/products"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.fabric.inc/v3/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"success": [
{
"id": "6d7329dfd5288b0011332311",
"sku": "AAWEDDERW21"
}
],
"errors": [
{
"id": "6d7329dfd5288b0011332311",
"sku": "AAWE1234CCVFDDERW21",
"message": [
"Product 6d7329dfd5288b0011332311 is associated with bundle ID 5f7329dfd5288b0011332322"
]
}
]
}
]
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find or create product"
}
]
}{
"type": "UNAUTHORIZED_ERROR",
"message": "The requester is unauthorized"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "PAYLOAD_LIMIT_EXCEEDED_ERROR",
"message": "Payload exceeds maximum configured size"
}{
"message": "Internal Server Error",
"type": "SERVER_ERROR"
}Delete Multiple Products
To keep the product list (catalog) up to date and current, it’s important to remove products that are discontinued permanently. With this endpoint, you can delete up to 25 products either by SKUs or IDs. Note:
1. Unless all products are deleted, this endpoint fails.
2. To delete a single product, you can use either the ID-based (DELETE /products/{id}) or SKU-based endpoint (DELETE /products/sku/{sku}).
curl --request DELETE \
--url https://api.fabric.inc/v3/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fabric.inc/v3/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fabric.inc/v3/products', 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://api.fabric.inc/v3/products",
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: Bearer <token>"
],
]);
$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://api.fabric.inc/v3/products"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.fabric.inc/v3/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"success": [
{
"id": "6d7329dfd5288b0011332311",
"sku": "AAWEDDERW21"
}
],
"errors": [
{
"id": "6d7329dfd5288b0011332311",
"sku": "AAWE1234CCVFDDERW21",
"message": [
"Product 6d7329dfd5288b0011332311 is associated with bundle ID 5f7329dfd5288b0011332322"
]
}
]
}
]
}{
"message": "Request is invalid",
"type": "Bad request",
"errors": [
{
"type": "CLIENT_ERROR",
"message": "Invalid request. Unable to find or create product"
}
]
}{
"type": "UNAUTHORIZED_ERROR",
"message": "The requester is unauthorized"
}{
"type": "REQUEST_DENIED",
"message": "User doesn't have the required permission"
}{
"type": "PAYLOAD_LIMIT_EXCEEDED_ERROR",
"message": "Payload exceeds maximum configured size"
}{
"message": "Internal Server Error",
"type": "SERVER_ERROR"
}Authorizations
S2S access token (JWT) from fabric Identity service (during Login)
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
"517fa9dfd42d8b00g1o3k312"
Unique request ID
"263e731c-45c8-11ed-b878-0242ac120002"
Query Parameters
Comma-separated locale codes of product. The service throws a 400 error if the locale isn't supported. Standard locales can be found at https://www.rfc-editor.org/rfc/rfc5646.
Note: The recommended way to get the locale is by invoking multi-channel service.
"fr-CA%2Cen-US"
Unique product ID that maps to fabric's standard attribute called SKU.
Note: sku shouldn't include ; or =
^[^;=]*$"XP-123345"
true(default): Delete variants of the product
false: Don't delete variants of the product and make them regular items.
Note: This parameter will have no impact if the status is DRAFT.
Comma-separated product IDs
"Q1WW1233DDFRE112F,WE223RRTYUHBVVDD"
Determines the version of the product applicable for this operation (endpoint action).
1. If the status is 'DRAFT', this operation will only impact the Draft version of the product, if it exists.
2. If the status is 'ALL', this operation applies to both the Draft and Live versions of the product.
DRAFT, LIVE, ALL "LIVE"
Response
OK
Delete product response
Show child attributes
Show child attributes
Was this page helpful?
