Get price of a specific item
curl --request GET \
--url https://live.copilot.fabric.inc/api-offers/item/{itemId} \
--header 'Authorization: Bearer <token>' \
--header 'x-site-context: <x-site-context>'import requests
url = "https://live.copilot.fabric.inc/api-offers/item/{itemId}"
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-site-context': '<x-site-context>', Authorization: 'Bearer <token>'}
};
fetch('https://live.copilot.fabric.inc/api-offers/item/{itemId}', 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://live.copilot.fabric.inc/api-offers/item/{itemId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-site-context: <x-site-context>"
],
]);
$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://live.copilot.fabric.inc/api-offers/item/{itemId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-site-context", "<x-site-context>")
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.get("https://live.copilot.fabric.inc/api-offers/item/{itemId}")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.copilot.fabric.inc/api-offers/item/{itemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"channel": [
12,
13
],
"startDate": "2020-08-17T07:39:29.092Z",
"endDate": "2099-12-31T00:00:00.000Z",
"group": [
"5e2cfa5245570b000863c4ab"
],
"title": "Arper Dizzie Oval Coffee Table",
"itemId": 1000000269,
"price": {
"id": "5e31832ccaf608b232bb4cdrr",
"isSoftDeleted": true,
"itemId": 1000000269,
"offerId": 1074,
"createdAt": "2020-08-19T10:53:29.918Z",
"updatedAt": "2020-08-19T10:53:29.918Z",
"offers": [
{
"price": {
"sale": 0,
"base": 229,
"currency": "USD"
},
"channel": 12,
"startDate": "2018-10-19T16:46:45Z",
"endDate": "2099-12-31T00:00:00Z",
"kind": 12
}
],
"query": {
"limit": 10,
"count": 50,
"offset": 0
}
},
"isDefault": true,
"isActive": true,
"attributes": [
{
"attributeGroupId": 123123,
"id": 321321,
"value": "size",
"isDefault": true
}
],
"parent": "5f3a355075cc4900085fb1b1",
"itemFamily": "5f3a3371d9bf7b0007d699d8",
"description": "This smart band's OLED display (300 nits) can show up to 48 characters, thereby letting you view everything with a single glance. The display is fingerprint-coated to offer you a clear view every time.",
"variants": [
"VARIANT-01",
"VARIANT-55"
],
"state": "READY",
"images": [
{
"id": "5fd7577251a93f0007e48383",
"order": 0,
"label": "https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067",
"source": [
{
"id": "5fd7577251a93f0007e48383",
"url": "https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067"
}
]
}
],
"sku": "XMSH99KLW10",
"isSoftDeleted": false
}{
"code": "ITEM_NOT_FOUND",
"message": "Item not found."
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error."
}Item
Get price of a specific item
Retrieves price details of an item by itemId
GET
/
api-offers
/
item
/
{itemId}
Get price of a specific item
curl --request GET \
--url https://live.copilot.fabric.inc/api-offers/item/{itemId} \
--header 'Authorization: Bearer <token>' \
--header 'x-site-context: <x-site-context>'import requests
url = "https://live.copilot.fabric.inc/api-offers/item/{itemId}"
headers = {
"x-site-context": "<x-site-context>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-site-context': '<x-site-context>', Authorization: 'Bearer <token>'}
};
fetch('https://live.copilot.fabric.inc/api-offers/item/{itemId}', 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://live.copilot.fabric.inc/api-offers/item/{itemId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-site-context: <x-site-context>"
],
]);
$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://live.copilot.fabric.inc/api-offers/item/{itemId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-site-context", "<x-site-context>")
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.get("https://live.copilot.fabric.inc/api-offers/item/{itemId}")
.header("x-site-context", "<x-site-context>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://live.copilot.fabric.inc/api-offers/item/{itemId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-site-context"] = '<x-site-context>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"channel": [
12,
13
],
"startDate": "2020-08-17T07:39:29.092Z",
"endDate": "2099-12-31T00:00:00.000Z",
"group": [
"5e2cfa5245570b000863c4ab"
],
"title": "Arper Dizzie Oval Coffee Table",
"itemId": 1000000269,
"price": {
"id": "5e31832ccaf608b232bb4cdrr",
"isSoftDeleted": true,
"itemId": 1000000269,
"offerId": 1074,
"createdAt": "2020-08-19T10:53:29.918Z",
"updatedAt": "2020-08-19T10:53:29.918Z",
"offers": [
{
"price": {
"sale": 0,
"base": 229,
"currency": "USD"
},
"channel": 12,
"startDate": "2018-10-19T16:46:45Z",
"endDate": "2099-12-31T00:00:00Z",
"kind": 12
}
],
"query": {
"limit": 10,
"count": 50,
"offset": 0
}
},
"isDefault": true,
"isActive": true,
"attributes": [
{
"attributeGroupId": 123123,
"id": 321321,
"value": "size",
"isDefault": true
}
],
"parent": "5f3a355075cc4900085fb1b1",
"itemFamily": "5f3a3371d9bf7b0007d699d8",
"description": "This smart band's OLED display (300 nits) can show up to 48 characters, thereby letting you view everything with a single glance. The display is fingerprint-coated to offer you a clear view every time.",
"variants": [
"VARIANT-01",
"VARIANT-55"
],
"state": "READY",
"images": [
{
"id": "5fd7577251a93f0007e48383",
"order": 0,
"label": "https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067",
"source": [
{
"id": "5fd7577251a93f0007e48383",
"url": "https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067"
}
]
}
],
"sku": "XMSH99KLW10",
"isSoftDeleted": false
}{
"code": "ITEM_NOT_FOUND",
"message": "Item not found."
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error."
}Authorizations
Headers
The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.
Example:
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Query Parameters
Response
OK
Was this page helpful?
