Rules
Part of the Inventory API. Base URL https://your-domain.com/admin/api/v1 — replace the host with your own installation and the token placeholder with a real Bearer token (see Authentication).
List rules
GET/admin/api/v1/inventories/rulesRetrieve a paginated list of rules with filtering and sorting
🔒 Requires a valid Bearer token.
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: sourceLocation, destinationLocation, route, operationType, partnerAddress, warehouse, propagateWarehouse, company, creator | route,operationType |
filter[id] | string | No | Comma-separated list of IDs to filter by | architecto |
filter[name] | string | No | Filter by name | Replenish |
filter[action] | string | No | Filter by action values | pull |
filter[source_location_id] | string | No | Filter by source location IDs | architecto |
filter[destination_location_id] | string | No | Filter by destination location IDs | architecto |
filter[route_id] | string | No | Filter by route IDs | architecto |
filter[operation_type_id] | string | No | Filter by operation type IDs | architecto |
sort | string | No | Sort field | -created_at |
curl -X GET "https://your-domain.com/admin/api/v1/inventories/rules?include=route%2CoperationType&filter%5Bid%5D=architecto&filter%5Bname%5D=Replenish&filter%5Baction%5D=pull&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_id%5D=architecto&filter%5Broute_id%5D=architecto&filter%5Boperation_type_id%5D=architecto&sort=-created_at" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules?include=route%2CoperationType&filter%5Bid%5D=architecto&filter%5Bname%5D=Replenish&filter%5Baction%5D=pull&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_id%5D=architecto&filter%5Broute_id%5D=architecto&filter%5Boperation_type_id%5D=architecto&sort=-created_at", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/inventories/rules?include=route%2CoperationType&filter%5Bid%5D=architecto&filter%5Bname%5D=Replenish&filter%5Baction%5D=pull&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_id%5D=architecto&filter%5Broute_id%5D=architecto&filter%5Boperation_type_id%5D=architecto&sort=-created_at', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules?include=route%2CoperationType&filter%5Bid%5D=architecto&filter%5Bname%5D=Replenish&filter%5Baction%5D=pull&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_id%5D=architecto&filter%5Broute_id%5D=architecto&filter%5Boperation_type_id%5D=architecto&sort=-created_at"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"data": [
{
"id": 1,
"name": "WH: Vendors → Stock",
"sort": 1,
"route_sort": 9,
"delay": 0,
"group_propagation_option": "propagate",
"action": "pull",
"procure_method": "make_to_stock",
"auto": "manual",
"push_domain": null,
"location_dest_from_rule": false,
"propagate_cancel": false,
"propagate_carrier": false,
"created_at": "2026-10-12T09:59:23.000000Z",
"updated_at": "2026-10-12T09:59:23.000000Z",
"deleted_at": null
},
{
"id": 1,
"name": "WH: Vendors → Stock",
"sort": 1,
"route_sort": 9,
"delay": 0,
"group_propagation_option": "propagate",
"action": "pull",
"procure_method": "make_to_stock",
"auto": "manual",
"push_domain": null,
"location_dest_from_rule": false,
"propagate_cancel": false,
"propagate_carrier": false,
"created_at": "2026-10-12T09:59:23.000000Z",
"updated_at": "2026-10-12T09:59:23.000000Z",
"deleted_at": null
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "/?page=1",
"label": "1",
"page": 1,
"active": true
},
{
"url": null,
"label": "Next »",
"page": null,
"active": false
}
],
"path": "/",
"per_page": 10,
"to": 2,
"total": 2
}
}Error response — 401
{
"message": "Unauthenticated."
}Create rule
POST/admin/api/v1/inventories/rulesCreate a new rule
🔒 Requires a valid Bearer token.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Rule name. Must not be greater than 255 characters. |
action | string | Yes | Rule action. |
operation_type_id | integer | Yes | Operation type ID. Must match an existing stored value. |
source_location_id | integer | Yes | Source location ID. Must match an existing stored value. |
destination_location_id | integer | Yes | Destination location ID. Must match an existing stored value. |
partner_address_id | integer | No | Partner address ID. Must match an existing stored value. |
delay | integer | No | Lead time in days. Must be at least 0. |
route_id | integer | Yes | Route ID. Must match an existing stored value. |
company_id | integer | No | Company ID. Must match an existing stored value. |
curl -X POST "https://your-domain.com/admin/api/v1/inventories/rules" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "WH1: Stock -> Output",
"action": "pull",
"operation_type_id": 1,
"source_location_id": 3,
"destination_location_id": 4,
"partner_address_id": 10,
"delay": 1,
"route_id": 1,
"company_id": 1
}'const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "WH1: Stock -> Output",
"action": "pull",
"operation_type_id": 1,
"source_location_id": 3,
"destination_location_id": 4,
"partner_address_id": 10,
"delay": 1,
"route_id": 1,
"company_id": 1
}),
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/inventories/rules', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'WH1: Stock -> Output',
'action' => 'pull',
'operation_type_id' => 1,
'source_location_id' => 3,
'destination_location_id' => 4,
'partner_address_id' => 10,
'delay' => 1,
'route_id' => 1,
'company_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "WH1: Stock -> Output",
"action": "pull",
"operation_type_id": 1,
"source_location_id": 3,
"destination_location_id": 4,
"partner_address_id": 10,
"delay": 1,
"route_id": 1,
"company_id": 1,
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 201
{
"data": {
"id": 1,
"name": "WH: Vendors → Stock",
"sort": 1,
"route_sort": 9,
"delay": 0,
"group_propagation_option": "propagate",
"action": "pull",
"procure_method": "make_to_stock",
"auto": "manual",
"push_domain": null,
"location_dest_from_rule": false,
"propagate_cancel": false,
"propagate_carrier": false,
"created_at": "2026-10-12T09:59:23.000000Z",
"updated_at": "2026-10-12T09:59:23.000000Z",
"deleted_at": null
},
"message": "Rule created successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Show rule
GET/admin/api/v1/inventories/rules/{id}Retrieve a specific rule by ID
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The rule ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: sourceLocation, destinationLocation, route, operationType, partnerAddress, warehouse, propagateWarehouse, company, creator | route,sourceLocation |
curl -X GET "https://your-domain.com/admin/api/v1/inventories/rules/{id}?include=route%2CsourceLocation" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules/{id}?include=route%2CsourceLocation", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/inventories/rules/{id}?include=route%2CsourceLocation', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules/{id}?include=route%2CsourceLocation"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"data": {
"id": 1,
"name": "WH: Vendors → Stock",
"sort": 1,
"route_sort": 9,
"delay": 0,
"group_propagation_option": "propagate",
"action": "pull",
"procure_method": "make_to_stock",
"auto": "manual",
"push_domain": null,
"location_dest_from_rule": false,
"propagate_cancel": false,
"propagate_carrier": false,
"created_at": "2026-10-12T09:59:23.000000Z",
"updated_at": "2026-10-12T09:59:23.000000Z",
"deleted_at": null
}
}Error response — 401
{
"message": "Unauthenticated."
}Update rule
PUT/admin/api/v1/inventories/rules/{id}Update an existing rule
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The rule ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Rule name. Must not be greater than 255 characters. |
action | string | No | Rule action. |
operation_type_id | integer | No | Operation type ID. Must match an existing stored value. |
source_location_id | integer | No | Source location ID. Must match an existing stored value. |
destination_location_id | integer | No | Destination location ID. Must match an existing stored value. |
partner_address_id | integer | No | Partner address ID. Must match an existing stored value. |
delay | integer | No | Lead time in days. Must be at least 0. |
route_id | integer | No | Route ID. Must match an existing stored value. |
company_id | integer | No | Company ID. Must match an existing stored value. |
curl -X PUT "https://your-domain.com/admin/api/v1/inventories/rules/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "WH1: Stock -> Output",
"action": "pull",
"operation_type_id": 1,
"source_location_id": 3,
"destination_location_id": 4,
"partner_address_id": 10,
"delay": 1,
"route_id": 1,
"company_id": 1
}'const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules/{id}", {
method: "PUT",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "WH1: Stock -> Output",
"action": "pull",
"operation_type_id": 1,
"source_location_id": 3,
"destination_location_id": 4,
"partner_address_id": 10,
"delay": 1,
"route_id": 1,
"company_id": 1
}),
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-domain.com/admin/api/v1/inventories/rules/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'WH1: Stock -> Output',
'action' => 'pull',
'operation_type_id' => 1,
'source_location_id' => 3,
'destination_location_id' => 4,
'partner_address_id' => 10,
'delay' => 1,
'route_id' => 1,
'company_id' => 1,
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "WH1: Stock -> Output",
"action": "pull",
"operation_type_id": 1,
"source_location_id": 3,
"destination_location_id": 4,
"partner_address_id": 10,
"delay": 1,
"route_id": 1,
"company_id": 1,
}
response = requests.put(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 200
{
"data": {
"id": 1,
"name": "WH: Vendors → Stock",
"sort": 1,
"route_sort": 9,
"delay": 0,
"group_propagation_option": "propagate",
"action": "pull",
"procure_method": "make_to_stock",
"auto": "manual",
"push_domain": null,
"location_dest_from_rule": false,
"propagate_cancel": false,
"propagate_carrier": false,
"created_at": "2026-10-12T09:59:23.000000Z",
"updated_at": "2026-10-12T09:59:23.000000Z",
"deleted_at": null
},
"message": "Rule updated successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Delete rule
DELETE/admin/api/v1/inventories/rules/{id}Soft delete a rule
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The rule ID |
curl -X DELETE "https://your-domain.com/admin/api/v1/inventories/rules/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules/{id}", {
method: "DELETE",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/inventories/rules/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.delete(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"message": "Rule deleted successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Restore rule
POST/admin/api/v1/inventories/rules/{id}/restoreRestore a soft deleted rule
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The rule ID |
curl -X POST "https://your-domain.com/admin/api/v1/inventories/rules/{id}/restore" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules/{id}/restore", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/inventories/rules/{id}/restore', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules/{id}/restore"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.post(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"data": {
"id": 1,
"name": "WH: Vendors → Stock",
"sort": 1,
"route_sort": 9,
"delay": 0,
"group_propagation_option": "propagate",
"action": "pull",
"procure_method": "make_to_stock",
"auto": "manual",
"push_domain": null,
"location_dest_from_rule": false,
"propagate_cancel": false,
"propagate_carrier": false,
"created_at": "2026-10-12T09:59:23.000000Z",
"updated_at": "2026-10-12T09:59:23.000000Z",
"deleted_at": null
},
"message": "Rule restored successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Force delete rule
DELETE/admin/api/v1/inventories/rules/{id}/forcePermanently delete a rule
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The rule ID |
curl -X DELETE "https://your-domain.com/admin/api/v1/inventories/rules/{id}/force" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/inventories/rules/{id}/force", {
method: "DELETE",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/inventories/rules/{id}/force', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/rules/{id}/force"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.delete(url, headers=headers)
data = response.json()
print(data)Example response 200
{
"message": "Rule permanently deleted successfully."
}Error response — 401
{
"message": "Unauthenticated."
}