Get Transaction
GET /transactions/{id}
Get one ledger row
Request
GET https://example.com/api/index.php/v1/nextinventory/transactions/{id}
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
id |
integer |
path |
Yes | (min 1) |
Responses
200 — The transaction.
{
"data": {
"id": 1,
"item_id": 1,
"item_title": "string",
"item_sku": "string",
"transaction_type": "string",
"quantity_change": 1.5,
"new_quantity": 1.5,
"transaction_unit_id": 1,
"original_quantity": 1.5,
"cost_per_unit": 1.5,
"total_cost": 1.5,
"batch_id": "string",
"recipient_id": 1,
"recipient": "string",
"reason": "string",
"created_by": 1,
"created_by_name": "string",
"created": "2026-01-01T12:00:00Z"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
|
data.item_id |
integer |
|
data.item_title |
string|null |
|
data.item_sku |
string|null |
|
data.transaction_type |
string |
|
data.quantity_change |
number |
Signed: negative for stock out. |
data.new_quantity |
number |
|
data.transaction_unit_id |
integer|null |
|
data.original_quantity |
number|null |
|
data.cost_per_unit |
number|null |
|
data.total_cost |
number|null |
|
data.batch_id |
string|null |
Shared by every row of one movement/transfer/adjustment. |
data.recipient_id |
integer|null |
|
data.recipient |
string|null |
|
data.reason |
string|null |
|
data.created_by |
integer |
|
data.created_by_name |
string|null |
|
data.created |
string|null |
(date-time) |
Errors
| Status | Code | When |
|---|---|---|
4 |
A refusal. Common codes: MISSING_TOKEN / INVALID_TOKEN (401); API_DISABLED, ACCOUNT_UNUSABLE, ACCESS_DENIED, TASK_NOT_ALLOWED, MISSING_SCOPE, APP_DISABLED, DEMO_LOCKED, FORBIDDEN (403); NOT_FOUND (404); BAD_REQUEST / INVALID_JSON / INVALID_IDEMPOTENCY_KEY (400, validation and stock rules, with the reason in title); IDEMPOTENCY_IN_PROGRESS (409); PRECONDITION_FAILED (412, the record changed since the If-Match ETag was read); IDEMPOTENCY_KEY_REUSED (422); RATE_LIMITED / TOO_MANY_FAILED_LOGINS (429, with a Retry-After header in seconds); SERVER_ERROR (500). |
Examples
curl
curl -s "https://example.com/api/index.php/v1/nextinventory/transactions/1" \
-H "Authorization: Bearer $API_TOKEN"
PHP
<?php
$ch = curl_init('https://example.com/api/index.php/v1/nextinventory/transactions/1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('API_TOKEN'),
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
JavaScript
const API_TOKEN = process.env.API_TOKEN;
const response = await fetch("https://example.com/api/index.php/v1/nextinventory/transactions/1", {
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
},
});
const data = await response.json();