curl --request DELETE \
--url https://api.fabric.inc/v3/promotions/{promotionId} \
--header 'Authorization: Bearer <token>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>'import requests
url = "https://api.fabric.inc/v3/promotions/{promotionId}"
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-fabric-tenant-id': '<x-fabric-tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.fabric.inc/v3/promotions/{promotionId}', 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/promotions/{promotionId}",
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>",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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/promotions/{promotionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
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/promotions/{promotionId}")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/promotions/{promotionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "6380e7ecb419a30009865fad",
"name": "Black Friday Promotion",
"status": "SCHEDULED",
"startAt": "2019-08-24T14:15:22.000Z",
"endAt": "2019-08-25T14:15:22.000Z",
"type": "PRODUCT",
"createdAt": "2019-08-20T14:15:22.000Z",
"updatedAt": "2019-08-20T14:15:22.000Z",
"level": 3,
"stackingType": "STACKABLE",
"isStackable": false,
"isAlwaysApplied": false,
"additionalAttributes": [
{
"name": "type",
"values": "Birthday",
"attributeId": 100000
}
],
"promotionMessages": [
{
"title": "Buy 2 get 1 free",
"message": "Offer valid at participating stores through September 5, 2023.",
"pages": [
"PDP",
"Cart"
],
"locales": [
"en-CA",
"fr-CA"
]
}
]
}{
"type": "PROMO_CANNOT_BE_DELETED",
"message": "Promotion can only be deleted in scheduled status"
}{
"type": "UNAUTHORIZED",
"message": "Invalid credentials"
}{
"type": "PROMOTION_NOT_FOUND",
"message": "The promotion you entered doesn't exist"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Delete a specific promotion
Delete a specific promotion using the corresponding promotionId.
curl --request DELETE \
--url https://api.fabric.inc/v3/promotions/{promotionId} \
--header 'Authorization: Bearer <token>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>'import requests
url = "https://api.fabric.inc/v3/promotions/{promotionId}"
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-fabric-tenant-id': '<x-fabric-tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.fabric.inc/v3/promotions/{promotionId}', 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/promotions/{promotionId}",
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>",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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/promotions/{promotionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
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/promotions/{promotionId}")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/promotions/{promotionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "6380e7ecb419a30009865fad",
"name": "Black Friday Promotion",
"status": "SCHEDULED",
"startAt": "2019-08-24T14:15:22.000Z",
"endAt": "2019-08-25T14:15:22.000Z",
"type": "PRODUCT",
"createdAt": "2019-08-20T14:15:22.000Z",
"updatedAt": "2019-08-20T14:15:22.000Z",
"level": 3,
"stackingType": "STACKABLE",
"isStackable": false,
"isAlwaysApplied": false,
"additionalAttributes": [
{
"name": "type",
"values": "Birthday",
"attributeId": 100000
}
],
"promotionMessages": [
{
"title": "Buy 2 get 1 free",
"message": "Offer valid at participating stores through September 5, 2023.",
"pages": [
"PDP",
"Cart"
],
"locales": [
"en-CA",
"fr-CA"
]
}
]
}{
"type": "PROMO_CANNOT_BE_DELETED",
"message": "Promotion can only be deleted in scheduled status"
}{
"type": "UNAUTHORIZED",
"message": "Invalid credentials"
}{
"type": "PROMOTION_NOT_FOUND",
"message": "The promotion you entered doesn't exist"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}Authorizations
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.
24A unique identifier obtained from Copilot for the System app in the fabric ecosystem, essential for OpenID Connect authentication flows.
Path Parameters
The promotion ID generated when using the create promotion endpoint.
Response
OK
The details of the promotion.
A 24-character system-generated The promotion ID generated when using the create promotion endpoint.
"6380e7ecb419a30009865fad"
The type of promotion you want to create. The following are the promotion types you can create:
PRODUCT: A SKU promotion. Applies a discount to SKUs based on the value specified in thediscountobject of the request body.CART: A cart promotion. Applies a discount to the minimum order amount of the cart based on theORDER_VALUEspecified in theconditionobject of the request body.QUANTITY: A quantity promotion. Provides discounts on items based on the quantity requirement set in the promotion.SHIPPING: A shipping promotion. Provides discounts on the shipping cost.BUYGET: A BuyGet promotion. Specifies the Buy conditions and corresponding Get discounts.SPEND_GET: A SpendGet promotion. Specifies the total order value required to qualify for discounts and the applicable discounts based on the order value.
PRODUCT, CART, QUANTITY, SHIPPING, BUYGET, SPEND_GET "PRODUCT"
Promotion execution order. Promotion types are assigned a default execution order. First, level 1 promotions will be evaluated. The result of level 1 will be used as a base price for level 2. Similarly, the result of level 2 will be used as a base price for level 3.
0 <= x <= 53
Defines the rules for how a promotion can be combined with other promotions. This field determines whether a specific promotion can be applied in conjunction with other active promotions during a transaction or if it must be used exclusively. If configured, stackingType will have precedence over the isStackable and isAlwaysApplied. The following are possible stackingType values:
STACKABLE: This promotion can be combined with other stackable promotions, allowing multiple discounts to be applied together. The order in which stackable promotions are applied is determined by thelevelfield, with promotions having a higher priority (lower numeric value) being applied before those with a lower priority.EXCLUSIVE: This promotion can't be combined with any other promotions. Thelevelfield is used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive promotion is applied, no other promotions can be used in the same transaction.TYPE_EXCLUSIVE: This promotion can't be combined with other promotions of the same type. Thelevelfield is used to determine which promotion within the same type will be evaluated and applied first.UNIVERSAL: This promotion can be combined with any other promotions without restrictions. Universal promotions will be evaluated last.
STACKABLE, EXCLUSIVE, TYPE_EXCLUSIVE, UNIVERSAL "STACKABLE"
Was this page helpful?
