Update a subscription discount
curl --request PUT \
--url https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discount": {
"amount": 10
},
"message": "Offer terms and conditions",
"skus": [
"MOBO-X570"
],
"categories": [
"holiday-best-sellers"
],
"frequency": {
"shippingFrequency": 1,
"shippingFrequencyType": "daily",
"billingFrequency": 1,
"billingFrequencyType": "daily"
},
"itemQuantity": 1,
"channel": "WEBSITE",
"target": "PDP"
}
'import requests
url = "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}"
payload = {
"discount": { "amount": 10 },
"message": "Offer terms and conditions",
"skus": ["MOBO-X570"],
"categories": ["holiday-best-sellers"],
"frequency": {
"shippingFrequency": 1,
"shippingFrequencyType": "daily",
"billingFrequency": 1,
"billingFrequencyType": "daily"
},
"itemQuantity": 1,
"channel": "WEBSITE",
"target": "PDP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
discount: {amount: 10},
message: 'Offer terms and conditions',
skus: ['MOBO-X570'],
categories: ['holiday-best-sellers'],
frequency: {
shippingFrequency: 1,
shippingFrequencyType: 'daily',
billingFrequency: 1,
billingFrequencyType: 'daily'
},
itemQuantity: 1,
channel: 'WEBSITE',
target: 'PDP'
})
};
fetch('https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}', 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://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'discount' => [
'amount' => 10
],
'message' => 'Offer terms and conditions',
'skus' => [
'MOBO-X570'
],
'categories' => [
'holiday-best-sellers'
],
'frequency' => [
'shippingFrequency' => 1,
'shippingFrequencyType' => 'daily',
'billingFrequency' => 1,
'billingFrequencyType' => 'daily'
],
'itemQuantity' => 1,
'channel' => 'WEBSITE',
'target' => 'PDP'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}"
payload := strings.NewReader("{\n \"discount\": {\n \"amount\": 10\n },\n \"message\": \"Offer terms and conditions\",\n \"skus\": [\n \"MOBO-X570\"\n ],\n \"categories\": [\n \"holiday-best-sellers\"\n ],\n \"frequency\": {\n \"shippingFrequency\": 1,\n \"shippingFrequencyType\": \"daily\",\n \"billingFrequency\": 1,\n \"billingFrequencyType\": \"daily\"\n },\n \"itemQuantity\": 1,\n \"channel\": \"WEBSITE\",\n \"target\": \"PDP\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"discount\": {\n \"amount\": 10\n },\n \"message\": \"Offer terms and conditions\",\n \"skus\": [\n \"MOBO-X570\"\n ],\n \"categories\": [\n \"holiday-best-sellers\"\n ],\n \"frequency\": {\n \"shippingFrequency\": 1,\n \"shippingFrequencyType\": \"daily\",\n \"billingFrequency\": 1,\n \"billingFrequencyType\": \"daily\"\n },\n \"itemQuantity\": 1,\n \"channel\": \"WEBSITE\",\n \"target\": \"PDP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"discount\": {\n \"amount\": 10\n },\n \"message\": \"Offer terms and conditions\",\n \"skus\": [\n \"MOBO-X570\"\n ],\n \"categories\": [\n \"holiday-best-sellers\"\n ],\n \"frequency\": {\n \"shippingFrequency\": 1,\n \"shippingFrequencyType\": \"daily\",\n \"billingFrequency\": 1,\n \"billingFrequencyType\": \"daily\"\n },\n \"itemQuantity\": 1,\n \"channel\": \"WEBSITE\",\n \"target\": \"PDP\"\n}"
response = http.request(request)
puts response.read_body{
"responseStatus": "OK",
"message": "Request processed successfully",
"data": {
"id": "62d9196aeec12800095633f2",
"status": "ACTIVE",
"offerCode": "SUB-D45DD7",
"validity": {
"startDate": "2022-07-21T13:14:51.474Z",
"endDate": "2022-07-21T13:14:51.474Z",
"applyOnOrders": [
2,
3
]
},
"message": "Offer terms and conditions",
"discount": {
"amount": 10
},
"skus": [
"MOBO-X570"
],
"categories": [
"holiday-best-sellers"
],
"frequency": {
"shippingFrequency": 1,
"shippingFrequencyType": "daily",
"billingFrequency": 1,
"billingFrequencyType": "daily"
},
"itemQuantity": 1,
"channel": "WEBSITE",
"target": "PDP",
"customerSegment": [
"employee"
],
"isDeleted": false,
"DeletedAt": "2019-01-01T00:00:00.000Z",
"createdAt": "2021-10-12T21:35:05.756Z",
"updatedAt": "2021-10-14T05:40:55.997Z"
}
}{
"responseStatus": "BAD_REQUEST",
"message": "Bad request"
}{
"Message": "User is not authorized to access this resource with an explicit deny"
}{
"responseStatus": "NOT_FOUND",
"message": "Not found"
}Subscription Discounts
Update a subscription discount
Update a subscription discount for a specified offer (specified by offer ID)
PUT
/
v1
/
subscriptionDiscount
/
{offerId}
Update a subscription discount
curl --request PUT \
--url https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"discount": {
"amount": 10
},
"message": "Offer terms and conditions",
"skus": [
"MOBO-X570"
],
"categories": [
"holiday-best-sellers"
],
"frequency": {
"shippingFrequency": 1,
"shippingFrequencyType": "daily",
"billingFrequency": 1,
"billingFrequencyType": "daily"
},
"itemQuantity": 1,
"channel": "WEBSITE",
"target": "PDP"
}
'import requests
url = "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}"
payload = {
"discount": { "amount": 10 },
"message": "Offer terms and conditions",
"skus": ["MOBO-X570"],
"categories": ["holiday-best-sellers"],
"frequency": {
"shippingFrequency": 1,
"shippingFrequencyType": "daily",
"billingFrequency": 1,
"billingFrequencyType": "daily"
},
"itemQuantity": 1,
"channel": "WEBSITE",
"target": "PDP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
discount: {amount: 10},
message: 'Offer terms and conditions',
skus: ['MOBO-X570'],
categories: ['holiday-best-sellers'],
frequency: {
shippingFrequency: 1,
shippingFrequencyType: 'daily',
billingFrequency: 1,
billingFrequencyType: 'daily'
},
itemQuantity: 1,
channel: 'WEBSITE',
target: 'PDP'
})
};
fetch('https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}', 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://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'discount' => [
'amount' => 10
],
'message' => 'Offer terms and conditions',
'skus' => [
'MOBO-X570'
],
'categories' => [
'holiday-best-sellers'
],
'frequency' => [
'shippingFrequency' => 1,
'shippingFrequencyType' => 'daily',
'billingFrequency' => 1,
'billingFrequencyType' => 'daily'
],
'itemQuantity' => 1,
'channel' => 'WEBSITE',
'target' => 'PDP'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}"
payload := strings.NewReader("{\n \"discount\": {\n \"amount\": 10\n },\n \"message\": \"Offer terms and conditions\",\n \"skus\": [\n \"MOBO-X570\"\n ],\n \"categories\": [\n \"holiday-best-sellers\"\n ],\n \"frequency\": {\n \"shippingFrequency\": 1,\n \"shippingFrequencyType\": \"daily\",\n \"billingFrequency\": 1,\n \"billingFrequencyType\": \"daily\"\n },\n \"itemQuantity\": 1,\n \"channel\": \"WEBSITE\",\n \"target\": \"PDP\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"discount\": {\n \"amount\": 10\n },\n \"message\": \"Offer terms and conditions\",\n \"skus\": [\n \"MOBO-X570\"\n ],\n \"categories\": [\n \"holiday-best-sellers\"\n ],\n \"frequency\": {\n \"shippingFrequency\": 1,\n \"shippingFrequencyType\": \"daily\",\n \"billingFrequency\": 1,\n \"billingFrequencyType\": \"daily\"\n },\n \"itemQuantity\": 1,\n \"channel\": \"WEBSITE\",\n \"target\": \"PDP\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01.copilot.fabric.inc/data-subscription/v1/subscriptionDiscount/{offerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"discount\": {\n \"amount\": 10\n },\n \"message\": \"Offer terms and conditions\",\n \"skus\": [\n \"MOBO-X570\"\n ],\n \"categories\": [\n \"holiday-best-sellers\"\n ],\n \"frequency\": {\n \"shippingFrequency\": 1,\n \"shippingFrequencyType\": \"daily\",\n \"billingFrequency\": 1,\n \"billingFrequencyType\": \"daily\"\n },\n \"itemQuantity\": 1,\n \"channel\": \"WEBSITE\",\n \"target\": \"PDP\"\n}"
response = http.request(request)
puts response.read_body{
"responseStatus": "OK",
"message": "Request processed successfully",
"data": {
"id": "62d9196aeec12800095633f2",
"status": "ACTIVE",
"offerCode": "SUB-D45DD7",
"validity": {
"startDate": "2022-07-21T13:14:51.474Z",
"endDate": "2022-07-21T13:14:51.474Z",
"applyOnOrders": [
2,
3
]
},
"message": "Offer terms and conditions",
"discount": {
"amount": 10
},
"skus": [
"MOBO-X570"
],
"categories": [
"holiday-best-sellers"
],
"frequency": {
"shippingFrequency": 1,
"shippingFrequencyType": "daily",
"billingFrequency": 1,
"billingFrequencyType": "daily"
},
"itemQuantity": 1,
"channel": "WEBSITE",
"target": "PDP",
"customerSegment": [
"employee"
],
"isDeleted": false,
"DeletedAt": "2019-01-01T00:00:00.000Z",
"createdAt": "2021-10-12T21:35:05.756Z",
"updatedAt": "2021-10-14T05:40:55.997Z"
}
}{
"responseStatus": "BAD_REQUEST",
"message": "Bad request"
}{
"Message": "User is not authorized to access this resource with an explicit deny"
}{
"responseStatus": "NOT_FOUND",
"message": "Not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Offer ID General object ID
Example:
"606f01f441b8fc0008529916"
Body
application/json
Details used to update discount
Details used to update discount
Discount detail
Show child attributes
Show child attributes
Merchant discount message
Example:
"Offer terms and conditions"
SKUs
SKU
Product categories
Product category
Shipping frequency details
Show child attributes
Show child attributes
Number of items
Example:
1
Channel
Available options:
WEBSITE, POS Example:
"WEBSITE"
Discount target
Available options:
PDP, CART, QUICK VIEW, SUBSCRIPTION MANAGEMENT PORTAL Example:
"PDP"
Was this page helpful?
⌘I
