Get inventory item - Fabric
Get inventory item
cURL
curl --request GET \
--url https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/ \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/",
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>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/"
req, _ := http.NewRequest("GET", 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))
}
Java (Unirest)
HttpResponse<String> response = Unirest.get("https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Response
{
"inventory_updated_at": "2024-04-15T12:00:00Z",
"inventory_last_submitted_at": "2024-04-15T12:05:00Z",
"brand_inventory_updated_at": "2024-04-14T08:30:00Z",
"sellable_updated_at": "2024-04-10T09:15:00Z",
"estimated_availability_date": "2024-05-01",
"connection": "conn-12345",
"variant": "SKU-001-BLUE",
"inventory_policy": "managed",
"inventory": "150",
"discontinued": false,
"discontinued_updated_at": "2024-03-01T10:00:00Z",
"replenishable": true,
"sellable": "yes",
"locations": "Warehouse A, Warehouse B"
}
Authorizations
- Authorization: required, string header,
Bearer <token>
Path Parameters
- retailer_id: required, integer, unique retailer ID.
- id: required, integer, unique inventory item identifier.
Response 200 - application/json
- inventory_updated_at: string, timestamp when the inventory was last updated.
- inventory_last_submitted_at: string, timestamp of last inventory submission.
- brand_inventory_updated_at: string, brand last updated inventory timestamp.
- sellable_updated_at: string, last updated sellable status timestamp.
- estimated_availability_date: string, estimated product availability date.
- connection: string, read-only connection through which inventory is managed.
- variant: string, read-only product variant (SKU).
- inventory_policy: enum, inventory management strategy.
- inventory: string, read-only current inventory quantity.
- discontinued: boolean, read-only product discontinued status.
- discontinued_updated_at: string, timestamp of last update of discontinued status.
- replenishable: boolean, read-only replenishment indication.
- sellable: string, read-only current sellable status.
- locations: string, read-only list of locations for inventory.