Scraps
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 scraps
GET/admin/api/v1/inventories/scrapsRetrieve a paginated list of scraps 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: product, uom, lot, package, partner, operation, sourceLocation, destinationLocation, company, creator, tags, moves, moveLines | product,sourceLocation |
filter[id] | string | No | Comma-separated list of IDs to filter by | architecto |
filter[name] | string | No | Filter by scrap name | SP/1 |
filter[state] | string | No | Filter by scrap state | draft |
filter[product_id] | string | No | Filter by product IDs | architecto |
filter[source_location_id] | string | No | Filter by source location IDs | architecto |
filter[destination_location_id] | string | No | Filter by destination location IDs | architecto |
sort | string | No | Sort field | -created_at |
curl -X GET "https://your-domain.com/admin/api/v1/inventories/scraps?include=product%2CsourceLocation&filter%5Bid%5D=architecto&filter%5Bname%5D=SP%2F1&filter%5Bstate%5D=draft&filter%5Bproduct_id%5D=architecto&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_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/scraps?include=product%2CsourceLocation&filter%5Bid%5D=architecto&filter%5Bname%5D=SP%2F1&filter%5Bstate%5D=draft&filter%5Bproduct_id%5D=architecto&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_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/scraps?include=product%2CsourceLocation&filter%5Bid%5D=architecto&filter%5Bname%5D=SP%2F1&filter%5Bstate%5D=draft&filter%5Bproduct_id%5D=architecto&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_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/scraps?include=product%2CsourceLocation&filter%5Bid%5D=architecto&filter%5Bname%5D=SP%2F1&filter%5Bstate%5D=draft&filter%5Bproduct_id%5D=architecto&filter%5Bsource_location_id%5D=architecto&filter%5Bdestination_location_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": "SP/00001",
"origin": null,
"state": "draft",
"qty": 1,
"should_replenish": false,
"closed_at": null,
"created_at": "2026-10-12T10:00:29.000000Z",
"updated_at": "2026-10-12T10:00:29.000000Z"
},
{
"id": 1,
"name": "SP/00001",
"origin": null,
"state": "draft",
"qty": 1,
"should_replenish": false,
"closed_at": null,
"created_at": "2026-10-12T10:00:29.000000Z",
"updated_at": "2026-10-12T10:00:29.000000Z"
}
],
"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 scrap
POST/admin/api/v1/inventories/scrapsCreate a new scrap
🔒 Requires a valid Bearer token.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
origin | string | No | Source document reference. Must not be greater than 255 characters. |
qty | number | Yes | Quantity to scrap. Must be at least 1. Must not be greater than 99999999999. |
product_id | integer | Yes | Product ID. Must match an existing stored value. |
uom_id | integer | No | Unit of measure ID. Must match an existing stored value. |
lot_id | integer | No | Lot ID. Must match an existing stored value. |
package_id | integer | No | Package ID. Must match an existing stored value. |
partner_id | integer | No | Owner partner 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 scrap location ID. Must match an existing stored value. |
company_id | integer | No | Company ID. Must match an existing stored value. |
tags | integer[] | No | Must match an existing stored value. |
curl -X POST "https://your-domain.com/admin/api/v1/inventories/scraps" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"origin": "WH/OUT/0001",
"qty": 2,
"product_id": 1,
"uom_id": 1,
"lot_id": 1,
"package_id": 1,
"partner_id": 1,
"source_location_id": 1,
"destination_location_id": 2,
"company_id": 1,
"tags": [
16
]
}'const response = await fetch("https://your-domain.com/admin/api/v1/inventories/scraps", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"origin": "WH/OUT/0001",
"qty": 2,
"product_id": 1,
"uom_id": 1,
"lot_id": 1,
"package_id": 1,
"partner_id": 1,
"source_location_id": 1,
"destination_location_id": 2,
"company_id": 1,
"tags": [
16
]
}),
});
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/scraps', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'origin' => 'WH/OUT/0001',
'qty' => 2,
'product_id' => 1,
'uom_id' => 1,
'lot_id' => 1,
'package_id' => 1,
'partner_id' => 1,
'source_location_id' => 1,
'destination_location_id' => 2,
'company_id' => 1,
'tags' => [
16,
],
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/scraps"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"origin": "WH/OUT/0001",
"qty": 2,
"product_id": 1,
"uom_id": 1,
"lot_id": 1,
"package_id": 1,
"partner_id": 1,
"source_location_id": 1,
"destination_location_id": 2,
"company_id": 1,
"tags": [
16,
],
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 201
{
"data": {
"id": 1,
"name": "SP/00001",
"origin": null,
"state": "draft",
"qty": 1,
"should_replenish": false,
"closed_at": null,
"created_at": "2026-10-12T10:00:29.000000Z",
"updated_at": "2026-10-12T10:00:29.000000Z"
},
"message": "Scrap created successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Show scrap
GET/admin/api/v1/inventories/scraps/{id}Retrieve a specific scrap by ID
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The scrap ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: product, uom, lot, package, partner, operation, sourceLocation, destinationLocation, company, creator, tags, moves, moveLines | product,company |
curl -X GET "https://your-domain.com/admin/api/v1/inventories/scraps/{id}?include=product%2Ccompany" \
-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/scraps/{id}?include=product%2Ccompany", {
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/scraps/{id}?include=product%2Ccompany', [
'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/scraps/{id}?include=product%2Ccompany"
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": "SP/00001",
"origin": null,
"state": "draft",
"qty": 1,
"should_replenish": false,
"closed_at": null,
"created_at": "2026-10-12T10:00:29.000000Z",
"updated_at": "2026-10-12T10:00:29.000000Z"
}
}Error response — 401
{
"message": "Unauthenticated."
}Update scrap
PUT/admin/api/v1/inventories/scraps/{id}Update an existing scrap
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The scrap ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
origin | string | No | Source document reference. Must not be greater than 255 characters. |
qty | number | No | Quantity to scrap. Must be at least 1. Must not be greater than 99999999999. |
product_id | integer | No | Product ID. Must match an existing stored value. |
uom_id | integer | No | Unit of measure ID. Must match an existing stored value. |
lot_id | integer | No | Lot ID. Must match an existing stored value. |
package_id | integer | No | Package ID. Must match an existing stored value. |
partner_id | integer | No | Owner partner 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 scrap location ID. Must match an existing stored value. |
company_id | integer | No | Company ID. Must match an existing stored value. |
tags | integer[] | No | Must match an existing stored value. |
curl -X PUT "https://your-domain.com/admin/api/v1/inventories/scraps/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"origin": "WH/OUT/0001",
"qty": 2,
"product_id": 1,
"uom_id": 1,
"lot_id": 1,
"package_id": 1,
"partner_id": 1,
"source_location_id": 1,
"destination_location_id": 2,
"company_id": 1,
"tags": [
16
]
}'const response = await fetch("https://your-domain.com/admin/api/v1/inventories/scraps/{id}", {
method: "PUT",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"origin": "WH/OUT/0001",
"qty": 2,
"product_id": 1,
"uom_id": 1,
"lot_id": 1,
"package_id": 1,
"partner_id": 1,
"source_location_id": 1,
"destination_location_id": 2,
"company_id": 1,
"tags": [
16
]
}),
});
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/scraps/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'origin' => 'WH/OUT/0001',
'qty' => 2,
'product_id' => 1,
'uom_id' => 1,
'lot_id' => 1,
'package_id' => 1,
'partner_id' => 1,
'source_location_id' => 1,
'destination_location_id' => 2,
'company_id' => 1,
'tags' => [
16,
],
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/inventories/scraps/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"origin": "WH/OUT/0001",
"qty": 2,
"product_id": 1,
"uom_id": 1,
"lot_id": 1,
"package_id": 1,
"partner_id": 1,
"source_location_id": 1,
"destination_location_id": 2,
"company_id": 1,
"tags": [
16,
],
}
response = requests.put(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 200
{
"data": {
"id": 1,
"name": "SP/00001",
"origin": null,
"state": "draft",
"qty": 1,
"should_replenish": false,
"closed_at": null,
"created_at": "2026-10-12T10:00:29.000000Z",
"updated_at": "2026-10-12T10:00:29.000000Z"
},
"message": "Scrap updated successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Delete scrap
DELETE/admin/api/v1/inventories/scraps/{id}Delete a scrap
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The scrap ID |
curl -X DELETE "https://your-domain.com/admin/api/v1/inventories/scraps/{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/scraps/{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/scraps/{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/scraps/{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": "Scrap deleted successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Validate scrap
POST/admin/api/v1/inventories/scraps/{id}/validateValidate a draft scrap and update stock quantities
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The scrap ID |
curl -X POST "https://your-domain.com/admin/api/v1/inventories/scraps/{id}/validate" \
-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/scraps/{id}/validate", {
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/scraps/{id}/validate', [
'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/scraps/{id}/validate"
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": "SP/00001",
"origin": null,
"state": "draft",
"qty": 1,
"should_replenish": false,
"closed_at": null,
"created_at": "2026-10-12T10:00:29.000000Z",
"updated_at": "2026-10-12T10:00:29.000000Z"
},
"message": "Scrap validated successfully."
}Error response — 401
{
"message": "Unauthenticated."
}