Skip to content

Custom fields list

Retrieves the list of custom fields in Liner. On success, returns all custom fields.

Note

Pagination is not implemented — the full list of custom fields is returned.


URL and method

GET /v2/custom-field/


Parameters

essence string optional
Entity the custom field is attached to. Allowed values: orders, leads.


Request example

curl -X GET "https://YOUR_LINER_API_HOST/v2/custom-fields/?essence=orders" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_TOKEN"
<?php

$host = 'https://YOUR_LINER_API_HOST';
$token = 'YOUR_API_TOKEN';

$query = http_build_query([
    'essence' => 'orders', // optional: orders | leads
]);

$ch = curl_init($host . '/v2/custom-fields/?' . $query);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: ' . $token,
    ],
    CURLOPT_TIMEOUT => 15,
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($response === false) {
    throw new RuntimeException('cURL error: ' . curl_error($ch));
}

curl_close($ch);

echo "HTTP {$httpCode}\n";
echo $response;
const host = "https://YOUR_LINER_API_HOST";
const token = "YOUR_API_TOKEN";

const params = new URLSearchParams();
// params.set("essence", "orders"); // optional: orders | leads

const res = await fetch(`${host}/v2/custom-fields/?${params.toString()}`, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": token
  }
});

const data = await res.json();
console.log("HTTP", res.status, data);

Response example

{
  "success": true,
  "message": "",
  "data": [
    {
      "id": 123,
      "title": "Source",
      "type": "string",
      "essence": "leads",
      "params": [
        {
          "code": "option_1",
          "sort": 10,
          "title": "Option 1"
        }
      ],
      "sort": 10
    }
  ]
}

Response fields

Fields in data

Field Type Description
id int Custom field identifier.
title string Custom field title.
type string Field type. Allowed values: string, int, float, date, datetime, bool, select, multiselect.
essence string Entity where the field is used. Allowed values: leads, orders.
params array<object> Field parameters. For select and multiselect types it contains the list of available options. For other types — an empty array.
sort int Sort order of the field.

Fields in params

Field Type Description
code string Option code.
sort int Option sort order.
title string Option title.

Note

The structure of the data field is described above. For the general API response format, see Request schema