Next Restaurant 6.1.0: move your data in, run payroll, and connect other systems Next Inventory 6.2.0: a REST API and webhooks for your other systems Next DB 6.1: Auto-Updating Tables, Printing, Phone Layout and SEO Next Task 6.0.0: a task manager for Joomla Next Inventory 6.1.1: smoother Check Out, no more list limits, and much faster PHP2Shell: Is Your Joomla Site Safe? What to Do Today Introducing Next Boards: Kanban project and task boards for Joomla Building the Future of Joomla Extensions
NextSoftware

List Custom Fields

GET /custom-fields

The published custom field definitions for items, warehouses or recipients

Scope customfields:read. Write a field as cf_<name> on POST / PATCH of the entity. Empty while the Custom Fields app is off.

Request

GET https://example.com/api/index.php/v1/nextinventory/custom-fields?context=<string>

Parameters

Name Type In Required Description
context string query No One of item, warehouse, recipient. Defaults to item.

Responses

200 — Definitions, in display order.

{
    "data": [
        {
            "id": 1,
            "name": "string",
            "label": "string",
            "description": "string",
            "field_type": "text",
            "context": "item",
            "default_value": "string",
            "options": "string",
            "validation_rules": "string",
            "is_required": true,
            "is_searchable": true,
            "is_filterable": true,
            "ordering": 1,
            "fieldset_name": "string",
            "fieldset_title": "string"
        }
    ]
}
Field Type Meaning
data[].id integer
data[].name string Send as cf_<name>.
data[].label string
data[].description string|null
data[].field_type string One of text, textarea, number, select, checkbox, date, radio, email, url, color, file, multiselect.
data[].context string One of item, warehouse, recipient.
data[].default_value string|null
data[].options object Choices for select / radio / multiselect / checkbox.
data[].validation_rules object
data[].is_required boolean
data[].is_searchable boolean
data[].is_filterable boolean
data[].ordering integer
data[].fieldset_name string|null
data[].fieldset_title string|null

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/custom-fields" \
  -H "Authorization: Bearer $API_TOKEN"

PHP

<?php
$ch = curl_init('https://example.com/api/index.php/v1/nextinventory/custom-fields?context=<string>');

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/custom-fields?context=<string>", {
  headers: {
    "Authorization": `Bearer ${API_TOKEN}`,
  },
});
const data = await response.json();

All Extensions