Stock transfers
Stock moving between companies or locations. Hand-built: the record has no single owning company - it carries gencompanyidfrom and gencompanyidto - so the generic engine would treat it as install-wide and show every company's transfers to everyone.
The object#
| Field | Type | Description |
|---|---|---|
| id | integer | NolaPro id. |
| name | string(100) | What the transfer is called. |
| comment | string(65535) | Free text. |
| status | string | Where the transfer is in its life. Labels are Invcotransfer_model::$statuses; stored as an int and never exposed as one. One of newunassigned, assigned, accepted, picked, shipped, receivedcompleted. |
| gencompanyidfrom | integer | Company sending. |
| gencompanyidto | integer | Company receiving. |
| inventorylocationidfrom | integer | Location sending. |
| inventorylocationidto | integer | Location receiving. |
| duedate | string | When it is due. |
| assigneddate | string | When it was assigned. |
| assigneduserid | integer | Who it is assigned to. |
| pickcompleteddate | string | When picking finished. |
| shippeddate | string | When it shipped. |
| receiveddate | string | When it was received. |
| orderid | integer | Order that triggered it, or 0. |
| cancel | boolean | Cancelled transfers stay readable. |
| entrydate | string | When it was raised. |
| lastpostdate | string | Last time stock moved for it. |
Endpoints#
Inter-company and inter-location stock transfers.
Stock moving between companies or locations.
A transfer is raised, assigned, picked, shipped and received, and status says where it is. The line records both what was sent and what was ordered, so a short send is visible - shrinkage lives in the gap between the two.
These records span two companies by design. A transfer is visible to the sender and the receiver, and to nobody else: gencompanyidfrom or gencompanyidto must be yours.
Requires scope items:read.
| Name | In | Type | Notes |
|---|---|---|---|
| status | query | string | Restrict to one status: newunassigned, assigned, accepted, picked, shipped or receivedcompleted. |
| cancel | query | string | Defaults to false. Pass true or any. |
curl \ 'https://acme.nolapro.com/!/api/v2/inventorytransfers' \ -H 'Authorization: Bearer $NP_TOKEN'
$ch = curl_init('https://acme.nolapro.com/!/api/v2/inventorytransfers'); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('NP_TOKEN')], CURLOPT_RETURNTRANSFER => true, ]); $res = json_decode(curl_exec($ch), true);
import os, requests r = requests.get( "https://acme.nolapro.com/!/api/v2/inventorytransfers", headers={"Authorization": f"Bearer {os.environ['NP_TOKEN']}"}, ) r.raise_for_status()
const res = await fetch( 'https://acme.nolapro.com/!/api/v2/inventorytransfers', { method: 'GET', headers: { Authorization: `Bearer ${process.env.NP_TOKEN}` }, } ); const data = await res.json();
using System.Net.Http.Json; var token = Environment.GetEnvironmentVariable("NP_TOKEN"); using var http = new HttpClient(); http.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); var res = await http.GetAsync( "https://acme.nolapro.com/!/api/v2/inventorytransfers"); res.EnsureSuccessStatusCode();
One transfer.
The transfer header. Its lines are at /inventorytransfers/{id}/lines.
Requires scope items:read.
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | integer |
| Status | Code | Meaning |
|---|---|---|
| 404 | not_found | No such record in this company. |
curl \ 'https://acme.nolapro.com/!/api/v2/inventorytransfers/104' \ -H 'Authorization: Bearer $NP_TOKEN'
$ch = curl_init('https://acme.nolapro.com/!/api/v2/inventorytransfers/104'); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('NP_TOKEN')], CURLOPT_RETURNTRANSFER => true, ]); $res = json_decode(curl_exec($ch), true);
import os, requests r = requests.get( "https://acme.nolapro.com/!/api/v2/inventorytransfers/104", headers={"Authorization": f"Bearer {os.environ['NP_TOKEN']}"}, ) r.raise_for_status()
const res = await fetch( 'https://acme.nolapro.com/!/api/v2/inventorytransfers/104', { method: 'GET', headers: { Authorization: `Bearer ${process.env.NP_TOKEN}` }, } ); const data = await res.json();
using System.Net.Http.Json; var token = Environment.GetEnvironmentVariable("NP_TOKEN"); using var http = new HttpClient(); http.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); var res = await http.GetAsync( "https://acme.nolapro.com/!/api/v2/inventorytransfers/104"); res.EnsureSuccessStatusCode();
{
"status": "newunassigned",
"gencompanyidfrom": 1,
"gencompanyidto": 1,
"inventorylocationidfrom": 2,
"inventorylocationidto": 3,
"assigneduserid": 0,
"orderid": 0
}
What is moving, and what has arrived.
quantity is what was sent and quantityordered what was asked for; received says whether it has landed. Comparing them is how a short receipt is found, and a transfer system that cannot record one cannot account for shrinkage.
Requires scope items:read.
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | integer | The transfer id. |
| Status | Code | Meaning |
|---|---|---|
| 422 | unknown_value | No such record in this company. |
curl \ 'https://acme.nolapro.com/!/api/v2/inventorytransfers/104/lines' \ -H 'Authorization: Bearer $NP_TOKEN'
$ch = curl_init('https://acme.nolapro.com/!/api/v2/inventorytransfers/104/lines'); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('NP_TOKEN')], CURLOPT_RETURNTRANSFER => true, ]); $res = json_decode(curl_exec($ch), true);
import os, requests r = requests.get( "https://acme.nolapro.com/!/api/v2/inventorytransfers/104/lines", headers={"Authorization": f"Bearer {os.environ['NP_TOKEN']}"}, ) r.raise_for_status()
const res = await fetch( 'https://acme.nolapro.com/!/api/v2/inventorytransfers/104/lines', { method: 'GET', headers: { Authorization: `Bearer ${process.env.NP_TOKEN}` }, } ); const data = await res.json();
using System.Net.Http.Json; var token = Environment.GetEnvironmentVariable("NP_TOKEN"); using var http = new HttpClient(); http.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); var res = await http.GetAsync( "https://acme.nolapro.com/!/api/v2/inventorytransfers/104/lines"); res.EnsureSuccessStatusCode();