## List inventory

### cURL

```
curl --request GET \
  --url https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/ \
  --header 'Authorization: Bearer <token>'
```

```
import requests

url = "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

```
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/', 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://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/",\
  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;
}
```

```
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

url := "https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/"

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))
}
```

```
HttpResponse<String> response = Unirest.get("https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```
require 'uri'
require 'net/http'

url = URI("https://marketplace-api.fabric.inc/v1/retailers/{retailer_id}/inventory/")

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

```json
{
  "count": 2231,
  "results": [
    {
      "inventory": 50,
      "id": 9876,
      "updated_at": "2024-04-18T14:22:00Z",
      "event": "restock",
      "location": "Main Warehouse",
      "user": "admin@example.com"
    }
  ],
  "next": "https://api.example.org/demo/accounts/?page=2",
  "previous": "https://api.example.org/demo/accounts/?page=1"
}
```

### Authorizations

Authorization

- **Type**: string
- **Location**: header
- **Required**: Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

### Path Parameters

- **retailer_id**: integer, required
   - The unique retailer ID. In the Dropship UI this is called the Merchant ID.
   - **Example**: `1001`

### Response Details

- **200 - application/json**
  - **count**: integer, required - Total number of records
    - **Example**: `2231`
  - **results**: object[], required - Show child attributes
  - **next**: string<uri> | null - Next page (applicable in a paginated response)
    - **Example**: `"https://api.example.org/demo/accounts/?page=2"`
  - **previous**: string<uri> | null - Previous page (applicable in a paginated response)
    - **Example**: `"https://api.example.org/demo/accounts/?page=1"`
