curl --request POST \
--url https://api.exowpee.com/v1/catalog/stock-regularizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"motif": "<string>",
"lines": [
{
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"inventory_group_id": "<string>",
"asset_id": "<string>",
"total_cost": 123,
"unit_cost": 123,
"cost_remainder": 123,
"total_cost_minor": 1,
"unit_cost_minor": 1,
"cost_remainder_minor": 1
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/stock-regularizations"
payload = {
"motif": "<string>",
"lines": [
{
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"inventory_group_id": "<string>",
"asset_id": "<string>",
"total_cost": 123,
"unit_cost": 123,
"cost_remainder": 123,
"total_cost_minor": 1,
"unit_cost_minor": 1,
"cost_remainder_minor": 1
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
motif: '<string>',
lines: [
{
stockable_id: '<string>',
quantity: 123,
stockable_unit_id: '<string>',
inventory_group_id: '<string>',
asset_id: '<string>',
total_cost: 123,
unit_cost: 123,
cost_remainder: 123,
total_cost_minor: 1,
unit_cost_minor: 1,
cost_remainder_minor: 1
}
]
})
};
fetch('https://api.exowpee.com/v1/catalog/stock-regularizations', 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://api.exowpee.com/v1/catalog/stock-regularizations",
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([
'motif' => '<string>',
'lines' => [
[
'stockable_id' => '<string>',
'quantity' => 123,
'stockable_unit_id' => '<string>',
'inventory_group_id' => '<string>',
'asset_id' => '<string>',
'total_cost' => 123,
'unit_cost' => 123,
'cost_remainder' => 123,
'total_cost_minor' => 1,
'unit_cost_minor' => 1,
'cost_remainder_minor' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/stock-regularizations"
payload := strings.NewReader("{\n \"motif\": \"<string>\",\n \"lines\": [\n {\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"inventory_group_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"total_cost\": 123,\n \"unit_cost\": 123,\n \"cost_remainder\": 123,\n \"total_cost_minor\": 1,\n \"unit_cost_minor\": 1,\n \"cost_remainder_minor\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/stock-regularizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"motif\": \"<string>\",\n \"lines\": [\n {\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"inventory_group_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"total_cost\": 123,\n \"unit_cost\": 123,\n \"cost_remainder\": 123,\n \"total_cost_minor\": 1,\n \"unit_cost_minor\": 1,\n \"cost_remainder_minor\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/stock-regularizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"motif\": \"<string>\",\n \"lines\": [\n {\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"inventory_group_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"total_cost\": 123,\n \"unit_cost\": 123,\n \"cost_remainder\": 123,\n \"total_cost_minor\": 1,\n \"unit_cost_minor\": 1,\n \"cost_remainder_minor\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"motif": "<string>",
"input_mode": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"lines": "<array>"
}{
"message": "<string>",
"errors": {}
}Correct stock quantities
Records a stock correction with a reason and lines, raising or lowering quantities to match what is really on the shelf. Used after a count or to fix errors.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/stock-regularizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"motif": "<string>",
"lines": [
{
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"inventory_group_id": "<string>",
"asset_id": "<string>",
"total_cost": 123,
"unit_cost": 123,
"cost_remainder": 123,
"total_cost_minor": 1,
"unit_cost_minor": 1,
"cost_remainder_minor": 1
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/stock-regularizations"
payload = {
"motif": "<string>",
"lines": [
{
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"inventory_group_id": "<string>",
"asset_id": "<string>",
"total_cost": 123,
"unit_cost": 123,
"cost_remainder": 123,
"total_cost_minor": 1,
"unit_cost_minor": 1,
"cost_remainder_minor": 1
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
motif: '<string>',
lines: [
{
stockable_id: '<string>',
quantity: 123,
stockable_unit_id: '<string>',
inventory_group_id: '<string>',
asset_id: '<string>',
total_cost: 123,
unit_cost: 123,
cost_remainder: 123,
total_cost_minor: 1,
unit_cost_minor: 1,
cost_remainder_minor: 1
}
]
})
};
fetch('https://api.exowpee.com/v1/catalog/stock-regularizations', 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://api.exowpee.com/v1/catalog/stock-regularizations",
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([
'motif' => '<string>',
'lines' => [
[
'stockable_id' => '<string>',
'quantity' => 123,
'stockable_unit_id' => '<string>',
'inventory_group_id' => '<string>',
'asset_id' => '<string>',
'total_cost' => 123,
'unit_cost' => 123,
'cost_remainder' => 123,
'total_cost_minor' => 1,
'unit_cost_minor' => 1,
'cost_remainder_minor' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/stock-regularizations"
payload := strings.NewReader("{\n \"motif\": \"<string>\",\n \"lines\": [\n {\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"inventory_group_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"total_cost\": 123,\n \"unit_cost\": 123,\n \"cost_remainder\": 123,\n \"total_cost_minor\": 1,\n \"unit_cost_minor\": 1,\n \"cost_remainder_minor\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/stock-regularizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"motif\": \"<string>\",\n \"lines\": [\n {\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"inventory_group_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"total_cost\": 123,\n \"unit_cost\": 123,\n \"cost_remainder\": 123,\n \"total_cost_minor\": 1,\n \"unit_cost_minor\": 1,\n \"cost_remainder_minor\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/stock-regularizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"motif\": \"<string>\",\n \"lines\": [\n {\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"inventory_group_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"total_cost\": 123,\n \"unit_cost\": 123,\n \"cost_remainder\": 123,\n \"total_cost_minor\": 1,\n \"unit_cost_minor\": 1,\n \"cost_remainder_minor\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"motif": "<string>",
"input_mode": "<string>",
"created_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"lines": "<array>"
}{
"message": "<string>",
"errors": {}
}stock_regularizations.create
Conditions
- motif, input_mode (difference or final_stock) and at least one line are required.
- Each line must target exactly one of inventory_group_id (a lot group) or asset_id (a location).
- The item must be tracked in inventory and not archived.
- A line targeting a lot group must use the item of that group; the group must be a single lot (one level, one cost, one supplier), otherwise it is refused as invalid.
- The target location (or the location of the group) must be a location the company is allowed to use.
- A stockable_unit_id must belong to the item and be active, and the current quantity must be expressible in that unit.
- In final_stock mode quantity is the counted quantity and cannot be negative; in difference mode quantity is the signed change; the resulting stock cannot be negative.
- A line that would not change the stock is refused.
- Two lines on the same item and target are merged in difference mode (refused if either carries a manual cost) and refused in final_stock mode.
- A location line and a lot group line on the same item and location cannot be mixed in one request.
- When a line raises the stock of a location that currently holds none of the item, exactly one cost input is required (total_cost, unit_cost or their _minor forms), and unit_cost needs cost_remainder, unit_cost_minor needs cost_remainder_minor; in other cases cost inputs are ignored.
- Stock increases need the item to be tracked in inventory, otherwise the line is refused.
- Creates the correction and its lines; it cannot be edited or deleted afterwards.
- A negative change removes stock from the target (oldest lots first) and a positive change adds stock, both recorded in the stock history under the regularization operation.
- Added stock on a lot group keeps the cost and supplier of that lot; on a location with existing stock it is valued at the average cost of the current stock; on an empty location it uses the manual cost sent.
- Records the member who created it in created_by_user_id.
- A POST answers 204 by default; add ?response=resource to receive the created correction with status 201.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, motif, input_mode, created_by_user_id, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: lines, lines.stockable, lines.stockableUnit.
Body
Reason for the correction (for example an inventory count), required, up to 250 characters.
250How the line quantities are read. difference: quantity is the signed change to apply (positive adds, negative removes). final_stock: quantity is the counted quantity that must remain after the correction. Required.
difference, final_stock Lines of the correction, at least one. Each line targets one lot group or one location for one item.
1Show child attributes
Show child attributes
Response
Resource (only with response=resource).
Identifier of the stock correction (27-character KSUID).
Reason given for the correction, up to 250 characters.
How line quantities were read: difference (signed change) or final_stock (counted quantity).
Identifier of the member who recorded the correction; null when it could not be determined.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Lines of the correction; only present when selected with the include query parameter.