## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://developer.fabric.inc/llms.txt)

Use this file to discover all available pages before exploring further.

### cURL

```bash
curl --request POST \
  --url https://api.fabric.inc/v3/shipments/inventory-transfer/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-channel-id: <x-fabric-channel-id>' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '
{
  "filters": "{\n        \"retail\": {\n            \"locationNum\": 12\n        },\n        \"orderSubTotal\": {\n            \"lt\": 1400\n        },\n        \"orderNumber\": {order-*Z},\n        \"statusCode\": [\n            \"ORDER_CREATED\"\n        ],\n        \"createdAt\":{\n            \"lt\": \"2022-09-11T23:12:00.123Z\"\n        },\n        \"shipInfo\": {\n            \"shipToId\": [\"23434\",\"23436\"]\n        }\n    }\n",
  "limit": 10,
  "offset": 0,
  "sortBy": "updatedAt",
  "sortDirection": "desc"
}
' 
```

### Python Example

```python
import requests

url = "https://api.fabric.inc/v3/shipments/inventory-transfer/query"

payload = {
    "filters": "{\n        \"retail\": {\n            \"locationNum\": 12\n        },\n        \"orderSubTotal\": {\n            \"lt\": 1400\n        },\n        \"orderNumber\": {order-*Z},\n        \"statusCode\": [\n            \"ORDER_CREATED\"\n        ],\n        \"createdAt\":{\n            \"lt\": \"2022-09-11T23:12:00.123Z\"\n        },\n        \"shipInfo\": {\n            \"shipToId\": [\"23434\",\"23436\"]\n        }\n    }\n",
    "limit": 10,
    "offset": 0,
    "sortBy": "updatedAt",
    "sortDirection": "desc"
}
headers = {
    "x-fabric-tenant-id": "<x-fabric-tenant-id>",
    "x-fabric-channel-id": "<x-fabric-channel-id>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### JavaScript (Fetch) Example

```javascript
const options = {
  method: 'POST',
  headers: {
    'x-fabric-tenant-id': '<x-fabric-tenant-id>',
    'x-fabric-channel-id': '<x-fabric-channel-id>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    filters: '{\n        \"retail\": {\n            \"locationNum\": 12\n        },\n        \"orderSubTotal\": {\n            \"lt\": 1400\n        },\n        \"orderNumber\": {order-*Z},\n        \"statusCode\": [\n            \"ORDER_CREATED\"\n        ],\n        \"createdAt\":{\n            \"lt\": \"2022-09-11T23:12:00.123Z\"\n        },\n        \"shipInfo\": {\n            \"shipToId\": [\"23434\",\"23436\"]\n        }\n    }\n',
    limit: 10,
    offset: 0,
    sortBy: 'updatedAt',
    sortDirection: 'desc'
  })
};

fetch('https://api.fabric.inc/v3/shipments/inventory-transfer/query', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### PHP Example

```php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.fabric.inc/v3/shipments/inventory-transfer/query",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'filters' => '{\
        \"retail\": {\
            \"locationNum\": 12\
        },\
        \"orderSubTotal\": {\
            \"lt\": 1400\
        },\
        \"orderNumber\": {order-*Z},\
        \"statusCode\": [\
            \"ORDER_CREATED\"]\
        },\
        \"createdAt\":{\
            \"lt\": \"2022-09-11T23:12:00.123Z\
        },\
        \"shipInfo\": {\
            \"shipToId\": [\"23434\",\"23436\"]\
        }\
    }\
",
    'limit' => 10,
    'offset' => 0,
    'sortBy' => 'updatedAt',
    'sortDirection' => 'desc'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "x-fabric-channel-id: <x-fabric-channel-id>",
    "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;
}
```

### Example Response

```json
{
  "count": 100,
  "limit": 10,
  "offset": 1
}
```

### Error Responses

```json
{
  "errors": [
    {
      "message": "Invalid request",
      "type": "CLIENT_ERROR"
    }
  ],
  "message": "Bad request",
  "type": "CLIENT_ERROR"
}
```

```json
{
  "message": "Unauthorized request",
  "type": "CLIENT_ERROR"
}
```

```json
{
  "message": "Internal server error",
  "type": "SERVER_ERROR"
}
```

### Authorizations

- **Authorization**: Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

### Headers Required
- **x-fabric-tenant-id**: A header used by Fabric to identify the tenant making the request. This header is required.
- **x-fabric-channel-id**: Identifies the sales channel where the API request is made. This field is required.
